snaptrade-typescript-sdk 13.2.2 → 13.2.4
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 +136 -1
- package/dist/browser.umd.js +3 -3
- package/dist/index.cjs +239 -1
- package/dist/index.d.cts +159 -6
- package/dist/index.d.mts +159 -6
- package/dist/index.d.ts +159 -6
- package/dist/index.mjs +239 -1
- package/package.json +1 -1
package/dist/browser.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.client={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){return function(){return e.apply(t,arguments)}}let{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:o,toStringTag:s}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>typeof e==`string`&&(e===`__proto__`||e===`constructor`||e===`prototype`),u=(e,t,n)=>e===Object.prototype||!n&&t===null,d=e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&n.writable===!0})},f=(e,t)=>{let n=e,r=[];for(;n!=null;){if(r.indexOf(n)!==-1)return!1;r.push(n);let i=a(n);if(u(n,i,n===e))return!1;if(c(n,t))return!0;n=i}return!1},p=(e,t)=>e!=null&&f(e,t)?e[t]:void 0,m=e=>{if(e==null||typeof e!=`object`&&typeof e!=`function`)return e;let t=a(e);if(t===null&&d(e))return e;let n=Object.create(null),r=Object.create(null),i=[],o=e;for(;o!=null&&i.indexOf(o)===-1;){i.push(o);let s=o===e?t:a(o);if(u(o,s,o===e))break;let d=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&d.push(...Object.getOwnPropertySymbols(o));for(let t of d)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);o=s}return n},h=(e=>t=>{let n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),g=e=>(e=e.toLowerCase(),t=>h(t)===e),_=e=>t=>typeof t===e,{isArray:v}=Array,y=_(`undefined`);function b(e){return e!==null&&!y(e)&&e.constructor!==null&&!y(e.constructor)&&S(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let x=g(`ArrayBuffer`);function ee(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&x(e.buffer),t}let te=_(`string`),S=_(`function`),ne=_(`number`),
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.client={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};function r(e,t){return function(){return e.apply(t,arguments)}}let{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:o,toStringTag:s}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>typeof e==`string`&&(e===`__proto__`||e===`constructor`||e===`prototype`),u=(e,t,n)=>e===Object.prototype||!n&&t===null,d=e=>{if(!Object.isExtensible(e))return!1;let t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;let n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&n.writable===!0})},f=(e,t)=>{let n=e,r=[];for(;n!=null;){if(r.indexOf(n)!==-1)return!1;r.push(n);let i=a(n);if(u(n,i,n===e))return!1;if(c(n,t))return!0;n=i}return!1},p=(e,t)=>e!=null&&f(e,t)?e[t]:void 0,m=e=>{if(e==null||typeof e!=`object`&&typeof e!=`function`)return e;let t=a(e);if(t===null&&d(e))return e;let n=Object.create(null),r=Object.create(null),i=[],o=e;for(;o!=null&&i.indexOf(o)===-1;){i.push(o);let s=o===e?t:a(o);if(u(o,s,o===e))break;let d=Object.getOwnPropertyNames(o);Object.getOwnPropertySymbols&&d.push(...Object.getOwnPropertySymbols(o));for(let t of d)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);o=s}return n},h=(e=>t=>{let n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),g=e=>(e=e.toLowerCase(),t=>h(t)===e),_=e=>t=>typeof t===e,{isArray:v}=Array,y=_(`undefined`);function b(e){return e!==null&&!y(e)&&e.constructor!==null&&!y(e.constructor)&&S(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}let x=g(`ArrayBuffer`);function ee(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&x(e.buffer),t}let te=_(`string`),S=_(`function`),ne=_(`number`),re=e=>typeof e==`object`&&!!e,ie=e=>e===!0||e===!1,ae=e=>{if(!re(e))return!1;let t=a(e);return(t===null||t===Object.prototype||a(t)===null)&&!f(e,s)&&!f(e,o)},oe=e=>{if(!re(e)||b(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},se=g(`Date`),C=g(`File`),w=e=>!!(e&&e.uri!==void 0),T=e=>e&&e.getParts!==void 0,ce=g(`Blob`),le=g(`FileList`),ue=g(`Set`),de=e=>re(e)&&S(e.pipe);function E(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}let D=E(),O=D.FormData===void 0?void 0:D.FormData,fe=e=>{if(!e)return!1;if(O&&e instanceof O)return!0;let t=a(e);if(!t||t===Object.prototype||!S(e.append))return!1;let n=h(e);return n===`formdata`||n===`object`&&S(e.toString)&&e.toString()===`[object FormData]`},pe=g(`URLSearchParams`),[k,me,he,ge]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(g),_e=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function ve(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),v(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(b(e))return;let i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length,o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function ye(e,t){if(b(e))return null;t=t.toLowerCase();let n=Object.keys(e),r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}let A=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,be=e=>!y(e)&&e!==A;function xe(...e){let{caseless:t,skipUndefined:n}=be(this)&&this||{},r={},i=(e,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=t&&typeof i==`string`&&ye(r,i)||i,o=c(r,a)?r[a]:void 0;ae(o)&&ae(e)?r[a]=xe(o,e):ae(e)?r[a]=xe({},e):v(e)?r[a]=e.slice():(!n||!y(e))&&(r[a]=e)};for(let t=0,n=e.length;t<n;t++){let n=e[t];if(!n||b(n)||(ve(n,i),typeof n!=`object`||v(n)))continue;let r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){let t=r[e];Ne.call(n,t)&&i(n[t],t)}}return r}let Se=(e,t,n,{allOwnKeys:i}={})=>(ve(t,(t,i)=>{n&&S(t)?Object.defineProperty(e,i,{__proto__:null,value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),Ce=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),we=(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)},Te=(e,t,n,r)=>{let i,o,s,c={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ee=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},De=e=>{if(!e)return null;if(v(e))return e;let t=e.length;if(!ne(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},Oe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&a(Uint8Array)),ke=(e,t)=>{let n=(e&&e[o]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},Ae=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},je=g(`HTMLFormElement`),Me=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),{propertyIsEnumerable:Ne}=Object.prototype,Pe=g(`RegExp`),Fe=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};ve(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Ie=e=>{Fe(e,(t,n)=>{if(S(e)&&[`arguments`,`caller`,`callee`].includes(n))return!1;let r=e[n];if(S(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)})}})},Le=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return v(e)?r(e):r(String(e).split(t)),n},Re=()=>{},ze=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Be(e){return!!(e&&S(e.append)&&e[s]===`FormData`&&e[o])}let Ve=e=>{let t=new WeakSet,n=e=>{if(re(e)){if(t.has(e))return;if(b(e))return e;if(!(`toJSON`in e)){t.add(e);let r;if(ue(e)){r=[];for(let t of e){let e=n(t);!y(e)&&r.push(e)}}else r=v(e)?[]:{},ve(e,(e,t)=>{let i=n(e);!y(i)&&(r[t]=i)});return t.delete(e),r}}return e};return n(e)},He=g(`AsyncFunction`),Ue=e=>e&&(re(e)||S(e))&&S(e.then)&&S(e.catch),We=((e,t)=>e?setImmediate:t?((e,t)=>(A.addEventListener(`message`,({source:n,data:r})=>{n===A&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),A.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,S(A.postMessage)),Ge=typeof queueMicrotask<`u`?queueMicrotask.bind(A):typeof process<`u`&&process.nextTick||We,Ke=e=>e!=null&&S(e[o]);var j={isArray:v,isArrayBuffer:x,isBuffer:b,isFormData:fe,isArrayBufferView:ee,isString:te,isNumber:ne,isBoolean:ie,isObject:re,isPlainObject:ae,isEmptyObject:oe,isReadableStream:k,isRequest:me,isResponse:he,isHeaders:ge,isUndefined:y,isDate:se,isFile:C,isReactNativeBlob:w,isReactNative:T,isBlob:ce,isRegExp:Pe,isFunction:S,isStream:de,isURLSearchParams:pe,isTypedArray:Oe,isFileList:le,forEach:ve,merge:xe,extend:Se,trim:_e,stripBOM:Ce,inherits:we,toFlatObject:Te,kindOf:h,kindOfTest:g,endsWith:Ee,toArray:De,forEachEntry:ke,matchAll:Ae,isHTMLForm:je,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:f,getSafeProp:p,toSafeFlatObject:m,reduceDescriptors:Fe,freezeMethods:Ie,toObjectSet:Le,toCamelCase:Me,noop:Re,toFiniteNumber:ze,findKey:ye,global:A,isContextDefined:be,isSpecCompliantForm:Be,toJSONObject:Ve,isAsyncFn:He,isThenable:Ue,setImmediate:We,asap:Ge,isIterable:Ke,isSafeIterable:e=>e!=null&&f(e,o)&&Ke(e)};let qe=j.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`]);var Je=e=>{let t={},n,r,i;return e&&e.split(`
|
|
2
2
|
`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim();let a=j.hasOwnProp(t,n);!n||a&&j.hasOwnProp(qe,n)||(n===`set-cookie`?a?t[n].push(r):t[n]=[r]:t[n]=a?t[n]+`, `+r:r)}),t};function Ye(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}let Xe=RegExp(`[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+`,`g`),Ze=RegExp(`[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+`,`g`);function Qe(e,t){return j.isArray(e)?e.map(e=>Qe(e,t)):Ye(String(e).replace(t,``))}let $e=e=>Qe(e,Xe),et=e=>Qe(e,Ze);function tt(e){let t=Object.create(null);return j.forEach(e.toJSON(),(e,n)=>{t[n]=et(e)}),t}let nt=Symbol(`internals`);function rt(e){return e&&String(e).trim().toLowerCase()}function it(e){return e===!1||e==null?e:j.isArray(e)?e.map(it):$e(String(e))}function at(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}let ot=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function st(e){let t=0,n=e.length;for(;t<n;){let n=e.charCodeAt(t);if(n!==9&&n!==32)break;t+=1}for(;n>t;){let t=e.charCodeAt(n-1);if(t!==9&&t!==32)break;--n}return t===0&&n===e.length?e:e.slice(t,n)}function ct(e){let t=e.length-1;if(t<1||e.charCodeAt(0)!==34||e.charCodeAt(t)!==34)return e;let n=``;for(let r=1;r<t;r++){let i=e.charCodeAt(r);if(i===34||i===92&&(r+=1,r>=t))return e;n+=e[r]}return n}function lt(e){let t=Object.create(null),n=String(e),r=0,i=!1,a=!1;function o(e){let i=st(n.slice(r,e)),a=i.indexOf(`=`);if(a<1)return;let o=st(i.slice(0,a));if(!ot.test(o))return;let s=o.toLowerCase();s===`__proto__`||s===`constructor`||s===`prototype`||(t[s]=ct(st(i.slice(a+1))))}for(let e=0;e<n.length;e++){let t=n.charCodeAt(e);i?a?a=!1:t===92?a=!0:t===34&&(i=!1):t===34?i=!0:(t===44||t===59)&&(o(e),r=e+1)}return o(n.length),t}let ut=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function dt(e,t,n,r,i){if(j.isFunction(r))return r.call(this,t,n);if(i&&(t=n),j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function ft(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function pt(e,t){let n=j.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var M=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=rt(t);if(!i)return;let a=j.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=it(e))}let a=(e,t)=>j.forEach(e,(e,n)=>i(e,n,t));if(j.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(j.isString(e)&&(e=e.trim())&&!ut(e))a(Je(e),t);else if(j.isObject(e)&&j.isSafeIterable(e)){let n=Object.create(null),r,i;for(let t of e){if(!j.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);i=t[0],j.hasOwnProp(n,i)?(r=n[i],n[i]=j.isArray(r)?[...r,t[1]]:[r,t[1]]):n[i]=t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=rt(e),e){let n=j.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return at(e);if(j.isFunction(t))return t.call(this,e,n);if(j.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=rt(e),e){let n=j.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||dt(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=rt(e),e){let i=j.findKey(n,e);i&&(!t||dt(n,n[i],i,t))&&(delete n[i],r=!0)}}return j.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||dt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return j.forEach(this,(r,i)=>{let a=j.findKey(n,i);if(a){t[a]=it(r),delete t[i];return}let o=e?ft(i):String(i).trim();o!==i&&delete t[i],t[o]=it(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return j.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&j.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(`
|
|
3
|
-
`)}getSetCookie(){let e=this.get(`set-cookie`);return j.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return lt(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[nt]=this[nt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=rt(e);t[r]||(pt(n,e),t[r]=!0)}return j.isArray(e)?e.forEach(r):r(e),this}};M.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),j.reduceDescriptors(M.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),j.freezeMethods(M);let mt=`[REDACTED ****]`;function ht(e){if(j.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(j.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function gt(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||j.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof M&&(e=e.toJSON()),r.push(e);let t;if(j.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);j.isUndefined(r)||(t[n]=r)});else{if(!j.isPlainObject(e)&&ht(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?mt:i(a);j.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function _t(e){try{return String(e)}catch{return``}}function vt(e){return e.errors.map(e=>{try{return e&&e.message?_t(e.message):_t(e)}catch{return``}}).filter(Boolean).join(`; `)||e.name||`AggregateError`}var N=class e extends Error{static from(t,n,r,i,a,o){let s=t.message;!s&&j.isArray(t.errors)&&t.errors.length&&(s=vt(t));let c=new e(s,n||t.code,r,i,a);return Object.defineProperty(c,`cause`,{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(e,t,n,r,i){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),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&j.hasOwnProp(e,`redact`)?e.redact:void 0,n=j.isArray(t)&&t.length>0?gt(e,t):j.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}}};N.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,N.ERR_BAD_OPTION=`ERR_BAD_OPTION`,N.ECONNABORTED=`ECONNABORTED`,N.ETIMEDOUT=`ETIMEDOUT`,N.ECONNREFUSED=`ECONNREFUSED`,N.ERR_NETWORK=`ERR_NETWORK`,N.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,N.ERR_DEPRECATED=`ERR_DEPRECATED`,N.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,N.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,N.ERR_CANCELED=`ERR_CANCELED`,N.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,N.ERR_INVALID_URL=`ERR_INVALID_URL`,N.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function yt(e){return j.isPlainObject(e)||j.isArray(e)}function bt(e){return j.endsWith(e,`[]`)?e.slice(0,-2):e}function xt(e,t,n){return e?e.concat(t).map(function(e,t){return e=bt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function St(e){return j.isArray(e)&&!e.some(yt)}let Ct=j.toFlatObject(j,{},null,function(e){return/^is[A-Z]/.test(e)});function wt(e,t,n){if(!j.isObject(e))throw TypeError(`target must be an object`);t=t||new FormData;let r=(e,t)=>{let r=j.getSafeProp(n,e);return j.isUndefined(r)?t:r},i=r(`metaTokens`,!0),a=r(`visitor`)||h,o=r(`dots`,!1),s=r(`indexes`,!1),c=r(`Blob`)||typeof Blob<`u`&&Blob,l=r(`maxDepth`,100),u=c&&j.isSpecCompliantForm(t),d=[];if(!j.isFunction(a))throw TypeError(`visitor must be a function`);function f(e){if(e===null)return``;if(j.isDate(e))return e.toISOString();if(j.isBoolean(e))return e.toString();if(!u&&j.isBlob(e))throw new N(`Blob is not supported. Use a Buffer instead.`);if(j.isArrayBuffer(e)||j.isTypedArray(e)){if(u&&typeof c==`function`)return new c([e]);throw new N(`Blob is not supported. Use a Buffer instead.`,N.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new N(`Object is too deeply nested (`+e+` levels). Max depth: `+l,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,t){if(l===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!j.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r})}function h(e,n,r){let a=e;if(j.isReactNative(t)&&j.isReactNativeBlob(e))return t.append(xt(r,n,o),f(e)),!1;if(e&&!r&&typeof e==`object`){if(j.endsWith(n,`{}`))n=i?n:n.slice(0,-2),e=m(e,1);else if(j.isArray(e)&&St(e)||(j.isFileList(e)||j.endsWith(n,`[]`))&&(a=j.toArray(e)))return n=bt(n),a.forEach(function(e,r){!(j.isUndefined(e)||e===null)&&t.append(s===!0?xt([n],r,o):s===null?n:n+`[]`,f(e))}),!1}return yt(e)?!0:(t.append(xt(r,n,o),f(e)),!1)}let g=Object.assign(Ct,{defaultVisitor:h,convertValue:f,isVisitable:yt});function _(e,n,r=0){if(!j.isUndefined(e)){if(p(r),d.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));d.push(e),j.forEach(e,function(e,i){(!(j.isUndefined(e)||e===null)&&a.call(t,e,j.isString(i)?i.trim():i,n,g))===!0&&_(e,n?n.concat(i):[i],r+1)}),d.pop()}}if(!j.isObject(e))throw TypeError(`data must be an object`);return _(e),t}function Tt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Et(e,t){this._pairs=[],e&&wt(e,this,t)}let Dt=Et.prototype;Dt.append=function(e,t){this._pairs.push([e,t])},Dt.toString=function(e){let t=e?t=>e.call(this,t,Tt):Tt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Ot(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function kt(e,t,n){if(!t)return e;e=e||``;let r=j.isFunction(n)?{serialize:n}:n,i=j.getSafeProp(r,`encode`)||Ot,a=j.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):j.isURLSearchParams(t)?t.toString():new Et(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}let At=Symbol(`internals`);function jt(e){return e?e.length:0}function Mt(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function Nt(e,t){let n=e.handlers,r=jt(n);n===t.handlersRef?r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()):(t.handlersRef=n,t.handlerEntries.clear()),t.handlersLength=r}var Pt=class{constructor(){this.handlers=[],this[At]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){let r={fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null},i=this[At];this.handlers??(this.handlers=[]),Nt(this,i);let a=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(a,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,a}eject(e){let t=this[At];Nt(this,t);let n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(Mt(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Nt(this,this[At]))}forEach(e){let t=this[At];Nt(this,t),t.iterationDepth++;try{j.forEach(this.handlers,function(t){t!==null&&e(t)})}finally{--t.iterationDepth||(Nt(this,t),Mt(this.handlers),t.handlersLength=jt(this.handlers))}}},Ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},It={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Et,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Lt=n({hasBrowserEnv:()=>Rt,hasStandardBrowserEnv:()=>Bt,hasStandardBrowserWebWorkerEnv:()=>Vt,navigator:()=>zt,origin:()=>Ht});let Rt=typeof window<`u`&&typeof document<`u`,zt=typeof navigator==`object`&&navigator||void 0,Bt=Rt&&(!zt||[`ReactNative`,`NativeScript`,`NS`].indexOf(zt.product)<0),Vt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Ht=Rt&&window.location.href||`http://localhost`;var P={...Lt,...It};function Ut(e,t){return wt(e,new P.classes.URLSearchParams,{visitor:function(e,t,n,r){return P.isNode&&j.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Wt(e){if(e>100)throw new N(`FormData field is too deeply nested (`+e+` levels). Max depth: 100`,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Gt(e){let t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g,r;for(;(r=n.exec(e))!==null;)Wt(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Kt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function qt(e){function t(e,n,r,i){Wt(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&j.isArray(r)?r.length:a,s?(j.hasOwnProp(r,a)?r[a]=j.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!j.hasOwnProp(r,a)||!j.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&j.isArray(r[a])&&(r[a]=Kt(r[a])),!o)}if(j.isFormData(e)&&j.isFunction(e.entries)){let n={};return j.forEachEntry(e,(e,r)=>{t(Gt(e),r,n,0)}),n}return null}let Jt=Object.freeze([`get`,`delete`,`head`,`options`,`post`,`put`,`patch`,`purge`,`link`,`unlink`,`query`]),Yt=(e,t)=>e!=null&&j.hasOwnProp(e,t)?e[t]:void 0;function Xt(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}let Zt={transitional:Ft,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=j.isObject(e);if(i&&j.isHTMLForm(e)&&(e=new FormData(e)),j.isFormData(e))return r?JSON.stringify(qt(e)):e;if(j.isArrayBuffer(e)||j.isBuffer(e)||j.isStream(e)||j.isFile(e)||j.isBlob(e)||j.isReadableStream(e))return e;if(j.isArrayBufferView(e))return e.buffer;if(j.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Yt(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Ut(e,t).toString();if((a=j.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Yt(this,`env`),r=n&&n.FormData;return wt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Xt(e)):e}],transformResponse:[function(e){let t=Yt(this,`transitional`)||Zt.transitional,n=t&&t.forcedJSONParsing,r=Yt(this,`responseType`),i=r===`json`;if(j.isResponse(e)||j.isReadableStream(e))return e;if(e&&j.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Yt(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?N.from(e,N.ERR_BAD_RESPONSE,this,null,Yt(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};j.forEach(Jt,e=>{Zt.headers[e]={}});function Qt(e,t){let n=this||Zt,r=t||n,i=M.from(r.headers),a=r.data;return j.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function $t(e){return!!(e&&e.__CANCEL__)}var en=class extends N{constructor(e,t,n){super(e??`canceled`,N.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function tn(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new N(`Request failed with status code `+n.status,n.status>=400&&n.status<500?N.ERR_BAD_REQUEST:N.ERR_BAD_RESPONSE,n.config,n.request,n))}let nn=/[\t\n\r]/g;function rn(e){if(typeof e!=`string`)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(nn,``)}function an(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function on(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function sn(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i),(...e)=>o(e)]}let cn=(e,t,n=3)=>{let r=0,i=on(50,250);return sn(n=>{if(!n||!j.isNumber(n.loaded))return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,o==null?a:Math.min(a,o)),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},ln=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},un=(e,t=j.asap)=>(...n)=>t(()=>e(...n));var dn=P.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,P.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(P.origin),P.navigator&&/(msie|trident)/i.test(P.navigator.userAgent)):()=>!0,fn=P.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];j.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),j.isString(r)&&s.push(`path=${r}`),j.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),j.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function pn(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function mn(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+`/`+t.replace(/^\/+/,``)}let hn=/^https?:(?!\/\/)/i;function gn(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n=``)=>`${t}${n}${mt}`)}function _n(e){let t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${mt}@`),n=t.indexOf(`#`),r=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${mt}`);return n===-1?r:`${r}#${gn(t.slice(n+1))}`}function vn(e,t){if(typeof e==`string`){let n=rn(e);if(hn.test(n))throw new N(`Invalid URL ${JSON.stringify(_n(n))}: missing "//" after protocol`,N.ERR_INVALID_URL,t)}}function yn(e,t,n,r){vn(t,r);let i=!pn(t);return e&&(i||n===!1)?(vn(e,r),mn(e,t)):t}let bn=e=>e instanceof M?{...e}:e,xn=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function Sn(e,t){e=e||{},t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return j.isPlainObject(e)&&j.isPlainObject(t)?j.merge.call({caseless:r},e,t):j.isPlainObject(t)?j.merge({},t):j.isArray(t)?t.slice():t}function i(e,t,n,i){if(!j.isUndefined(t))return r(e,t,n,i);if(!j.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!j.isUndefined(t))return r(void 0,t)}function o(e,t){if(!j.isUndefined(t))return r(void 0,t);if(!j.isUndefined(e))return r(void 0,e)}function s(n){let r=j.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!j.isUndefined(r))if(j.isPlainObject(r)){if(j.hasOwnProp(r,n))return r[n]}else return;let i=j.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(j.isPlainObject(i)&&j.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(j.hasOwnProp(t,a))return r(n,i);if(j.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(bn(e),bn(t),n,!0)};return j.forEach(xn({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=j.hasOwnProp(l,r)?l[r]:i,o=a(j.hasOwnProp(e,r)?e[r]:void 0,j.hasOwnProp(t,r)?t[r]:void 0,r);j.isUndefined(o)&&a!==c||(n[r]=o)}),j.hasOwnProp(t,`validateStatus`)&&j.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(j.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}let Cn=[`content-type`,`content-length`];function wn(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Cn.includes(t.toLowerCase())&&e.set(t,n)})}let Tn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function En(e){let t=Sn({},e),n=e=>j.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=M.from(s),t.url=kt(yn(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=j.getSafeProp(c,`username`)||``,n=j.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?Tn(n):``)))}catch(t){throw N.from(t,N.ERR_BAD_OPTION_VALUE,e)}}if(j.isFormData(r)){let e=j.getSafeProp(r,`getHeaders`);P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv||j.isReactNative(r)?s.setContentType(void 0):j.isFunction(e)&&wn(s,e.call(r),n(`formDataHeaderPolicy`))}if(P.hasStandardBrowserEnv&&(j.isFunction(i)&&(i=i(t)),i===!0||i==null&&dn(t.url))){let e=a&&o&&fn.read(o);e&&s.set(a,e)}return t}var Dn=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=En(e),i=r.data,a=M.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p,m;function h(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let g=new XMLHttpRequest;g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout;function _(i){if(!g)return;if(g.status===0&&(an(rn(r.url))||an(P.origin))!==`file`&&!(g.responseURL&&g.responseURL.startsWith(`file:`))){n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),g=null;return}try{i?m&&m(i):p&&p()}catch(e){setTimeout(()=>{throw e})}if(!g)return;let a=M.from(`getAllResponseHeaders`in g&&g.getAllResponseHeaders());tn(function(e){t(e),h()},function(e){n(e),h()},{data:!o||o===`text`||o===`json`?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:a,config:e,request:g}),g=null}`onloadend`in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.startsWith(`file:`))||setTimeout(_)},g.onabort=function(){g&&(n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),g=null)},g.onerror=function(t){let r=new N(t&&t.message?t.message:`Network Error`,N.ERR_NETWORK,e,g);r.event=t||null,n(r),h(),g=null},g.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Ft;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new N(t,i.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,g)),h(),g=null},i===void 0&&a.setContentType(null),`setRequestHeader`in g&&j.forEach(tt(a),function(e,t){g.setRequestHeader(t,e)}),j.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),o&&o!==`json`&&(g.responseType=r.responseType),c&&([d,p,m]=cn(c,!0),g.addEventListener(`progress`,d)),s&&g.upload&&([u,f]=cn(s),g.upload.addEventListener(`progress`,u),g.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{g&&(n(!t||t.type?new en(null,e,g):t),g.abort(),h(),g=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let v=an(r.url);if(v&&!P.protocols.includes(v)){n(new N(`Unsupported protocol `+v+`:`,N.ERR_BAD_REQUEST,e)),h();return}g.send(i||null)})};let On=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof N?t:new en(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new N(`timeout of ${t}ms exceeded`,N.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),e=null)};e.forEach(e=>{if(!r){if(e.aborted){i.call(e);return}e.addEventListener(`abort`,i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>j.asap(o),s},kn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},An=async function*(e,t){for await(let n of jn(e))yield*kn(n,t)},jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Mn=(e,t,n,r)=>{let i=An(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},Nn=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Pn=(e,t,n)=>t+2<n&&Nn(e.charCodeAt(t+1))&&Nn(e.charCodeAt(t+2)),Fn=e=>e<=57?e-48:(e&223)-55,In=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Ln=e=>e===9||e===10||e===12||e===13||e===32,Rn=e=>{let t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},zn=e=>{let t=e.length,n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Bn=e=>{let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&Pn(e,a,t)&&(o=Fn(e.charCodeAt(a+1))*16+Fn(e.charCodeAt(a+2)),a+=2),!Ln(o)){if(o===61){r++;continue}if(!In(o)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?zn(e):Rn(n)},Vn=(e,t)=>{if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let n=e.indexOf(`,`);if(n<0)return 0;let r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(n===37&&Pn(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};function Hn(e){let t=typeof e==`string`?e.indexOf(`#`):-1;return Vn(t===-1?e:e.slice(0,t),Bn)}let Un=`1.20.0`,Wn=64*1024,Gn={cache:`default`,redirect:`follow`,referrer:`about:client`,referrerPolicy:``,mode:`cors`,integrity:``,keepalive:!1,priority:`auto`,window:null},{isFunction:Kn}=j,qn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Jn=e=>{if(!j.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xn=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},Zn=e=>{let t=j.global!==void 0&&j.global!==null?j.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=j.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?Kn(i):typeof fetch==`function`,c=Kn(a),l=Kn(o);if(!s)return!1;let u=s&&Kn(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Yn(()=>{let e=!1,t=new a(P.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Yn(()=>j.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(j.isBlob(e))return e.size;if(j.isSpecCompliantForm(e))return(await new a(P.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(j.isArrayBufferView(e)||j.isArrayBuffer(e))return e.byteLength;if(j.isURLSearchParams(e)&&(e+=``),j.isString(e))return(await d(e)).byteLength},g=async(e,t)=>j.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:ee=`same-origin`,fetchOptions:te,maxContentLength:S,maxBodyLength:ne,maxRedirects:C}=En(e),re=j.isNumber(S)&&S>-1,ie=j.isNumber(ne)&&ne>-1,ae=t=>j.hasOwnProp(e,t)?e[t]:void 0,oe=i||fetch;b=b?(b+``).toLowerCase():`text`;let w=On([l,d&&d.toAbortSignal()],_),T=null,E=w&&w.unsubscribe&&(()=>{w.unsubscribe()}),se,ce=null,le=()=>new N(`Request body larger than maxBodyLength limit`,N.ERR_BAD_REQUEST,e,T);try{let i,l=ae(`auth`);if(l&&(i={username:j.getSafeProp(l,`username`)||``,password:j.getSafeProp(l,`password`)||``}),Xn(t)){let e=new URL(t,P.origin);!i&&(e.username||e.password)&&(i={username:Jn(e.username),password:Jn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(qn((i.username||``)+`:`+(i.password||``))))),re&&typeof t==`string`&&t.startsWith(`data:`)&&Hn(t)>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,T);if(ie&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(se=e,e>ne))throw le()}let d=ie&&(j.isReadableStream(s)||j.isStream(s)),_=(e,t,n)=>Mn(e,Wn,e=>{if(ie&&e>ne)throw ce=le();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(se=se??await g(x,s),se!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(j.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&ln(se,cn(un(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new N(`Stream request bodies are not supported by the current fetch implementation`,N.ERR_NOT_SUPPORT,e,T);j.isString(ee)||(ee=ee?`include`:`omit`);let ue=c&&`credentials`in a.prototype;if(j.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+Un,!1);let D=te==null?te:Object.assign(Object.create(null),te);D&&(delete D.body,delete D.headers,delete D.method,delete D.signal,delete D.duplex,delete D.credentials);let O=Object.assign(Object.create(null),D,{signal:w,method:n.toUpperCase(),headers:tt(x.normalize()),body:s,duplex:`half`,credentials:ue?ee:void 0});c&&(j.forEach(Gn,(e,t)=>{O[t]===void 0&&(O[t]=e)}),O.signal===void 0&&(O.signal=null),O.body===void 0&&(O.body=null)),C===0&&(O.redirect=`manual`,D&&(D.redirect=`manual`)),T=c&&new a(t,O);let k=await(c?oe(T,D):oe(t,O)),de=M.from(k.headers);if(re){let t=j.toFiniteNumber(de.getContentLength());if(t!=null&&t>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,T)}let fe=p&&(b===`stream`||b===`response`);if(p&&k.body&&(v||re||fe&&E)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=k[e]});let n=j.toFiniteNumber(de.getContentLength()),[r,i]=v&&ln(n,cn(un(v),!0))||[],a=0;k=new o(Mn(k.body,Wn,t=>{if(re&&(a=t,a>S))throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,T);r&&r(t)},()=>{i&&i(),E&&E()}),t)}b=b||`text`;let A=await m[j.findKey(m,b)||`text`](k,e);if(re&&!p&&!fe){let t;if(A!=null&&(typeof A.byteLength==`number`?t=A.byteLength:typeof A.size==`number`?t=A.size:typeof A==`string`&&(t=typeof r==`function`?new r().encode(A).byteLength:A.length)),typeof t==`number`&&t>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,T)}return!fe&&E&&E(),await new Promise((t,n)=>{tn(t,n,{data:A,headers:M.from(k.headers),status:k.status,statusText:k.statusText,config:e,request:T})})}catch(t){if(E&&E(),w&&w.aborted&&w.reason instanceof N){let n=w.reason;throw n.config=e,T&&(n.request=T),t!==n&&Object.defineProperty(n,`cause`,{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(ce)throw T&&!ce.request&&(ce.request=T),ce;if(t instanceof N)throw T&&!t.request&&(t.request=T),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new N(`Network Error`,N.ERR_NETWORK,e,T,t&&t.response);throw Object.defineProperty(n,`cause`,{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw N.from(t,t&&t.code,e,T,t&&t.response)}}},Qn=new Map,$n=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Qn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Zn(t)),l=c;return c};$n();let er={http:null,xhr:Dn,fetch:{get:$n}};j.forEach(er,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{__proto__:null,value:t})}catch{}Object.defineProperty(e,`adapterName`,{__proto__:null,value:t})}});let tr=e=>`- ${e}`,nr=e=>j.isFunction(e)||e===null||e===!1;function rr(e,t){e=j.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!nr(r)&&(i=er[(n=String(r)).toLowerCase()],i===void 0))throw new N(`Unknown adapter '${n}'`);if(i&&(j.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new N(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
3
|
+
`)}getSetCookie(){let e=this.get(`set-cookie`);return j.isArray(e)?e:e==null||e===!1?[]:[e]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return lt(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[nt]=this[nt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=rt(e);t[r]||(pt(n,e),t[r]=!0)}return j.isArray(e)?e.forEach(r):r(e),this}};M.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),j.reduceDescriptors(M.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),j.freezeMethods(M);let mt=`[REDACTED ****]`;function ht(e){if(j.hasOwnProp(e,`toJSON`))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(j.hasOwnProp(t,`toJSON`))return!0;t=Object.getPrototypeOf(t)}return!1}function gt(e,t){let n=new Set(t.map(e=>String(e).toLowerCase())),r=[],i=e=>{if(typeof e!=`object`||!e||j.isBuffer(e))return e;if(r.indexOf(e)!==-1)return;e instanceof M&&(e=e.toJSON()),r.push(e);let t;if(j.isArray(e))t=[],e.forEach((e,n)=>{let r=i(e);j.isUndefined(r)||(t[n]=r)});else{if(!j.isPlainObject(e)&&ht(e))return r.pop(),e;t=Object.create(null);for(let[r,a]of Object.entries(e)){let e=n.has(r.toLowerCase())?mt:i(a);j.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return i(e)}function _t(e){try{return String(e)}catch{return``}}function vt(e){return e.errors.map(e=>{try{return e&&e.message?_t(e.message):_t(e)}catch{return``}}).filter(Boolean).join(`; `)||e.name||`AggregateError`}var N=class e extends Error{static from(t,n,r,i,a,o){let s=t.message;!s&&j.isArray(t.errors)&&t.errors.length&&(s=vt(t));let c=new e(s,n||t.code,r,i,a);return Object.defineProperty(c,`cause`,{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),c.name=t.name,t.status!=null&&c.status==null&&(c.status=t.status),o&&Object.assign(c,o),c}constructor(e,t,n,r,i){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),i&&(this.response=i,this.status=i.status)}toJSON(){let e=this.config,t=e&&j.hasOwnProp(e,`redact`)?e.redact:void 0,n=j.isArray(t)&&t.length>0?gt(e,t):j.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}}};N.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,N.ERR_BAD_OPTION=`ERR_BAD_OPTION`,N.ECONNABORTED=`ECONNABORTED`,N.ETIMEDOUT=`ETIMEDOUT`,N.ECONNREFUSED=`ECONNREFUSED`,N.ERR_NETWORK=`ERR_NETWORK`,N.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,N.ERR_DEPRECATED=`ERR_DEPRECATED`,N.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,N.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,N.ERR_CANCELED=`ERR_CANCELED`,N.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,N.ERR_INVALID_URL=`ERR_INVALID_URL`,N.ERR_FORM_DATA_DEPTH_EXCEEDED=`ERR_FORM_DATA_DEPTH_EXCEEDED`;function yt(e){return j.isPlainObject(e)||j.isArray(e)}function bt(e){return j.endsWith(e,`[]`)?e.slice(0,-2):e}function xt(e,t,n){return e?e.concat(t).map(function(e,t){return e=bt(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function St(e){return j.isArray(e)&&!e.some(yt)}let Ct=j.toFlatObject(j,{},null,function(e){return/^is[A-Z]/.test(e)});function wt(e,t,n){if(!j.isObject(e))throw TypeError(`target must be an object`);t=t||new FormData;let r=(e,t)=>{let r=j.getSafeProp(n,e);return j.isUndefined(r)?t:r},i=r(`metaTokens`,!0),a=r(`visitor`)||h,o=r(`dots`,!1),s=r(`indexes`,!1),c=r(`Blob`)||typeof Blob<`u`&&Blob,l=r(`maxDepth`,100),u=c&&j.isSpecCompliantForm(t),d=[];if(!j.isFunction(a))throw TypeError(`visitor must be a function`);function f(e){if(e===null)return``;if(j.isDate(e))return e.toISOString();if(j.isBoolean(e))return e.toString();if(!u&&j.isBlob(e))throw new N(`Blob is not supported. Use a Buffer instead.`);if(j.isArrayBuffer(e)||j.isTypedArray(e)){if(u&&typeof c==`function`)return new c([e]);throw new N(`Blob is not supported. Use a Buffer instead.`,N.ERR_NOT_SUPPORT)}return e}function p(e){if(e>l)throw new N(`Object is too deeply nested (`+e+` levels). Max depth: `+l,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function m(e,t){if(l===1/0)return JSON.stringify(e);let n=[];return JSON.stringify(e,function(e,r){if(!j.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),p(t+n.length-1),r})}function h(e,n,r){let a=e;if(j.isReactNative(t)&&j.isReactNativeBlob(e))return t.append(xt(r,n,o),f(e)),!1;if(e&&!r&&typeof e==`object`){if(j.endsWith(n,`{}`))n=i?n:n.slice(0,-2),e=m(e,1);else if(j.isArray(e)&&St(e)||(j.isFileList(e)||j.endsWith(n,`[]`))&&(a=j.toArray(e)))return n=bt(n),a.forEach(function(e,r){!(j.isUndefined(e)||e===null)&&t.append(s===!0?xt([n],r,o):s===null?n:n+`[]`,f(e))}),!1}return yt(e)?!0:(t.append(xt(r,n,o),f(e)),!1)}let g=Object.assign(Ct,{defaultVisitor:h,convertValue:f,isVisitable:yt});function _(e,n,r=0){if(!j.isUndefined(e)){if(p(r),d.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));d.push(e),j.forEach(e,function(e,i){(!(j.isUndefined(e)||e===null)&&a.call(t,e,j.isString(i)?i.trim():i,n,g))===!0&&_(e,n?n.concat(i):[i],r+1)}),d.pop()}}if(!j.isObject(e))throw TypeError(`data must be an object`);return _(e),t}function Tt(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Et(e,t){this._pairs=[],e&&wt(e,this,t)}let Dt=Et.prototype;Dt.append=function(e,t){this._pairs.push([e,t])},Dt.toString=function(e){let t=e?t=>e.call(this,t,Tt):Tt;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function Ot(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function kt(e,t,n){if(!t)return e;e=e||``;let r=j.isFunction(n)?{serialize:n}:n,i=j.getSafeProp(r,`encode`)||Ot,a=j.getSafeProp(r,`serialize`),o;if(o=a?a(t,r):j.isURLSearchParams(t)?t.toString():new Et(t,r).toString(i),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}let At=Symbol(`internals`);function jt(e){return e?e.length:0}function Mt(e){if(e)for(;e.length&&e[e.length-1]===null;)e.pop()}function Nt(e,t){let n=e.handlers,r=jt(n);n===t.handlersRef?r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()):(t.handlersRef=n,t.handlerEntries.clear()),t.handlersLength=r}var Pt=class{constructor(){this.handlers=[],this[At]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){let r={fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null},i=this[At];this.handlers??(this.handlers=[]),Nt(this,i);let a=i.nextId++;return this.handlers.push(r),i.handlerEntries.set(a,{handler:r,index:this.handlers.length-1}),i.handlersLength=this.handlers.length,a}eject(e){let t=this[At];Nt(this,t);let n=t.handlerEntries.get(e);if(n){if(t.handlerEntries.delete(e),this.handlers[n.index]!==n.handler)return;this.handlers[n.index]=null,t.iterationDepth||(Mt(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Nt(this,this[At]))}forEach(e){let t=this[At];Nt(this,t),t.iterationDepth++;try{j.forEach(this.handlers,function(t){t!==null&&e(t)})}finally{--t.iterationDepth||(Nt(this,t),Mt(this.handlers),t.handlersLength=jt(this.handlers))}}},Ft={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},It={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:Et,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Lt=n({hasBrowserEnv:()=>Rt,hasStandardBrowserEnv:()=>Bt,hasStandardBrowserWebWorkerEnv:()=>Vt,navigator:()=>zt,origin:()=>Ht});let Rt=typeof window<`u`&&typeof document<`u`,zt=typeof navigator==`object`&&navigator||void 0,Bt=Rt&&(!zt||[`ReactNative`,`NativeScript`,`NS`].indexOf(zt.product)<0),Vt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,Ht=Rt&&window.location.href||`http://localhost`;var P={...Lt,...It};function Ut(e,t){return wt(e,new P.classes.URLSearchParams,{visitor:function(e,t,n,r){return P.isNode&&j.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function Wt(e){if(e>100)throw new N(`FormData field is too deeply nested (`+e+` levels). Max depth: 100`,N.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Gt(e){let t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g,r;for(;(r=n.exec(e))!==null;)Wt(t.length),t.push(r[0]===`[]`?``:r[1]||r[0]);return t}function Kt(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function qt(e){function t(e,n,r,i){Wt(i);let a=e[i++];if(a===`__proto__`)return!0;let o=Number.isFinite(+a),s=i>=e.length;return a=!a&&j.isArray(r)?r.length:a,s?(j.hasOwnProp(r,a)?r[a]=j.isArray(r[a])?r[a].concat(n):[r[a],n]:r[a]=n,!o):((!j.hasOwnProp(r,a)||!j.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&j.isArray(r[a])&&(r[a]=Kt(r[a])),!o)}if(j.isFormData(e)&&j.isFunction(e.entries)){let n={};return j.forEachEntry(e,(e,r)=>{t(Gt(e),r,n,0)}),n}return null}let Jt=Object.freeze([`get`,`delete`,`head`,`options`,`post`,`put`,`patch`,`purge`,`link`,`unlink`,`query`]),Yt=(e,t)=>e!=null&&j.hasOwnProp(e,t)?e[t]:void 0;function Xt(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}let Zt={transitional:Ft,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=j.isObject(e);if(i&&j.isHTMLForm(e)&&(e=new FormData(e)),j.isFormData(e))return r?JSON.stringify(qt(e)):e;if(j.isArrayBuffer(e)||j.isBuffer(e)||j.isStream(e)||j.isFile(e)||j.isBlob(e)||j.isReadableStream(e))return e;if(j.isArrayBufferView(e))return e.buffer;if(j.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){let t=Yt(this,`formSerializer`);if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return Ut(e,t).toString();if((a=j.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let n=Yt(this,`env`),r=n&&n.FormData;return wt(a?{"files[]":e}:e,r&&new r,t)}}return i||r?(t.setContentType(`application/json`,!1),Xt(e)):e}],transformResponse:[function(e){let t=Yt(this,`transitional`)||Zt.transitional,n=t&&t.forcedJSONParsing,r=Yt(this,`responseType`),i=r===`json`;if(j.isResponse(e)||j.isReadableStream(e))return e;if(e&&j.isString(e)&&(n&&!r||i)){let n=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,Yt(this,`parseReviver`))}catch(e){if(n)throw e.name===`SyntaxError`?N.from(e,N.ERR_BAD_RESPONSE,this,null,Yt(this,`response`)):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:P.classes.FormData,Blob:P.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};j.forEach(Jt,e=>{Zt.headers[e]={}});function Qt(e,t){let n=this||Zt,r=t||n,i=M.from(r.headers),a=r.data;return j.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function $t(e){return!!(e&&e.__CANCEL__)}var en=class extends N{constructor(e,t,n){super(e??`canceled`,N.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function tn(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new N(`Request failed with status code `+n.status,n.status>=400&&n.status<500?N.ERR_BAD_REQUEST:N.ERR_BAD_RESPONSE,n.config,n.request,n))}let nn=/[\t\n\r]/g;function rn(e){if(typeof e!=`string`)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(nn,``)}function an(e){let t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||``}function on(e,t){e=e||10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||(o=c),n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o<t)return;let f=l&&c-l;return f?Math.round(d*1e3/f):void 0}}function sn(e,t){let n=0,r=1e3/t,i,a,o=(t,r=Date.now())=>{n=r,i=null,a&&(clearTimeout(a),a=null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||(a=setTimeout(()=>{a=null,o(i)},r-s)))},()=>i&&o(i),(...e)=>o(e)]}let cn=(e,t,n=3)=>{let r=0,i=on(50,250);return sn(n=>{if(!n||!j.isNumber(n.loaded))return;let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=Math.max(0,o==null?a:Math.min(a,o)),c=Math.max(0,s-r),l=i(c);r=Math.max(r,s),e({loaded:s,total:o,progress:o?s/o:void 0,bytes:c,rate:l||void 0,estimated:l&&o?(o-s)/l:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},ln=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},un=(e,t=j.asap)=>(...n)=>t(()=>e(...n));var dn=P.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,P.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(P.origin),P.navigator&&/(msie|trident)/i.test(P.navigator.userAgent)):()=>!0,fn=P.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];j.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),j.isString(r)&&s.push(`path=${r}`),j.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),j.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.split(`;`);for(let n=0;n<t.length;n++){let r=t[n].replace(/^\s+/,``),i=r.indexOf(`=`);if(i!==-1&&r.slice(0,i)===e)try{return decodeURIComponent(r.slice(i+1))}catch{return r.slice(i+1)}}return null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function pn(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function mn(e,t){if(!t)return e;let n=e.length;for(;n>0&&e.charCodeAt(n-1)===47;)n--;return e.slice(0,n)+`/`+t.replace(/^\/+/,``)}let hn=/^https?:(?!\/\/)/i;function gn(e){return e&&e.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n=``)=>`${t}${n}${mt}`)}function _n(e){let t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${mt}@`),n=t.indexOf(`#`),r=(n===-1?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${mt}`);return n===-1?r:`${r}#${gn(t.slice(n+1))}`}function vn(e,t){if(typeof e==`string`){let n=rn(e);if(hn.test(n))throw new N(`Invalid URL ${JSON.stringify(_n(n))}: missing "//" after protocol`,N.ERR_INVALID_URL,t)}}function yn(e,t,n,r){vn(t,r);let i=!pn(t);return e&&(i||n===!1)?(vn(e,r),mn(e,t)):t}let bn=e=>e instanceof M?{...e}:e,xn=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)):Object.keys(e);function Sn(e,t){e=e||{},t=t||{};let n=Object.create(null);Object.defineProperty(n,`hasOwnProperty`,{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(e,t,n,r){return j.isPlainObject(e)&&j.isPlainObject(t)?j.merge.call({caseless:r},e,t):j.isPlainObject(t)?j.merge({},t):j.isArray(t)?t.slice():t}function i(e,t,n,i){if(!j.isUndefined(t))return r(e,t,n,i);if(!j.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!j.isUndefined(t))return r(void 0,t)}function o(e,t){if(!j.isUndefined(t))return r(void 0,t);if(!j.isUndefined(e))return r(void 0,e)}function s(n){let r=j.hasOwnProp(t,`transitional`)?t.transitional:void 0;if(!j.isUndefined(r))if(j.isPlainObject(r)){if(j.hasOwnProp(r,n))return r[n]}else return;let i=j.hasOwnProp(e,`transitional`)?e.transitional:void 0;if(j.isPlainObject(i)&&j.hasOwnProp(i,n))return i[n]}function c(n,i,a){if(j.hasOwnProp(t,a))return r(n,i);if(j.hasOwnProp(e,a))return r(void 0,n)}let l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutErrorMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,allowedSocketPaths:o,responseEncoding:o,validateStatus:c,headers:(e,t,n)=>i(bn(e),bn(t),n,!0)};return j.forEach(xn({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=j.hasOwnProp(l,r)?l[r]:i,o=a(j.hasOwnProp(e,r)?e[r]:void 0,j.hasOwnProp(t,r)?t[r]:void 0,r);j.isUndefined(o)&&a!==c||(n[r]=o)}),j.hasOwnProp(t,`validateStatus`)&&j.isUndefined(t.validateStatus)&&s(`validateStatusUndefinedResolves`)===!1&&(j.hasOwnProp(e,`validateStatus`)?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}let Cn=[`content-type`,`content-length`];function wn(e,t,n){if(n!==`content-only`){e.set(t);return}Object.entries(t||{}).forEach(([t,n])=>{Cn.includes(t.toLowerCase())&&e.set(t,n)})}let Tn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16)));function En(e){let t=Sn({},e),n=e=>j.hasOwnProp(t,e)?t[e]:void 0,r=n(`data`),i=n(`withXSRFToken`),a=n(`xsrfHeaderName`),o=n(`xsrfCookieName`),s=n(`headers`),c=n(`auth`),l=n(`baseURL`),u=n(`allowAbsoluteUrls`),d=n(`url`);if(t.headers=s=M.from(s),t.url=kt(yn(l,d,u,t),n(`params`),n(`paramsSerializer`)),c){let t=j.getSafeProp(c,`username`)||``,n=j.getSafeProp(c,`password`)||``;try{s.set(`Authorization`,`Basic `+btoa(t+`:`+(n?Tn(n):``)))}catch(t){throw N.from(t,N.ERR_BAD_OPTION_VALUE,e)}}if(j.isFormData(r)){let e=j.getSafeProp(r,`getHeaders`);P.hasStandardBrowserEnv||P.hasStandardBrowserWebWorkerEnv||j.isReactNative(r)?s.setContentType(void 0):j.isFunction(e)&&wn(s,e.call(r),n(`formDataHeaderPolicy`))}if(P.hasStandardBrowserEnv&&(j.isFunction(i)&&(i=i(t)),i===!0||i==null&&dn(t.url))){let e=a&&o&&fn.read(o);e&&s.set(a,e)}return t}var Dn=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=En(e),i=r.data,a=M.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p,m;function h(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let g=new XMLHttpRequest;g.open(r.method.toUpperCase(),r.url,!0),g.timeout=r.timeout;function _(i){if(!g)return;if(g.status===0&&(an(rn(r.url))||an(P.origin))!==`file`&&!(g.responseURL&&g.responseURL.startsWith(`file:`))){n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),g=null;return}try{i?m&&m(i):p&&p()}catch(e){setTimeout(()=>{throw e})}if(!g)return;let a=M.from(`getAllResponseHeaders`in g&&g.getAllResponseHeaders());tn(function(e){t(e),h()},function(e){n(e),h()},{data:!o||o===`text`||o===`json`?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:a,config:e,request:g}),g=null}`onloadend`in g?g.onloadend=_:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.startsWith(`file:`))||setTimeout(_)},g.onabort=function(){g&&(n(new N(`Request aborted`,N.ECONNABORTED,e,g)),h(),g=null)},g.onerror=function(t){let r=new N(t&&t.message?t.message:`Network Error`,N.ERR_NETWORK,e,g);r.event=t||null,n(r),h(),g=null},g.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Ft;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new N(t,i.clarifyTimeoutError?N.ETIMEDOUT:N.ECONNABORTED,e,g)),h(),g=null},i===void 0&&a.setContentType(null),`setRequestHeader`in g&&j.forEach(tt(a),function(e,t){g.setRequestHeader(t,e)}),j.isUndefined(r.withCredentials)||(g.withCredentials=!!r.withCredentials),o&&o!==`json`&&(g.responseType=r.responseType),c&&([d,p,m]=cn(c,!0),g.addEventListener(`progress`,d)),s&&g.upload&&([u,f]=cn(s),g.upload.addEventListener(`progress`,u),g.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{g&&(n(!t||t.type?new en(null,e,g):t),g.abort(),h(),g=null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let v=an(r.url);if(v&&!P.protocols.includes(v)){n(new N(`Unsupported protocol `+v+`:`,N.ERR_BAD_REQUEST,e)),h();return}g.send(i||null)})};let On=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;let n=new AbortController,r=!1,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof N?t:new en(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new N(`timeout of ${t}ms exceeded`,N.ETIMEDOUT))},t),o=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),e=null)};e.forEach(e=>{if(!r){if(e.aborted){i.call(e);return}e.addEventListener(`abort`,i,{once:!0})}});let{signal:s}=n;return s.unsubscribe=()=>j.asap(o),s},kn=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},An=async function*(e,t){for await(let n of jn(e))yield*kn(n,t)},jn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}let t=e.getReader();try{for(;;){let{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Mn=(e,t,n,r)=>{let i=An(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},Nn=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Pn=(e,t,n)=>t+2<n&&Nn(e.charCodeAt(t+1))&&Nn(e.charCodeAt(t+2)),Fn=e=>e<=57?e-48:(e&223)-55,In=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===47||e===45||e===95,Ln=e=>e===9||e===10||e===12||e===13||e===32,Rn=e=>{let t=Math.floor(e/4),n=e%4;return t*3+(n===2?1:n===3?2:0)},zn=e=>{let t=e.length,n=0;return t>0&&e.charCodeAt(t-1)===61&&(n++,t>1&&e.charCodeAt(t-2)===61&&n++),Math.floor((t-n)*3/4)},Bn=e=>{let t=e.length,n=0,r=0,i=!1;for(let a=0;a<t;a++){let o=e.charCodeAt(a);if(o===37&&Pn(e,a,t)&&(o=Fn(e.charCodeAt(a+1))*16+Fn(e.charCodeAt(a+2)),a+=2),!Ln(o)){if(o===61){r++;continue}if(!In(o)||r>0){i=!0;continue}n++}}return i||r>2||r>0&&(n+r)%4!=0||n%4==1?zn(e):Rn(n)},Vn=(e,t)=>{if(!e||typeof e!=`string`||!e.startsWith(`data:`))return 0;let n=e.indexOf(`,`);if(n<0)return 0;let r=e.slice(5,n),i=e.slice(n+1);if(/;base64/i.test(r))return t(i);let a=0;for(let e=0,t=i.length;e<t;e++){let n=i.charCodeAt(e);if(n===37&&Pn(i,e,t))a+=1,e+=2;else if(n<128)a+=1;else if(n<2048)a+=2;else if(n>=55296&&n<=56319&&e+1<t){let t=i.charCodeAt(e+1);t>=56320&&t<=57343?(a+=4,e++):a+=3}else a+=3}return a};function Hn(e){let t=typeof e==`string`?e.indexOf(`#`):-1;return Vn(t===-1?e:e.slice(0,t),Bn)}let Un=`1.20.0`,Wn=64*1024,Gn={cache:`default`,redirect:`follow`,referrer:`about:client`,referrerPolicy:``,mode:`cors`,integrity:``,keepalive:!1,priority:`auto`,window:null},{isFunction:Kn}=j,qn=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Jn=e=>{if(!j.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},Yn=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Xn=e=>{let t=e.indexOf(`://`),n=e;return t!==-1&&(n=n.slice(t+3)),n.includes(`@`)||n.includes(`:`)},Zn=e=>{let t=j.global!==void 0&&j.global!==null?j.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=j.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);let{fetch:i,Request:a,Response:o}=e,s=i?Kn(i):typeof fetch==`function`,c=Kn(a),l=Kn(o);if(!s)return!1;let u=s&&Kn(n),d=s&&(typeof r==`function`?(e=>t=>e.encode(t))(new r):async e=>new Uint8Array(await new a(e).arrayBuffer())),f=c&&u&&Yn(()=>{let e=!1,t=new a(P.origin,{body:new n,method:`POST`,get duplex(){return e=!0,`half`}}),r=t.headers.has(`Content-Type`);return t.body!=null&&t.body.cancel(),e&&!r}),p=l&&u&&Yn(()=>j.isReadableStream(new o(``).body)),m={stream:p&&(e=>e.body)};s&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!m[e]&&(m[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new N(`Response type '${e}' is not supported`,N.ERR_NOT_SUPPORT,n)})});let h=async e=>{if(e==null)return 0;if(j.isBlob(e))return e.size;if(j.isSpecCompliantForm(e))return(await new a(P.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(j.isArrayBufferView(e)||j.isArrayBuffer(e))return e.byteLength;if(j.isURLSearchParams(e)&&(e+=``),j.isString(e))return(await d(e)).byteLength},g=async(e,t)=>j.toFiniteNumber(e.getContentLength())??h(t);return async e=>{let{url:t,method:n,data:s,signal:l,cancelToken:d,timeout:_,onDownloadProgress:v,onUploadProgress:y,responseType:b,headers:x,withCredentials:ee=`same-origin`,fetchOptions:te,maxContentLength:S,maxBodyLength:ne,maxRedirects:re}=En(e),ie=j.isNumber(S)&&S>-1,ae=j.isNumber(ne)&&ne>-1,oe=t=>j.hasOwnProp(e,t)?e[t]:void 0,se=i||fetch;b=b?(b+``).toLowerCase():`text`;let C=On([l,d&&d.toAbortSignal()],_),w=null,T=C&&C.unsubscribe&&(()=>{C.unsubscribe()}),ce,le=null,ue=()=>new N(`Request body larger than maxBodyLength limit`,N.ERR_BAD_REQUEST,e,w);try{let i,l=oe(`auth`);if(l&&(i={username:j.getSafeProp(l,`username`)||``,password:j.getSafeProp(l,`password`)||``}),Xn(t)){let e=new URL(t,P.origin);!i&&(e.username||e.password)&&(i={username:Jn(e.username),password:Jn(e.password)}),(e.username||e.password)&&(e.username=``,e.password=``,t=e.href)}if(i&&(x.delete(`authorization`),x.set(`Authorization`,`Basic `+btoa(qn((i.username||``)+`:`+(i.password||``))))),ie&&typeof t==`string`&&t.startsWith(`data:`)&&Hn(t)>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,w);if(ae&&n!==`get`&&n!==`head`){let e=await h(s);if(typeof e==`number`&&isFinite(e)&&(ce=e,e>ne))throw ue()}let d=ae&&(j.isReadableStream(s)||j.isStream(s)),_=(e,t,n)=>Mn(e,Wn,e=>{if(ae&&e>ne)throw le=ue();t&&t(e)},n);if(f&&n!==`get`&&n!==`head`&&(y||d)){if(ce=ce??await g(x,s),ce!==0||d){let e=new a(t,{method:`POST`,body:s,duplex:`half`}),n;if(j.isFormData(s)&&(n=e.headers.get(`content-type`))&&x.setContentType(n),e.body){let[t,n]=y&&ln(ce,cn(un(y)))||[];s=_(e.body,t,n)}}}else if(d&&!c&&u&&n!==`get`&&n!==`head`)s=_(s);else if(d&&c&&!f&&n!==`get`&&n!==`head`)throw new N(`Stream request bodies are not supported by the current fetch implementation`,N.ERR_NOT_SUPPORT,e,w);j.isString(ee)||(ee=ee?`include`:`omit`);let de=c&&`credentials`in a.prototype;if(j.isFormData(s)){let e=x.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&x.delete(`content-type`)}x.set(`User-Agent`,`axios/`+Un,!1);let E=te==null?te:Object.assign(Object.create(null),te);E&&(delete E.body,delete E.headers,delete E.method,delete E.signal,delete E.duplex,delete E.credentials);let D=Object.assign(Object.create(null),E,{signal:C,method:n.toUpperCase(),headers:tt(x.normalize()),body:s,duplex:`half`,credentials:de?ee:void 0});c&&(j.forEach(Gn,(e,t)=>{D[t]===void 0&&(D[t]=e)}),D.signal===void 0&&(D.signal=null),D.body===void 0&&(D.body=null)),re===0&&(D.redirect=`manual`,E&&(E.redirect=`manual`)),w=c&&new a(t,D);let O=await(c?se(w,E):se(t,D)),fe=M.from(O.headers);if(ie){let t=j.toFiniteNumber(fe.getContentLength());if(t!=null&&t>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,w)}let pe=p&&(b===`stream`||b===`response`);if(p&&O.body&&(v||ie||pe&&T)){let t={};[`status`,`statusText`,`headers`].forEach(e=>{t[e]=O[e]});let n=j.toFiniteNumber(fe.getContentLength()),[r,i]=v&&ln(n,cn(un(v),!0))||[],a=0;O=new o(Mn(O.body,Wn,t=>{if(ie&&(a=t,a>S))throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,w);r&&r(t)},()=>{i&&i(),T&&T()}),t)}b=b||`text`;let k=await m[j.findKey(m,b)||`text`](O,e);if(ie&&!p&&!pe){let t;if(k!=null&&(typeof k.byteLength==`number`?t=k.byteLength:typeof k.size==`number`?t=k.size:typeof k==`string`&&(t=typeof r==`function`?new r().encode(k).byteLength:k.length)),typeof t==`number`&&t>S)throw new N(`maxContentLength size of `+S+` exceeded`,N.ERR_BAD_RESPONSE,e,w)}return!pe&&T&&T(),await new Promise((t,n)=>{tn(t,n,{data:k,headers:M.from(O.headers),status:O.status,statusText:O.statusText,config:e,request:w})})}catch(t){if(T&&T(),C&&C.aborted&&C.reason instanceof N){let n=C.reason;throw n.config=e,w&&(n.request=w),t!==n&&Object.defineProperty(n,`cause`,{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(le)throw w&&!le.request&&(le.request=w),le;if(t instanceof N)throw w&&!t.request&&(t.request=w),t;if(t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)){let n=new N(`Network Error`,N.ERR_NETWORK,e,w,t&&t.response);throw Object.defineProperty(n,`cause`,{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw N.from(t,t&&t.code,e,w,t&&t.response)}}},Qn=new Map,$n=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Qn;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Zn(t)),l=c;return c};$n();let er={http:null,xhr:Dn,fetch:{get:$n}};j.forEach(er,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{__proto__:null,value:t})}catch{}Object.defineProperty(e,`adapterName`,{__proto__:null,value:t})}});let tr=e=>`- ${e}`,nr=e=>j.isFunction(e)||e===null||e===!1;function rr(e,t){e=j.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o<n;o++){r=e[o];let n;if(i=r,!nr(r)&&(i=er[(n=String(r)).toLowerCase()],i===void 0))throw new N(`Unknown adapter '${n}'`);if(i&&(j.isFunction(i)||(i=i.get(t))))break;a[n||`#`+o]=i}if(!i){let e=Object.entries(a).map(([e,t])=>`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new N(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since :
|
|
4
4
|
`+e.map(tr).join(`
|
|
5
5
|
`):` `+tr(e[0]):`as no adapter specified`),N.ERR_NOT_SUPPORT)}return i}var ir={getAdapter:rr,adapters:er};function ar(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new en(null,e)}function or(e){let t=j.toSafeFlatObject(e);return ar(t),t.headers=M.from(j.getSafeProp(t,`headers`)),t.data=Qt.call(t,t.transformRequest),[`post`,`put`,`patch`].indexOf(t.method)!==-1&&t.headers.setContentType(`application/x-www-form-urlencoded`,!1),ir.getAdapter(t.adapter||Zt.adapter,t)(t).then(function(e){ar(t),t.response=e;try{e.data=Qt.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=M.from(e.headers),e},function(e){if(!$t(e)&&(ar(t),e&&e.response)){t.response=e.response;try{e.response.data=Qt.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=M.from(e.response.headers)}return Promise.reject(e)})}let sr={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{sr[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});let cr={};sr.transitional=function(e,t,n){function r(e,t){return`[Axios v`+Un+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new N(r(i,` has been removed`+(t?` in `+t:``)),N.ERR_DEPRECATED);return t&&!cr[i]&&(cr[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},sr.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function lr(e,t,n){if(typeof e!=`object`||!e)throw new N(`options must be an object`,N.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=Object.prototype.hasOwnProperty.call(t,a)?t[a]:void 0;if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new N(`option `+a+` must be `+n,N.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new N(`Unknown option `+a,N.ERR_BAD_OPTION)}}var ur={assertOptions:lr,validators:sr};let F=ur.validators;var dr=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Pt,response:new Pt}}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=Error();let n=t.stack,r=``;if(typeof n==`string`){let e=n.indexOf(`
|
|
6
6
|
`);r=e===-1?``:n.slice(e+1)}if(!e.stack)e.stack=r;else if(r){let t=r.indexOf(`
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
`,t+1),i=n===-1?``:r.slice(n+1);String(e.stack).endsWith(i)||(e.stack+=`
|
|
9
9
|
`+r)}}catch{}throw e}}_request(e,t){typeof e==`string`?(t=t||{},t.url=e):t=e||{},t=Sn(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&ur.assertOptions(n,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean),legacyInterceptorReqResOrdering:F.transitional(F.boolean),advertiseZstdAcceptEncoding:F.transitional(F.boolean),validateStatusUndefinedResolves:F.transitional(F.boolean)},!1),r!=null&&(j.isFunction(r)?t.paramsSerializer={serialize:r}:ur.assertOptions(r,{encode:F.function,serialize:F.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),ur.assertOptions(t,{baseUrl:F.spelling(`baseURL`),withXsrfToken:F.spelling(`withXSRFToken`)},!0),t.method=(j.getSafeProp(t,`method`)||j.getSafeProp(this.defaults,`method`)||`get`).toLowerCase();let a=i&&j.merge(i.common,i[t.method]);i&&j.forEach(Jt.concat(`common`),e=>{delete i[e]}),t.headers=M.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s=s&&e.synchronous;let n=t.transitional||Ft;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[or.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u<d;)l=l.then(e[u++],e[u++]);return l}d=o.length;let f=t;for(;u<d;){let e=o[u++],t=o[u++];try{f=e?e(f):f}catch(e){if(!t){l=Promise.reject(e);break}try{let n=t.call(this,e);j.isThenable(n)&&(l=Promise.resolve(n).then(()=>or.call(this,f)))}catch(e){l=Promise.reject(e)}break}}if(!l)try{l=or.call(this,f)}catch(e){l=Promise.reject(e)}for(u=0,d=c.length;u<d;)l=l.then(c[u++],c[u++]);return l}getUri(e){return e=Sn(this.defaults,e),kt(yn(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}};j.forEach([`delete`,`get`,`head`,`options`],function(e){dr.prototype[e]=function(t,n){return this.request(Sn(n||{},{method:e,url:t,data:n&&j.hasOwnProp(n,`data`)?n.data:void 0}))}}),j.forEach([`post`,`put`,`patch`,`query`],function(e){function t(t){return function(n,r,i){return this.request(Sn(i||{},{method:e,headers:t?{"Content-Type":`multipart/form-data`}:{},url:n,data:r}))}}dr.prototype[e]=t(),e!==`query`&&(dr.prototype[e+`Form`]=t(!0))});var fr=class e{constructor(e){if(typeof e!=`function`)throw TypeError(`executor must be a function.`);let t;this.promise=new Promise(function(e){t=e});let 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,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new en(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function pr(e){return function(t){return e.apply(null,t)}}function mr(e){return j.isObject(e)&&e.isAxiosError===!0}let hr={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(hr).forEach(([e,t])=>{hr[t]===void 0&&(hr[t]=e)});function gr(e){let t=new dr(e),n=r(dr.prototype.request,t);return j.extend(n,dr.prototype,t,{allOwnKeys:!0}),j.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return gr(Sn(e,t))},n}let I=gr(Zt);I.Axios=dr,I.CanceledError=en,I.CancelToken=fr,I.isCancel=$t,I.VERSION=Un,I.toFormData=wt,I.AxiosError=N,I.Cancel=I.CanceledError,I.all=function(e){return Promise.all(e)},I.spread=pr,I.isAxiosError=mr,I.mergeConfig=Sn,I.AxiosHeaders=M,I.formToJSON=e=>qt(j.isHTMLForm(e)?new FormData(e):e),I.getAdapter=ir.getAdapter,I.HttpStatusCode=hr,I.default=I;let L=`https://api.snaptrade.com`.replace(/\/+$/,``);var R=class{constructor(e,t=L,n=I){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},_r=class extends Error{constructor(e,t){super(t),this.field=e,this.name=`RequiredError`}};function vr(e){let t=``;for(let n of e)t+=String.fromCharCode(n);if(typeof globalThis.btoa==`function`)return globalThis.btoa(t);if(typeof Buffer<`u`)return Buffer.from(e).toString(`base64`);throw Error(`Base64 encoding is not available in this runtime`)}async function yr(e,t){if(!globalThis.crypto?.subtle)throw Error(`Web Crypto API is required to compute SnapTrade request signatures`);let n=new TextEncoder,r=n.encode(t),i=n.encode(e),a=await globalThis.crypto.subtle.importKey(`raw`,r,{name:`HMAC`,hash:`SHA-256`},!1,[`sign`]),o=await globalThis.crypto.subtle.sign(`HMAC`,a,i);return vr(new Uint8Array(o))}let br=e=>{var t=[],n={};return JSON.stringify(e,function(e,r){return e in n||(t.push(e),n[e]=null),r}),t.sort(),JSON.stringify(e,t)};async function xr(e){let{configuration:t,basePath:n,axiosArgs:r,url:i,operationAuth:a}=e,o=a?.selectedAuthMode,s=o===void 0?void 0:a?.requestSigningByAuthMode?.[o];if(s===void 0||s.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`signature`))===void 0)return;let c=t?.[s.secretParameter];if(typeof c!=`string`)throw Error(`${s.secretParameter} is required`);let l=encodeURI(c),u=r.options.data===void 0||r.options.data===`{}`?null:JSON.parse(r.options.data),d=r.url.indexOf(`?`)===-1?`${r.url}`:`${r.url.split(`?`)[0]}`,f=await yr(br({content:u,path:d,query:i.replace(n,``).replace(d,``).replace(`?`,``)}),l);r.options.headers&&(r.options.headers.Signature=f)}let Sr=new Set([`clientid`,`timestamp`,`userid`,`usersecret`]);function Cr(e){if(e===void 0||Sr.size===0)return e;try{let t=/^[a-z][a-z\d+.-]*:/i.test(e),n=new URL(e,`http://konfig.invalid`),r=new URLSearchParams;for(let[e,t]of n.searchParams.entries()){let n=t;Sr.has(e.toLowerCase())&&(n=`[REDACTED]`),r.append(e,n)}return n.search=r.toString(),t?n.toString():n.pathname+n.search+n.hash}catch{return}}function wr(e,t,n){return t===void 0||!e.includes(t)?e:e.split(t).join(n??`[REDACTED URL]`)}var Tr=class extends Error{constructor(e,t,n){let r=e.config?.url,i=Cr(r),a=wr(e.message,r,i)+`
|
|
10
10
|
RESPONSE HEADERS:
|
|
11
|
-
`+JSON.stringify(n,null,2);super(a),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=i,this.status=e.response?.status,this.statusText=e.response?.statusText,this.responseBody=t}toJSON(){return{name:this.name,message:this.message,method:this.method,url:this.url,code:this.code,status:this.status,statusText:this.statusText,responseBody:this.responseBody}}};async function Er(e){let t=new TextDecoder,n=e.getReader(),r=``;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;let a=t.decode(i,{stream:!0});r+=a}}finally{n.releaseLock()}return r}function Dr(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let z=`https://example.com`,B=function(e,t,n){if(n==null)throw new _r(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))},H=async function(e,t){t&&t.accessToken&&(e.Authorization=`Bearer `+(typeof t.accessToken==`function`?await t.accessToken():await t.accessToken))};function Or(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Or(e,t,n)):Object.keys(t).forEach(r=>Or(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let U=function(e,...t){let n=new URLSearchParams(e.search);Or(n,t),e.search=n.toString()},W=function(e,t,n){let r=typeof e!=`string`;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers[`Content-Type`]):r)?JSON.stringify(e===void 0?{}:e):e||``},G=function(e){return kr(e.pathname)+e.search+e.hash},kr=function(e){return e.replace(/\/$/,``)};async function Ar(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await Er(t)),r=Dr(r)}catch{r=void 0}throw new Tr(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let K=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await xr({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),Ar(async()=>await a.request({...e.options,url:s}))}};function q(){return typeof window<`u`}function J(e){let{queryParameters:t,operationAuth:n}=e,r=n?.selectedAuthMode;(r===void 0?void 0:n?.requestSigningByAuthMode?.[r])?.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`timestamp`))!==void 0&&(t.timestamp=Math.round(new Date().getTime()/1e3).toString())}let jr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(m,e),n!==void 0&&(h.startDate=n instanceof Date?n.toISOString().substr(0,10):n),r!==void 0&&(h.endDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(h.offset=i),a!==void 0&&(h.limit=a),o!==void 0&&(h.type=o);let g={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},_=f&&f.headers?f.headers:{};return p.headers={...m,..._,...l.headers},J({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),U(d,h),{url:G(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountBalancesV2:async(t,n,r,i={})=>{B(`getAccountBalancesV2`,`accountId`,t);let a=`/accounts/{accountId}/balances/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances/v2`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountDetails:async(t,n,r,i={})=>{B(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts/all`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=jr(e);return{async getAccountActivities(...n){let[r={},i]=n;return K(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return K(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalancesV2(...n){let[r={},i]=n;return K(await t.getAccountBalancesV2(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountDetails(...n){let[r={},i]=n;return K(await t.getAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return K(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return K(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return K(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return K(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return K(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return K(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllUserAccounts(...n){let[r={},i]=n;return K(await t.listAllUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return K(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return K(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Mr=function(e,t,n){let r=Y(e);return{getAccountActivities(...e){return r.getAccountActivities(...e).then(e=>e(n,t))},getAccountBalanceHistory(...e){return r.getAccountBalanceHistory(...e).then(e=>e(n,t))},getAccountBalancesV2(...e){return r.getAccountBalancesV2(...e).then(e=>e(n,t))},getAccountDetails(...e){return r.getAccountDetails(...e).then(e=>e(n,t))},getAllAccountPositions(...e){return r.getAllAccountPositions(...e).then(e=>e(n,t))},getUserAccountBalance(...e){return r.getUserAccountBalance(...e).then(e=>e(n,t))},getUserAccountDetails(...e){return r.getUserAccountDetails(...e).then(e=>e(n,t))},getUserAccountOrderDetail(...e){return r.getUserAccountOrderDetail(...e).then(e=>e(n,t))},getUserAccountOrders(...e){return r.getUserAccountOrders(...e).then(e=>e(n,t))},getUserAccountRecentOrders(...e){return r.getUserAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountReturnRates(...e){return r.getUserAccountReturnRates(...e).then(e=>e(n,t))},getUserHoldings(...e){return r.getUserHoldings(...e).then(e=>e(n,t))},listAllUserAccounts(...e){return r.listAllUserAccounts(...e).then(e=>e(n,t))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Nr=class extends R{getAccountActivities(...e){return Y(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return Y(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAccountBalancesV2(...e){return Y(this.configuration).getAccountBalancesV2(...e).then(e=>e(this.axios,this.basePath))}getAccountDetails(...e){return Y(this.configuration).getAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return Y(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return Y(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return Y(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return Y(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return Y(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return Y(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return Y(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return Y(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listAllUserAccounts(...e){return Y(this.configuration).listAllUserAccounts(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return Y(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return Y(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Pr=class extends Nr{};let Fr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!q()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},J({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),U(n,o),{url:G(n),options:i}}}},Ir=function(e){let t=Fr(e);return{async check(n){return K(await t.check(n),I,L,e,{authModes:[`public`]})}}},Lr=function(e,t,n){let r=Ir(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Rr=class extends R{check(e){return Ir(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},zr=class extends Rr{};let Br=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}}}},Vr=function(e){let t=Br(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return K(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return K(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return K(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Hr=function(e,t,n){let r=Vr(e);return{deleteSnapTradeUser(...e){return r.deleteSnapTradeUser(...e).then(e=>e(n,t))},listSnapTradeUsers(...e){return r.listSnapTradeUsers(...e).then(e=>e(n,t))},loginSnapTradeUser(...e){return r.loginSnapTradeUser(...e).then(e=>e(n,t))},registerSnapTradeUser(...e){return r.registerSnapTradeUser(...e).then(e=>e(n,t))},resetSnapTradeUserSecret(...e){return r.resetSnapTradeUserSecret(...e).then(e=>e(n,t))}}};var Ur=class extends R{deleteSnapTradeUser(...e){return Vr(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Vr(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Vr(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Vr(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Vr(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Wr=class extends Ur{};let Gr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),U(o,u),{url:G(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Gr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return K(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return K(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return K(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Kr=function(e,t,n){let r=X(e);return{deleteConnection(...e){return r.deleteConnection(...e).then(e=>e(n,t))},detailBrokerageAuthorization(...e){return r.detailBrokerageAuthorization(...e).then(e=>e(n,t))},disableBrokerageAuthorization(...e){return r.disableBrokerageAuthorization(...e).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(...e){return r.listBrokerageAuthorizationAccounts(...e).then(e=>e(n,t))},listBrokerageAuthorizations(...e){return r.listBrokerageAuthorizations(...e).then(e=>e(n,t))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},refreshBrokerageAuthorization(...e){return r.refreshBrokerageAuthorization(...e).then(e=>e(n,t))},returnRates(...e){return r.returnRates(...e).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(...e){return r.syncBrokerageAuthorizationTransactions(...e).then(e=>e(n,t))}}};var qr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}listConnectionAccounts(...e){return X(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(...e){return X(this.configuration).refreshBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}returnRates(...e){return X(this.configuration).returnRates(...e).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(...e){return X(this.configuration).syncBrokerageAuthorizationTransactions(...e).then(e=>e(this.axios,this.basePath))}},Jr=class extends qr{};let Yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getAllAccountOrders:async(t,n,r,i,a,o={})=>{B(`getAllAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/all`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},placeSimpleOrder:async(t,n,r,i,a={})=>{B(`placeSimpleOrder`,`accountId`,t),B(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/simple`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Z=function(e){let t=Yr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return K(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return K(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountOrders(...n){let[r={},i]=n;return K(await t.getAllAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return K(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeSimpleOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,legs:r.legs,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,client_order_id:r.client_order_id,expiry_date:r.expiry_date,notional_value:r.notional_value,trading_session:r.trading_session};return K(await t.placeSimpleOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Xr=function(e,t,n){let r=Z(e);return{addSubscription(...e){return r.addSubscription(...e).then(e=>e(n,t))},cancelSubscription(...e){return r.cancelSubscription(...e).then(e=>e(n,t))},getAllAccountOrders(...e){return r.getAllAccountOrders(...e).then(e=>e(n,t))},getUserAccountOrderDetailV2(...e){return r.getUserAccountOrderDetailV2(...e).then(e=>e(n,t))},getUserAccountOrdersV2(...e){return r.getUserAccountOrdersV2(...e).then(e=>e(n,t))},getUserAccountRecentOrdersV2(...e){return r.getUserAccountRecentOrdersV2(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))},placeSimpleOrder(...e){return r.placeSimpleOrder(...e).then(e=>e(n,t))}}};var Zr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}getAllAccountOrders(...e){return Z(this.configuration).getAllAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(...e){return Z(this.configuration).getUserAccountOrderDetailV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(...e){return Z(this.configuration).getUserAccountOrdersV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(...e){return Z(this.configuration).getUserAccountRecentOrdersV2(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}placeSimpleOrder(...e){return Z(this.configuration).placeSimpleOrder(...e).then(e=>e(this.axios,this.basePath))}},Qr=class extends Zr{};let $r=function(e){return{getStats:async(t,n={})=>{let r=`/management/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/management/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},getStatsLegacy:async(t,n={})=>{let r=`/snapTrade/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}}}},ei=function(e){let t=$r(e);return{async getStats(...n){let[r={},i]=n;return K(await t.getStats(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStatsLegacy(...n){let[r={},i]=n;return K(await t.getStatsLegacy(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ti=function(e,t,n){let r=ei(e);return{getStats(...e){return r.getStats(...e).then(e=>e(n,t))},getStatsLegacy(...e){return r.getStatsLegacy(...e).then(e=>e(n,t))}}};var ni=class extends R{getStats(...e){return ei(this.configuration).getStats(...e).then(e=>e(this.axios,this.basePath))}getStatsLegacy(...e){return ei(this.configuration).getStatsLegacy(...e).then(e=>e(this.axios,this.basePath))}},ri=class extends ni{};let ii=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={},c={authModes:[`public`],selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/institutions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Q=function(e){let t=ii(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return K(await t.getStockExchanges(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbols(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.getSymbols(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbolsByTicker(...n){let[r={},i]=n;return K(await t.getSymbolsByTicker(r.query,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageAuthorizationType(...n){let[r={},i]=n;return K(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return K(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return K(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),I,L,e,{authModes:[`public`]})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ai=function(e,t,n){let r=Q(e);return{getPartnerInfo(...e){return r.getPartnerInfo(...e).then(e=>e(n,t))},getStockExchanges(...e){return r.getStockExchanges(...e).then(e=>e(n,t))},getSymbols(...e){return r.getSymbols(...e).then(e=>e(n,t))},getSymbolsByTicker(...e){return r.getSymbolsByTicker(...e).then(e=>e(n,t))},listAllBrokerageAuthorizationType(...e){return r.listAllBrokerageAuthorizationType(...e).then(e=>e(n,t))},listAllBrokerageInstruments(...e){return r.listAllBrokerageInstruments(...e).then(e=>e(n,t))},listAllBrokerages(...e){return r.listAllBrokerages(...e).then(e=>e(n,t))},listInstitutions(e){return r.listInstitutions(e).then(e=>e(n,t))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var oi=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}listInstitutions(e){return Q(this.configuration).listInstitutions(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},si=class extends oi{};let ci=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ci(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return K(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOptionImpact(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOrderImpact(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value};return K(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return K(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeForceOrder(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,symbol:r.symbol,order_type:r.order_type,time_in_force:r.time_in_force,trading_session:r.trading_session,expiry_date:r.expiry_date,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value,client_order_id:r.client_order_id};return K(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeMlegOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return K(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async previewCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async replaceOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id,action:r.action,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,symbol:r.symbol,stop:r.stop,units:r.units};return K(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return K(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},li=function(e,t,n){let r=$(e);return{cancelOrder(...e){return r.cancelOrder(...e).then(e=>e(n,t))},getCryptocurrencyPairQuote(...e){return r.getCryptocurrencyPairQuote(...e).then(e=>e(n,t))},getOptionImpact(...e){return r.getOptionImpact(...e).then(e=>e(n,t))},getOrderImpact(...e){return r.getOrderImpact(...e).then(e=>e(n,t))},getUserAccountOptionQuotes(...e){return r.getUserAccountOptionQuotes(...e).then(e=>e(n,t))},getUserAccountQuotes(...e){return r.getUserAccountQuotes(...e).then(e=>e(n,t))},placeComplexOrder(...e){return r.placeComplexOrder(...e).then(e=>e(n,t))},placeCryptoOrder(...e){return r.placeCryptoOrder(...e).then(e=>e(n,t))},placeForceOrder(...e){return r.placeForceOrder(...e).then(e=>e(n,t))},placeMlegOrder(...e){return r.placeMlegOrder(...e).then(e=>e(n,t))},placeOrder(...e){return r.placeOrder(...e).then(e=>e(n,t))},previewCryptoOrder(...e){return r.previewCryptoOrder(...e).then(e=>e(n,t))},replaceOrder(...e){return r.replaceOrder(...e).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(...e){return r.searchCryptocurrencyPairInstruments(...e).then(e=>e(n,t))}}};var ui=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},di=class extends ui{},fi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},pi=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},mi=class e{constructor(e){this.mode=`oauth`,this.accessToken=e.accessToken}static create(t){return new e(t)}},hi=class{constructor(){}static commercialApiKey(e){return fi.create(e)}static personalApiKey(e){return pi.create(e)}static oauth(e){return mi.create(e)}},gi=class{constructor(e){this.authMode=e.auth.mode,this.apiKey={},e.auth.mode===`commercialApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`personalApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`oauth`&&(this.accessToken=e.auth.accessToken),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/13.2.2/typescript`:e.userAgent,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},_i=class{constructor(e){}},vi=class extends _i{constructor(e){super(e);let t=new gi(e);this.accountInformation=new Pr(t),this.apiStatus=new zr(t),this.authentication=new Wr(t),this.connections=new Jr(t),this.experimentalEndpoints=new Qr(t),this.management=new ri(t),this.referenceData=new si(t),this.trading=new di(t)}};let yi=()=>Error(`Device authorization expired. Start a new authorization.`),bi=()=>Object.assign(Error(`Device authorization cancelled.`),{name:`AbortError`}),xi=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(bi());return}let i=()=>{clearTimeout(a),t.removeEventListener(`abort`,i),r(bi())},a=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})});var Si=class{constructor(e={}){this.issuer=(e.issuer??new URL(L).origin).replace(/\/+$/,``),this.http=e.axios??I}async startDeviceAuthorization(e){let t=Date.now(),{data:n}=await this.http.post(`${this.issuer}/oauth/device_authorization/`,new URLSearchParams({client_id:e.clientId,scope:`read`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:e.signal});if(typeof n.device_code!=`string`||!n.device_code||typeof n.user_code!=`string`||!n.user_code||typeof n.verification_uri!=`string`||!n.verification_uri||!Number.isFinite(n.expires_in)||n.expires_in<=0||n.interval!==void 0&&(!Number.isFinite(n.interval)||n.interval<=0))throw Error(`Invalid device authorization response.`);return{deviceCode:n.device_code,userCode:n.user_code,verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,expiresAt:t+n.expires_in*1e3,interval:n.interval??5}}async waitForDeviceToken(e){let{authorization:t,signal:n}=e;if(n?.aborted)throw bi();let r=t.expiresAt-Date.now();if(!Number.isFinite(r)||r<=0)throw yi();if(!Number.isFinite(t.interval)||t.interval<=0)throw Error(`Invalid polling interval.`);let i=new AbortController,a=()=>i.abort();n?.addEventListener(`abort`,a,{once:!0});let o=setTimeout(a,Math.min(r,2147483647)),s=t.interval*1e3;try{for(;;){if(await xi(Math.min(s,Math.max(0,t.expiresAt-Date.now())),i.signal),Date.now()>=t.expiresAt)throw yi();try{let{data:n}=await this.http.post(`${this.issuer}/oauth/token/`,new URLSearchParams({client_id:e.clientId,device_code:t.deviceCode,grant_type:`urn:ietf:params:oauth:grant-type:device_code`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:i.signal,timeout:Math.min(3e4,Math.max(1,t.expiresAt-Date.now()))});if(typeof n.access_token!=`string`||!n.access_token)throw Error(`OAuth response is missing access_token.`);return{accessToken:n.access_token,refreshToken:n.refresh_token,tokenType:n.token_type,expiresIn:n.expires_in,scope:n.scope}}catch(e){let t=e,n=t.response?.data?.error;if(n===`authorization_pending`)continue;if(n===`slow_down`){s+=5e3;continue}if(t.code===`ECONNABORTED`||t.code===`ETIMEDOUT`){s*=2;continue}throw e}}}catch(e){throw n?.aborted?bi():i.signal.aborted||Date.now()>=t.expiresAt?yi():e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}};e.AccountInformationApi=Pr,e.AccountInformationApiAxiosParamCreator=jr,e.AccountInformationApiFactory=Mr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Nr,e.ApiStatusApi=zr,e.ApiStatusApiAxiosParamCreator=Fr,e.ApiStatusApiFactory=Lr,e.ApiStatusApiFp=Ir,e.ApiStatusApiGenerated=Rr,e.AuthenticationApi=Wr,e.AuthenticationApiAxiosParamCreator=Br,e.AuthenticationApiFactory=Hr,e.AuthenticationApiFp=Vr,e.AuthenticationApiGenerated=Ur,e.CommercialApiKeyAuth=fi,e.Configuration=gi,e.ConnectionsApi=Jr,e.ConnectionsApiAxiosParamCreator=Gr,e.ConnectionsApiFactory=Kr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=qr,e.ExperimentalEndpointsApi=Qr,e.ExperimentalEndpointsApiAxiosParamCreator=Yr,e.ExperimentalEndpointsApiFactory=Xr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Zr,e.ManagementApi=ri,e.ManagementApiAxiosParamCreator=$r,e.ManagementApiFactory=ti,e.ManagementApiFp=ei,e.ManagementApiGenerated=ni,e.OAuthAuth=mi,e.PersonalApiKeyAuth=pi,e.ReferenceDataApi=si,e.ReferenceDataApiAxiosParamCreator=ii,e.ReferenceDataApiFactory=ai,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=oi,e.Snaptrade=vi,e.SnaptradeAuth=hi,e.SnaptradeError=Tr,e.SnaptradeOAuthDevice=Si,e.TradingApi=di,e.TradingApiAxiosParamCreator=ci,e.TradingApiFactory=li,e.TradingApiFp=$,e.TradingApiGenerated=ui,e.parseIfJson=Dr,e.readableStreamToString=Er});
|
|
11
|
+
`+JSON.stringify(n,null,2);super(a),this.name=`SnaptradeError`,this.code=e.code,this.method=e.config?.method?.toUpperCase(),this.url=i,this.status=e.response?.status,this.statusText=e.response?.statusText,this.responseBody=t}toJSON(){return{name:this.name,message:this.message,method:this.method,url:this.url,code:this.code,status:this.status,statusText:this.statusText,responseBody:this.responseBody}}};async function Er(e){let t=new TextDecoder,n=e.getReader(),r=``;try{for(;;){let{done:e,value:i}=await n.read();if(e)break;let a=t.decode(i,{stream:!0});r+=a}}finally{n.releaseLock()}return r}function Dr(e){if(typeof e!=`string`)return e;try{let t=JSON.parse(e);return typeof t==`object`&&t?t:e}catch{return e}}let z=`https://example.com`,B=function(e,t,n){if(n==null)throw new _r(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},V=async function({object:e,key:t,type:n,keyParamName:r,configuration:i,prefix:a}){t=t||r;let o=null;if(i&&i.apiKey)if(typeof i.apiKey==`function`)o=await i.apiKey(r);else if(typeof i.apiKey==`string`)o=i.apiKey;else if(typeof i.apiKey==`object`)r in i.apiKey&&(o=i.apiKey[r]);else throw Error(`Unexpected type ${typeof i.apiKey} for Configuration.apiKey`);o&&(e[t]=a===void 0?o:`${a}${o}`,n===`Cookie`&&(e[t]=`${r}=${e[t]}`))},H=async function(e,t){t&&t.accessToken&&(e.Authorization=`Bearer `+(typeof t.accessToken==`function`?await t.accessToken():await t.accessToken))};function Or(e,t,n=``){typeof t==`object`?Array.isArray(t)?t.forEach(t=>Or(e,t,n)):Object.keys(t).forEach(r=>Or(e,t[r],`${n}${n===``?``:`.`}${r}`)):e.has(n)?e.append(n,t):e.set(n,t)}let U=function(e,...t){let n=new URLSearchParams(e.search);Or(n,t),e.search=n.toString()},W=function(e,t,n){let r=typeof e!=`string`;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers[`Content-Type`]):r)?JSON.stringify(e===void 0?{}:e):e||``},G=function(e){return kr(e.pathname)+e.search+e.hash},kr=function(e){return e.replace(/\/$/,``)};async function Ar(e){let t=0,n=5e3;for(;t<3;)try{return await e()}catch(e){if(I.isAxiosError(e)){if(e.response?.status==429){t++,console.log(`429 error encountered, retrying in ${n/1e3} seconds...`),await new Promise(e=>setTimeout(e,n)),n*=2;continue}let r;try{let t=e.response?.data;r=t,typeof ReadableStream<`u`&&t instanceof ReadableStream&&(r=await Er(t)),r=Dr(r)}catch{r=void 0}throw new Tr(e,r,e.response?.headers)}throw e}throw Error(`Request failed after 3 retries due to 429 (rate limit) errors.`)}let K=function(e,t,n,r,i){return async(a=t,o=n)=>{let s=(r?.basePath||o)+e.url;return await xr({axiosArgs:e,basePath:o,url:s,configuration:r,operationAuth:i?{...i,selectedAuthMode:r?.authMode}:void 0}),Ar(async()=>await a.request({...e.options,url:s}))}};function q(){return typeof window<`u`}function J(e){let{queryParameters:t,operationAuth:n}=e,r=n?.selectedAuthMode;(r===void 0?void 0:n?.requestSigningByAuthMode?.[r])?.signedSecuritySchemes.find(e=>e.toLowerCase().endsWith(`timestamp`))!==void 0&&(t.timestamp=Math.round(new Date().getTime()/1e3).toString())}let jr=function(e){return{getAccountActivities:async(t,n,r,i,a,o,s,c,l={})=>{B(`getAccountActivities`,`accountId`,t);let u=`/accounts/{accountId}/activities`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),d=new URL(u,z),f;e&&(f=e.baseOptions);let p={method:`GET`,...f,...l},m=e&&!q()?{"User-Agent":e.userAgent}:{},h={};e?.authMode===`commercialApiKey`&&(await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),s!==void 0&&(h.userId=s),c!==void 0&&(h.userSecret=c)),e?.authMode===`personalApiKey`&&await V({object:h,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(m,e),n!==void 0&&(h.startDate=n instanceof Date?n.toISOString().substr(0,10):n),r!==void 0&&(h.endDate=r instanceof Date?r.toISOString().substr(0,10):r),i!==void 0&&(h.offset=i),a!==void 0&&(h.limit=a),o!==void 0&&(h.type=o);let g={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},_=f&&f.headers?f.headers:{};return p.headers={...m,..._,...l.headers},J({queryParameters:h,requestConfig:p,path:u,configuration:e,pathTemplate:`/accounts/{accountId}/activities`,httpMethod:`GET`,operationAuth:g}),U(d,h),{url:G(d),options:p}},getAccountBalanceHistory:async(t,n,r,i={})=>{B(`getAccountBalanceHistory`,`accountId`,t);let a=`/accounts/{accountId}/balanceHistory`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balanceHistory`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountBalancesV2:async(t,n,r,i={})=>{B(`getAccountBalancesV2`,`accountId`,t);let a=`/accounts/{accountId}/balances/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances/v2`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAccountDetails:async(t,n,r,i={})=>{B(`getAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/details`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getAllAccountPositions:async(t,n,r,i={})=>{B(`getAllAccountPositions`,`accountId`,t);let a=`/accounts/{accountId}/positions/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/positions/all`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountBalance:async(t,n,r,i={})=>{B(`getUserAccountBalance`,`accountId`,t);let a=`/accounts/{accountId}/balances`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/balances`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountDetails:async(t,n,r,i={})=>{B(`getUserAccountDetails`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},getUserAccountOrderDetail:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetail`,`accountId`,t),B(`getUserAccountOrderDetail`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/orders/details`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getUserAccountOrders:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountReturnRates:async(t,n,r,i,a={})=>{B(`getUserAccountReturnRates`,`accountId`,t);let o=`/accounts/{accountId}/returnRates`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserHoldings:async(t,n,r,i={})=>{B(`getUserHoldings`,`accountId`,t);let a=`/accounts/{accountId}/holdings`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}/holdings`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listAllUserAccounts:async(t,n,r={})=>{let i=`/accounts/all`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts/all`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listUserAccounts:async(t,n,r={})=>{let i=`/accounts`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/accounts`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},updateUserAccount:async(t,n,r,i={})=>{B(`updateUserAccount`,`accountId`,t);let a=`/accounts/{accountId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`PUT`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/accounts/{accountId}`,httpMethod:`PUT`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},Y=function(e){let t=jr(e);return{async getAccountActivities(...n){let[r={},i]=n;return K(await t.getAccountActivities(r.accountId,r.startDate,r.endDate,r.offset,r.limit,r.type,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalanceHistory(...n){let[r={},i]=n;return K(await t.getAccountBalanceHistory(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountBalancesV2(...n){let[r={},i]=n;return K(await t.getAccountBalancesV2(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountDetails(...n){let[r={},i]=n;return K(await t.getAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountPositions(...n){let[r={},i]=n;return K(await t.getAllAccountPositions(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountBalance(...n){let[r={},i]=n;return K(await t.getUserAccountBalance(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountDetails(...n){let[r={},i]=n;return K(await t.getUserAccountDetails(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetail(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.getUserAccountOrderDetail(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrders(...n){let[r={},i]=n;return K(await t.getUserAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountReturnRates(...n){let[r={},i]=n;return K(await t.getUserAccountReturnRates(r.accountId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserHoldings(...n){let[r={},i]=n;return K(await t.getUserHoldings(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllUserAccounts(...n){let[r={},i]=n;return K(await t.listAllUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listUserAccounts(...n){let[r={},i]=n;return K(await t.listUserAccounts(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async updateUserAccount(...n){let[r={},i]=n;return K(await t.updateUserAccount(r.accountId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Mr=function(e,t,n){let r=Y(e);return{getAccountActivities(...e){return r.getAccountActivities(...e).then(e=>e(n,t))},getAccountBalanceHistory(...e){return r.getAccountBalanceHistory(...e).then(e=>e(n,t))},getAccountBalancesV2(...e){return r.getAccountBalancesV2(...e).then(e=>e(n,t))},getAccountDetails(...e){return r.getAccountDetails(...e).then(e=>e(n,t))},getAllAccountPositions(...e){return r.getAllAccountPositions(...e).then(e=>e(n,t))},getUserAccountBalance(...e){return r.getUserAccountBalance(...e).then(e=>e(n,t))},getUserAccountDetails(...e){return r.getUserAccountDetails(...e).then(e=>e(n,t))},getUserAccountOrderDetail(...e){return r.getUserAccountOrderDetail(...e).then(e=>e(n,t))},getUserAccountOrders(...e){return r.getUserAccountOrders(...e).then(e=>e(n,t))},getUserAccountRecentOrders(...e){return r.getUserAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountReturnRates(...e){return r.getUserAccountReturnRates(...e).then(e=>e(n,t))},getUserHoldings(...e){return r.getUserHoldings(...e).then(e=>e(n,t))},listAllUserAccounts(...e){return r.listAllUserAccounts(...e).then(e=>e(n,t))},listUserAccounts(...e){return r.listUserAccounts(...e).then(e=>e(n,t))},updateUserAccount(...e){return r.updateUserAccount(...e).then(e=>e(n,t))}}};var Nr=class extends R{getAccountActivities(...e){return Y(this.configuration).getAccountActivities(...e).then(e=>e(this.axios,this.basePath))}getAccountBalanceHistory(...e){return Y(this.configuration).getAccountBalanceHistory(...e).then(e=>e(this.axios,this.basePath))}getAccountBalancesV2(...e){return Y(this.configuration).getAccountBalancesV2(...e).then(e=>e(this.axios,this.basePath))}getAccountDetails(...e){return Y(this.configuration).getAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getAllAccountPositions(...e){return Y(this.configuration).getAllAccountPositions(...e).then(e=>e(this.axios,this.basePath))}getUserAccountBalance(...e){return Y(this.configuration).getUserAccountBalance(...e).then(e=>e(this.axios,this.basePath))}getUserAccountDetails(...e){return Y(this.configuration).getUserAccountDetails(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetail(...e){return Y(this.configuration).getUserAccountOrderDetail(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrders(...e){return Y(this.configuration).getUserAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrders(...e){return Y(this.configuration).getUserAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountReturnRates(...e){return Y(this.configuration).getUserAccountReturnRates(...e).then(e=>e(this.axios,this.basePath))}getUserHoldings(...e){return Y(this.configuration).getUserHoldings(...e).then(e=>e(this.axios,this.basePath))}listAllUserAccounts(...e){return Y(this.configuration).listAllUserAccounts(...e).then(e=>e(this.axios,this.basePath))}listUserAccounts(...e){return Y(this.configuration).listUserAccounts(...e).then(e=>e(this.axios,this.basePath))}updateUserAccount(...e){return Y(this.configuration).updateUserAccount(...e).then(e=>e(this.axios,this.basePath))}},Pr=class extends Nr{};let Fr=function(e){return{check:async(t={})=>{let n=new URL(`/`,z),r;e&&(r=e.baseOptions);let i={method:`GET`,...r,...t},a=e&&!q()?{"User-Agent":e.userAgent}:{},o={},s={authModes:[`public`],selectedAuthMode:e?.authMode},c=r&&r.headers?r.headers:{};return i.headers={...a,...c,...t.headers},J({queryParameters:o,requestConfig:i,path:`/`,configuration:e,pathTemplate:`/`,httpMethod:`GET`,operationAuth:s}),U(n,o),{url:G(n),options:i}}}},Ir=function(e){let t=Fr(e);return{async check(n){return K(await t.check(n),I,L,e,{authModes:[`public`]})}}},Lr=function(e,t,n){let r=Ir(e);return{check(e){return r.check(e).then(e=>e(n,t))}}};var Rr=class extends R{check(e){return Ir(this.configuration).check(e).then(e=>e(this.axios,this.basePath))}},zr=class extends Rr{};let Br=function(e){return{deleteSnapTradeUser:async(t,n={})=>{let r=`/snapTrade/deleteUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`DELETE`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&(await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.userId=t));let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/deleteUser`,httpMethod:`DELETE`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listSnapTradeUsers:async(t={})=>{let n=`/snapTrade/listUsers`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/listUsers`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},loginSnapTradeUser:async(t,n,r,i={})=>{let a=`/snapTrade/login`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/login`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},registerSnapTradeUser:async(t,n={})=>{B(`registerSnapTradeUser`,`snapTradeRegisterUserRequestBody`,t);let r=`/snapTrade/registerUser`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/registerUser`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},resetSnapTradeUserSecret:async(t,n={})=>{B(`resetSnapTradeUserSecret`,`userIDandSecret`,t);let r=`/snapTrade/resetUserSecret`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/resetUserSecret`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}}}},Vr=function(e){let t=Br(e);return{async deleteSnapTradeUser(...n){let[r={},i]=n;return K(await t.deleteSnapTradeUser(r.userId,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async listSnapTradeUsers(...n){let[r]=n;return K(await t.listSnapTradeUsers(r),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async loginSnapTradeUser(...n){let[r={},i]=n,a={broker:r.broker,immediateRedirect:r.immediateRedirect,customRedirect:r.customRedirect,reconnect:r.reconnect,connectionType:r.connectionType,showCloseButton:r.showCloseButton,darkMode:r.darkMode,locale:r.locale,connectionPortalVersion:r.connectionPortalVersion};return K(await t.loginSnapTradeUser(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async registerSnapTradeUser(...n){let[r={},i]=n,a={userId:r.userId};return K(await t.registerSnapTradeUser(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})},async resetSnapTradeUserSecret(...n){let[r={},i]=n,a={userId:r.userId,userSecret:r.userSecret};return K(await t.resetSnapTradeUserSecret(a,i),I,L,e,{authModes:[`commercialApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]}}})}}},Hr=function(e,t,n){let r=Vr(e);return{deleteSnapTradeUser(...e){return r.deleteSnapTradeUser(...e).then(e=>e(n,t))},listSnapTradeUsers(...e){return r.listSnapTradeUsers(...e).then(e=>e(n,t))},loginSnapTradeUser(...e){return r.loginSnapTradeUser(...e).then(e=>e(n,t))},registerSnapTradeUser(...e){return r.registerSnapTradeUser(...e).then(e=>e(n,t))},resetSnapTradeUserSecret(...e){return r.resetSnapTradeUserSecret(...e).then(e=>e(n,t))}}};var Ur=class extends R{deleteSnapTradeUser(...e){return Vr(this.configuration).deleteSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}listSnapTradeUsers(...e){return Vr(this.configuration).listSnapTradeUsers(...e).then(e=>e(this.axios,this.basePath))}loginSnapTradeUser(...e){return Vr(this.configuration).loginSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}registerSnapTradeUser(...e){return Vr(this.configuration).registerSnapTradeUser(...e).then(e=>e(this.axios,this.basePath))}resetSnapTradeUserSecret(...e){return Vr(this.configuration).resetSnapTradeUserSecret(...e).then(e=>e(this.axios,this.basePath))}},Wr=class extends Ur{};let Gr=function(e){return{deleteConnection:async(t,n,r,i={})=>{B(`deleteConnection`,`connectionId`,t);let a=`/connection/{connectionId}`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`DELETE`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connection/{connectionId}`,httpMethod:`DELETE`,operationAuth:d}),U(o,u),{url:G(o),options:c}},detailBrokerageAuthorization:async(t,n,r,i={})=>{B(`detailBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},disableBrokerageAuthorization:async(t,n,r,i={})=>{B(`disableBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/disable`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/disable`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizationAccounts:async(t,n,r,i={})=>{B(`listBrokerageAuthorizationAccounts`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/accounts`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},listBrokerageAuthorizations:async(t,n,r={})=>{let i=`/authorizations`,a=new URL(i,z),o;e&&(o=e.baseOptions);let s={method:`GET`,...o,...r},c=e&&!q()?{"User-Agent":e.userAgent}:{},l={};e?.authMode===`commercialApiKey`&&(await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(l.userId=t),n!==void 0&&(l.userSecret=n)),e?.authMode===`personalApiKey`&&await V({object:l,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(c,e);let u={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...r.headers},J({queryParameters:l,requestConfig:s,path:i,configuration:e,pathTemplate:`/authorizations`,httpMethod:`GET`,operationAuth:u}),U(a,l),{url:G(a),options:s}},listConnectionAccounts:async(t,n,r,i={})=>{B(`listConnectionAccounts`,`connectionId`,t);let a=`/connections/{connectionId}/accounts`.replace(`{connectionId}`,encodeURIComponent(String(t===void 0?`-connectionId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`GET`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/connections/{connectionId}/accounts`,httpMethod:`GET`,operationAuth:d}),U(o,u),{url:G(o),options:c}},refreshBrokerageAuthorization:async(t,n,r,i={})=>{B(`refreshBrokerageAuthorization`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/refresh`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/refresh`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}},returnRates:async(t,n,r,i,a={})=>{B(`returnRates`,`authorizationId`,t);let o=`/authorizations/{authorizationId}/returnRates`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.timeframes=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/authorizations/{authorizationId}/returnRates`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},syncBrokerageAuthorizationTransactions:async(t,n,r,i={})=>{B(`syncBrokerageAuthorizationTransactions`,`authorizationId`,t);let a=`/authorizations/{authorizationId}/transactions/sync`.replace(`{authorizationId}`,encodeURIComponent(String(t===void 0?`-authorizationId-`:t))),o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/authorizations/{authorizationId}/transactions/sync`,httpMethod:`POST`,operationAuth:d}),U(o,u),{url:G(o),options:c}}}},X=function(e){let t=Gr(e);return{async deleteConnection(...n){let[r={},i]=n;return K(await t.deleteConnection(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async detailBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.detailBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async disableBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.disableBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizationAccounts(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizationAccounts(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listBrokerageAuthorizations(...n){let[r={},i]=n;return K(await t.listBrokerageAuthorizations(r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listConnectionAccounts(...n){let[r={},i]=n;return K(await t.listConnectionAccounts(r.connectionId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async refreshBrokerageAuthorization(...n){let[r={},i]=n;return K(await t.refreshBrokerageAuthorization(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async returnRates(...n){let[r={},i]=n;return K(await t.returnRates(r.authorizationId,r.timeframes,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async syncBrokerageAuthorizationTransactions(...n){let[r={},i]=n;return K(await t.syncBrokerageAuthorizationTransactions(r.authorizationId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Kr=function(e,t,n){let r=X(e);return{deleteConnection(...e){return r.deleteConnection(...e).then(e=>e(n,t))},detailBrokerageAuthorization(...e){return r.detailBrokerageAuthorization(...e).then(e=>e(n,t))},disableBrokerageAuthorization(...e){return r.disableBrokerageAuthorization(...e).then(e=>e(n,t))},listBrokerageAuthorizationAccounts(...e){return r.listBrokerageAuthorizationAccounts(...e).then(e=>e(n,t))},listBrokerageAuthorizations(...e){return r.listBrokerageAuthorizations(...e).then(e=>e(n,t))},listConnectionAccounts(...e){return r.listConnectionAccounts(...e).then(e=>e(n,t))},refreshBrokerageAuthorization(...e){return r.refreshBrokerageAuthorization(...e).then(e=>e(n,t))},returnRates(...e){return r.returnRates(...e).then(e=>e(n,t))},syncBrokerageAuthorizationTransactions(...e){return r.syncBrokerageAuthorizationTransactions(...e).then(e=>e(n,t))}}};var qr=class extends R{deleteConnection(...e){return X(this.configuration).deleteConnection(...e).then(e=>e(this.axios,this.basePath))}detailBrokerageAuthorization(...e){return X(this.configuration).detailBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}disableBrokerageAuthorization(...e){return X(this.configuration).disableBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizationAccounts(...e){return X(this.configuration).listBrokerageAuthorizationAccounts(...e).then(e=>e(this.axios,this.basePath))}listBrokerageAuthorizations(...e){return X(this.configuration).listBrokerageAuthorizations(...e).then(e=>e(this.axios,this.basePath))}listConnectionAccounts(...e){return X(this.configuration).listConnectionAccounts(...e).then(e=>e(this.axios,this.basePath))}refreshBrokerageAuthorization(...e){return X(this.configuration).refreshBrokerageAuthorization(...e).then(e=>e(this.axios,this.basePath))}returnRates(...e){return X(this.configuration).returnRates(...e).then(e=>e(this.axios,this.basePath))}syncBrokerageAuthorizationTransactions(...e){return X(this.configuration).syncBrokerageAuthorizationTransactions(...e).then(e=>e(this.axios,this.basePath))}},Jr=class extends qr{};let Yr=function(e){return{addSubscription:async(t,n,r,i={})=>{B(`addSubscription`,`tradeDetectionAddSubscriptionRequest`,t);let a=`/snapTrade/tradeDetection/subscriptions`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e});let d={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},cancelSubscription:async(t,n={})=>{B(`cancelSubscription`,`tradeDetectionCancelSubscriptionRequest`,t);let r=`/snapTrade/tradeDetection/subscriptions/cancel`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e});let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions/cancel`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getAccountOrder:async(t,n,r,i,a={})=>{B(`getAccountOrder`,`accountId`,t),B(`getAccountOrder`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e});let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getAllAccountOrders:async(t,n,r,i,a,o={})=>{B(`getAllAccountOrders`,`accountId`,t);let s=`/accounts/{accountId}/orders/all`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/all`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getAllAccountRecentOrders:async(t,n,r,i,a={})=>{B(`getAllAccountRecentOrders`,`accountId`,t);let o=`/accounts/{accountId}/orders/recent`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/recent`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrderDetailV2:async(t,n,r,i,a={})=>{B(`getUserAccountOrderDetailV2`,`accountId`,t),B(`getUserAccountOrderDetailV2`,`brokerageOrderId`,n);let o=`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{brokerageOrderId}`,encodeURIComponent(String(n===void 0?`-brokerageOrderId-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/orders/details/v2/{brokerageOrderId}`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountOrdersV2:async(t,n,r,i,a,o={})=>{B(`getUserAccountOrdersV2`,`accountId`,t);let s=`/accounts/{accountId}/orders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.state=n),r!==void 0&&(f.days=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/orders/v2`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},getUserAccountRecentOrdersV2:async(t,n,r,i,a={})=>{B(`getUserAccountRecentOrdersV2`,`accountId`,t);let o=`/accounts/{accountId}/recentOrders/v2`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e),n!==void 0&&(d.only_executed=n);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/recentOrders/v2`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},listSubscriptions:async(t={})=>{let n=`/snapTrade/tradeDetection/subscriptions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e});let c={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/tradeDetection/subscriptions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},placeSimpleOrder:async(t,n,r,i,a={})=>{B(`placeSimpleOrder`,`accountId`,t),B(`placeSimpleOrder`,`simpleTradeForm`,n);let o=`/accounts/{accountId}/trading/simple`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/simple`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Z=function(e){let t=Yr(e);return{async addSubscription(...n){let[r={},i]=n,a={account_id:r.account_id,check_interval_seconds:r.check_interval_seconds};return K(await t.addSubscription(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async cancelSubscription(...n){let[r={},i]=n,a={account_id:r.account_id};return K(await t.cancelSubscription(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAccountOrder(...n){let[r={},i]=n;return K(await t.getAccountOrder(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountOrders(...n){let[r={},i]=n;return K(await t.getAllAccountOrders(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getAllAccountRecentOrders(...n){let[r={},i]=n;return K(await t.getAllAccountRecentOrders(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrderDetailV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrderDetailV2(r.accountId,r.brokerageOrderId,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountOrdersV2(r.accountId,r.state,r.days,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountRecentOrdersV2(...n){let[r={},i]=n;return K(await t.getUserAccountRecentOrdersV2(r.accountId,r.onlyExecuted,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listSubscriptions(...n){let[r]=n;return K(await t.listSubscriptions(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeSimpleOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,legs:r.legs,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,client_order_id:r.client_order_id,expiry_date:r.expiry_date,notional_value:r.notional_value,trading_session:r.trading_session};return K(await t.placeSimpleOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},Xr=function(e,t,n){let r=Z(e);return{addSubscription(...e){return r.addSubscription(...e).then(e=>e(n,t))},cancelSubscription(...e){return r.cancelSubscription(...e).then(e=>e(n,t))},getAccountOrder(...e){return r.getAccountOrder(...e).then(e=>e(n,t))},getAllAccountOrders(...e){return r.getAllAccountOrders(...e).then(e=>e(n,t))},getAllAccountRecentOrders(...e){return r.getAllAccountRecentOrders(...e).then(e=>e(n,t))},getUserAccountOrderDetailV2(...e){return r.getUserAccountOrderDetailV2(...e).then(e=>e(n,t))},getUserAccountOrdersV2(...e){return r.getUserAccountOrdersV2(...e).then(e=>e(n,t))},getUserAccountRecentOrdersV2(...e){return r.getUserAccountRecentOrdersV2(...e).then(e=>e(n,t))},listSubscriptions(...e){return r.listSubscriptions(...e).then(e=>e(n,t))},placeSimpleOrder(...e){return r.placeSimpleOrder(...e).then(e=>e(n,t))}}};var Zr=class extends R{addSubscription(...e){return Z(this.configuration).addSubscription(...e).then(e=>e(this.axios,this.basePath))}cancelSubscription(...e){return Z(this.configuration).cancelSubscription(...e).then(e=>e(this.axios,this.basePath))}getAccountOrder(...e){return Z(this.configuration).getAccountOrder(...e).then(e=>e(this.axios,this.basePath))}getAllAccountOrders(...e){return Z(this.configuration).getAllAccountOrders(...e).then(e=>e(this.axios,this.basePath))}getAllAccountRecentOrders(...e){return Z(this.configuration).getAllAccountRecentOrders(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrderDetailV2(...e){return Z(this.configuration).getUserAccountOrderDetailV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOrdersV2(...e){return Z(this.configuration).getUserAccountOrdersV2(...e).then(e=>e(this.axios,this.basePath))}getUserAccountRecentOrdersV2(...e){return Z(this.configuration).getUserAccountRecentOrdersV2(...e).then(e=>e(this.axios,this.basePath))}listSubscriptions(...e){return Z(this.configuration).listSubscriptions(...e).then(e=>e(this.axios,this.basePath))}placeSimpleOrder(...e){return Z(this.configuration).placeSimpleOrder(...e).then(e=>e(this.axios,this.basePath))}},Qr=class extends Zr{};let $r=function(e){return{getStats:async(t,n={})=>{let r=`/management/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/management/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},getStatsLegacy:async(t,n={})=>{let r=`/snapTrade/stats`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.currency=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/snapTrade/stats`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}}}},ei=function(e){let t=$r(e);return{async getStats(...n){let[r={},i]=n;return K(await t.getStats(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStatsLegacy(...n){let[r={},i]=n;return K(await t.getStatsLegacy(r.currency,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ti=function(e,t,n){let r=ei(e);return{getStats(...e){return r.getStats(...e).then(e=>e(n,t))},getStatsLegacy(...e){return r.getStatsLegacy(...e).then(e=>e(n,t))}}};var ni=class extends R{getStats(...e){return ei(this.configuration).getStats(...e).then(e=>e(this.axios,this.basePath))}getStatsLegacy(...e){return ei(this.configuration).getStatsLegacy(...e).then(e=>e(this.axios,this.basePath))}},ri=class extends ni{};let ii=function(e){return{getPartnerInfo:async(t={})=>{let n=`/snapTrade/partners`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/snapTrade/partners`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getStockExchanges:async(t={})=>{let n=`/exchanges`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/exchanges`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},getSymbols:async(t,n={})=>{let r=`/symbols`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`POST`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};s[`Content-Type`]=`application/json`;let u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({requestBody:t,queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols`,httpMethod:`POST`,operationAuth:l}),o.data=W(t,o,e),U(i,c),{url:G(i),options:o}},getSymbolsByTicker:async(t,n={})=>{B(`getSymbolsByTicker`,`query`,t);let r=`/symbols/{query}`.replace(`{query}`,encodeURIComponent(String(t===void 0?`-query-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/symbols/{query}`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageAuthorizationType:async(t,n={})=>{let r=`/brokerageAuthorizationTypes`,i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),t!==void 0&&(c.brokerage=t);let l={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerageAuthorizationTypes`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerageInstruments:async(t,n={})=>{B(`listAllBrokerageInstruments`,`slug`,t);let r=`/brokerages/{slug}/instruments`.replace(`{slug}`,encodeURIComponent(String(t===void 0?`-slug-`:t))),i=new URL(r,z),a;e&&(a=e.baseOptions);let o={method:`GET`,...a,...n},s=e&&!q()?{"User-Agent":e.userAgent}:{},c={};e?.authMode===`commercialApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:c,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(s,e);let l={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},u=a&&a.headers?a.headers:{};return o.headers={...s,...u,...n.headers},J({queryParameters:c,requestConfig:o,path:r,configuration:e,pathTemplate:`/brokerages/{slug}/instruments`,httpMethod:`GET`,operationAuth:l}),U(i,c),{url:G(i),options:o}},listAllBrokerages:async(t={})=>{let n=`/brokerages`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={};e?.authMode===`commercialApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`personalApiKey`&&await V({object:s,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(o,e);let c={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/brokerages`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},listInstitutions:async(t={})=>{let n=`/institutions`,r=new URL(n,z),i;e&&(i=e.baseOptions);let a={method:`GET`,...i,...t},o=e&&!q()?{"User-Agent":e.userAgent}:{},s={},c={authModes:[`public`],selectedAuthMode:e?.authMode},l=i&&i.headers?i.headers:{};return a.headers={...o,...l,...t.headers},J({queryParameters:s,requestConfig:a,path:n,configuration:e,pathTemplate:`/institutions`,httpMethod:`GET`,operationAuth:c}),U(r,s),{url:G(r),options:a}},symbolSearchUserAccount:async(t,n,r,i,a={})=>{B(`symbolSearchUserAccount`,`accountId`,t);let o=`/accounts/{accountId}/symbols`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/symbols`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}}}},Q=function(e){let t=ii(e);return{async getPartnerInfo(...n){let[r]=n;return K(await t.getPartnerInfo(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getStockExchanges(...n){let[r]=n;return K(await t.getStockExchanges(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbols(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.getSymbols(a,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getSymbolsByTicker(...n){let[r={},i]=n;return K(await t.getSymbolsByTicker(r.query,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageAuthorizationType(...n){let[r={},i]=n;return K(await t.listAllBrokerageAuthorizationType(r.brokerage,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerageInstruments(...n){let[r={},i]=n;return K(await t.listAllBrokerageInstruments(r.slug,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listAllBrokerages(...n){let[r]=n;return K(await t.listAllBrokerages(r),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async listInstitutions(n){return K(await t.listInstitutions(n),I,L,e,{authModes:[`public`]})},async symbolSearchUserAccount(...n){let[r={},i]=n,a={substring:r.substring};return K(await t.symbolSearchUserAccount(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},ai=function(e,t,n){let r=Q(e);return{getPartnerInfo(...e){return r.getPartnerInfo(...e).then(e=>e(n,t))},getStockExchanges(...e){return r.getStockExchanges(...e).then(e=>e(n,t))},getSymbols(...e){return r.getSymbols(...e).then(e=>e(n,t))},getSymbolsByTicker(...e){return r.getSymbolsByTicker(...e).then(e=>e(n,t))},listAllBrokerageAuthorizationType(...e){return r.listAllBrokerageAuthorizationType(...e).then(e=>e(n,t))},listAllBrokerageInstruments(...e){return r.listAllBrokerageInstruments(...e).then(e=>e(n,t))},listAllBrokerages(...e){return r.listAllBrokerages(...e).then(e=>e(n,t))},listInstitutions(e){return r.listInstitutions(e).then(e=>e(n,t))},symbolSearchUserAccount(...e){return r.symbolSearchUserAccount(...e).then(e=>e(n,t))}}};var oi=class extends R{getPartnerInfo(...e){return Q(this.configuration).getPartnerInfo(...e).then(e=>e(this.axios,this.basePath))}getStockExchanges(...e){return Q(this.configuration).getStockExchanges(...e).then(e=>e(this.axios,this.basePath))}getSymbols(...e){return Q(this.configuration).getSymbols(...e).then(e=>e(this.axios,this.basePath))}getSymbolsByTicker(...e){return Q(this.configuration).getSymbolsByTicker(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageAuthorizationType(...e){return Q(this.configuration).listAllBrokerageAuthorizationType(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerageInstruments(...e){return Q(this.configuration).listAllBrokerageInstruments(...e).then(e=>e(this.axios,this.basePath))}listAllBrokerages(...e){return Q(this.configuration).listAllBrokerages(...e).then(e=>e(this.axios,this.basePath))}listInstitutions(e){return Q(this.configuration).listInstitutions(e).then(e=>e(this.axios,this.basePath))}symbolSearchUserAccount(...e){return Q(this.configuration).symbolSearchUserAccount(...e).then(e=>e(this.axios,this.basePath))}},si=class extends oi{};let ci=function(e){return{cancelOrder:async(t,n,r,i,a={})=>{B(`cancelOrder`,`accountId`,t),B(`cancelOrder`,`accountInformationGetUserAccountOrderDetailRequest`,n);let o=`/accounts/{accountId}/trading/cancel`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/cancel`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getCryptocurrencyPairQuote:async(t,n,r,i,a={})=>{B(`getCryptocurrencyPairQuote`,`accountId`,t),B(`getCryptocurrencyPairQuote`,`instrumentSymbol`,n);let o=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))).replace(`{instrumentSymbol}`,encodeURIComponent(String(n===void 0?`-instrumentSymbol-`:n))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs/{instrumentSymbol}/quote`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getOptionImpact:async(t,n,r,i,a={})=>{B(`getOptionImpact`,`accountId`,t),B(`getOptionImpact`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options/impact`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options/impact`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},getOrderImpact:async(t,n,r,i={})=>{B(`getOrderImpact`,`manualTradeForm`,t);let a=`/trade/impact`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/impact`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},getUserAccountOptionQuotes:async(t,n,r,i,a={})=>{B(`getUserAccountOptionQuotes`,`accountId`,t),B(`getUserAccountOptionQuotes`,`symbol`,n);let o=`/accounts/{accountId}/quotes/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`GET`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(d.symbol=n);let f={authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/quotes/options`,httpMethod:`GET`,operationAuth:f}),U(s,d),{url:G(s),options:l}},getUserAccountQuotes:async(t,n,r,i,a,o={})=>{B(`getUserAccountQuotes`,`symbols`,t),B(`getUserAccountQuotes`,`accountId`,n);let s=`/accounts/{accountId}/quotes`.replace(`{accountId}`,encodeURIComponent(String(n===void 0?`-accountId-`:n))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),t!==void 0&&(f.symbols=t),r!==void 0&&(f.use_ticker=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/quotes`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}},placeComplexOrder:async(t,n,r,i,a={})=>{B(`placeComplexOrder`,`accountId`,t),B(`placeComplexOrder`,`manualTradeFormComplex`,n);let o=`/accounts/{accountId}/trading/complex`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/complex`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeCryptoOrder:async(t,n,r,i,a={})=>{B(`placeCryptoOrder`,`accountId`,t),B(`placeCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeForceOrder:async(t,n,r,i={})=>{B(`placeForceOrder`,`manualTradeFormWithOptions`,t);let a=`/trade/place`,o=new URL(a,z),s;e&&(s=e.baseOptions);let c={method:`POST`,...s,...i},l=e&&!q()?{"User-Agent":e.userAgent}:{},u={};e?.authMode===`commercialApiKey`&&(await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),n!==void 0&&(u.userId=n),r!==void 0&&(u.userSecret=r)),e?.authMode===`personalApiKey`&&await V({object:u,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(l,e);let d={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};l[`Content-Type`]=`application/json`;let f=s&&s.headers?s.headers:{};return c.headers={...l,...f,...i.headers},J({requestBody:t,queryParameters:u,requestConfig:c,path:a,configuration:e,pathTemplate:`/trade/place`,httpMethod:`POST`,operationAuth:d}),c.data=W(t,c,e),U(o,u),{url:G(o),options:c}},placeMlegOrder:async(t,n,r,i,a={})=>{B(`placeMlegOrder`,`accountId`,t),B(`placeMlegOrder`,`mlegTradeForm`,n);let o=`/accounts/{accountId}/trading/options`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/options`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},placeOrder:async(t,n,r,i,a={})=>{B(`placeOrder`,`tradeId`,t);let o=`/trade/{tradeId}`.replace(`{tradeId}`,encodeURIComponent(String(t===void 0?`-tradeId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/trade/{tradeId}`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},previewCryptoOrder:async(t,n,r,i,a={})=>{B(`previewCryptoOrder`,`accountId`,t),B(`previewCryptoOrder`,`cryptoOrderForm`,n);let o=`/accounts/{accountId}/trading/crypto/preview`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/crypto/preview`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},replaceOrder:async(t,n,r,i,a={})=>{B(`replaceOrder`,`accountId`,t),B(`replaceOrder`,`manualTradeReplaceForm`,n);let o=`/accounts/{accountId}/trading/replace`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),s=new URL(o,z),c;e&&(c=e.baseOptions);let l={method:`POST`,...c,...a},u=e&&!q()?{"User-Agent":e.userAgent}:{},d={};e?.authMode===`commercialApiKey`&&(await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),r!==void 0&&(d.userId=r),i!==void 0&&(d.userSecret=i)),e?.authMode===`personalApiKey`&&await V({object:d,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(u,e);let f={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode};u[`Content-Type`]=`application/json`;let p=c&&c.headers?c.headers:{};return l.headers={...u,...p,...a.headers},J({requestBody:n,queryParameters:d,requestConfig:l,path:o,configuration:e,pathTemplate:`/accounts/{accountId}/trading/replace`,httpMethod:`POST`,operationAuth:f}),l.data=W(n,l,e),U(s,d),{url:G(s),options:l}},searchCryptocurrencyPairInstruments:async(t,n,r,i,a,o={})=>{B(`searchCryptocurrencyPairInstruments`,`accountId`,t);let s=`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`.replace(`{accountId}`,encodeURIComponent(String(t===void 0?`-accountId-`:t))),c=new URL(s,z),l;e&&(l=e.baseOptions);let u={method:`GET`,...l,...o},d=e&&!q()?{"User-Agent":e.userAgent}:{},f={};e?.authMode===`commercialApiKey`&&(await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),i!==void 0&&(f.userId=i),a!==void 0&&(f.userSecret=a)),e?.authMode===`personalApiKey`&&await V({object:f,key:`clientId`,keyParamName:`clientId`,configuration:e}),e?.authMode===`oauth`&&await H(d,e),n!==void 0&&(f.base=n),r!==void 0&&(f.quote=r);let p={authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}},selectedAuthMode:e?.authMode},m=l&&l.headers?l.headers:{};return u.headers={...d,...m,...o.headers},J({queryParameters:f,requestConfig:u,path:s,configuration:e,pathTemplate:`/accounts/{accountId}/trading/instruments/cryptocurrencyPairs`,httpMethod:`GET`,operationAuth:p}),U(c,f),{url:G(c),options:u}}}},$=function(e){let t=ci(e);return{async cancelOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id};return K(await t.cancelOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getCryptocurrencyPairQuote(...n){let[r={},i]=n;return K(await t.getCryptocurrencyPairQuote(r.accountId,r.instrumentSymbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOptionImpact(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.getOptionImpact(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getOrderImpact(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value};return K(await t.getOrderImpact(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountOptionQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountOptionQuotes(r.accountId,r.symbol,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async getUserAccountQuotes(...n){let[r={},i]=n;return K(await t.getUserAccountQuotes(r.symbols,r.accountId,r.useTicker,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeComplexOrder(...n){let[r={},i]=n,a={type:r.type,orders:r.orders,client_order_id:r.client_order_id};return K(await t.placeComplexOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.placeCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeForceOrder(...n){let[r={},i]=n,a={account_id:r.account_id,action:r.action,universal_symbol_id:r.universal_symbol_id,symbol:r.symbol,order_type:r.order_type,time_in_force:r.time_in_force,trading_session:r.trading_session,expiry_date:r.expiry_date,price:r.price,stop:r.stop,units:r.units,notional_value:r.notional_value,client_order_id:r.client_order_id};return K(await t.placeForceOrder(a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeMlegOrder(...n){let[r={},i]=n,a={order_type:r.order_type,time_in_force:r.time_in_force,limit_price:r.limit_price,stop_price:r.stop_price,price_effect:r.price_effect,legs:r.legs};return K(await t.placeMlegOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async placeOrder(...n){let[r={},i]=n,a={wait_to_confirm:r.wait_to_confirm};return K(await t.placeOrder(r.tradeId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async previewCryptoOrder(...n){let[r={},i]=n,a={instrument:r.instrument,side:r.side,type:r.type,time_in_force:r.time_in_force,amount:r.amount,limit_price:r.limit_price,stop_price:r.stop_price,post_only:r.post_only,expiration_date:r.expiration_date};return K(await t.previewCryptoOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async replaceOrder(...n){let[r={},i]=n,a={brokerage_order_id:r.brokerage_order_id,action:r.action,order_type:r.order_type,time_in_force:r.time_in_force,price:r.price,symbol:r.symbol,stop:r.stop,units:r.units};return K(await t.replaceOrder(r.accountId,a,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})},async searchCryptocurrencyPairInstruments(...n){let[r={},i]=n;return K(await t.searchCryptocurrencyPairInstruments(r.accountId,r.base,r.quote,r.userId,r.userSecret,i),I,L,e,{authModes:[`commercialApiKey`,`personalApiKey`,`oauth`],requestSigningByAuthMode:{commercialApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PartnerSignature`,`PartnerTimestamp`]},personalApiKey:{secretParameter:`consumerKey`,signedSecuritySchemes:[`PersonalSignature`,`PersonalTimestamp`]}}})}}},li=function(e,t,n){let r=$(e);return{cancelOrder(...e){return r.cancelOrder(...e).then(e=>e(n,t))},getCryptocurrencyPairQuote(...e){return r.getCryptocurrencyPairQuote(...e).then(e=>e(n,t))},getOptionImpact(...e){return r.getOptionImpact(...e).then(e=>e(n,t))},getOrderImpact(...e){return r.getOrderImpact(...e).then(e=>e(n,t))},getUserAccountOptionQuotes(...e){return r.getUserAccountOptionQuotes(...e).then(e=>e(n,t))},getUserAccountQuotes(...e){return r.getUserAccountQuotes(...e).then(e=>e(n,t))},placeComplexOrder(...e){return r.placeComplexOrder(...e).then(e=>e(n,t))},placeCryptoOrder(...e){return r.placeCryptoOrder(...e).then(e=>e(n,t))},placeForceOrder(...e){return r.placeForceOrder(...e).then(e=>e(n,t))},placeMlegOrder(...e){return r.placeMlegOrder(...e).then(e=>e(n,t))},placeOrder(...e){return r.placeOrder(...e).then(e=>e(n,t))},previewCryptoOrder(...e){return r.previewCryptoOrder(...e).then(e=>e(n,t))},replaceOrder(...e){return r.replaceOrder(...e).then(e=>e(n,t))},searchCryptocurrencyPairInstruments(...e){return r.searchCryptocurrencyPairInstruments(...e).then(e=>e(n,t))}}};var ui=class extends R{cancelOrder(...e){return $(this.configuration).cancelOrder(...e).then(e=>e(this.axios,this.basePath))}getCryptocurrencyPairQuote(...e){return $(this.configuration).getCryptocurrencyPairQuote(...e).then(e=>e(this.axios,this.basePath))}getOptionImpact(...e){return $(this.configuration).getOptionImpact(...e).then(e=>e(this.axios,this.basePath))}getOrderImpact(...e){return $(this.configuration).getOrderImpact(...e).then(e=>e(this.axios,this.basePath))}getUserAccountOptionQuotes(...e){return $(this.configuration).getUserAccountOptionQuotes(...e).then(e=>e(this.axios,this.basePath))}getUserAccountQuotes(...e){return $(this.configuration).getUserAccountQuotes(...e).then(e=>e(this.axios,this.basePath))}placeComplexOrder(...e){return $(this.configuration).placeComplexOrder(...e).then(e=>e(this.axios,this.basePath))}placeCryptoOrder(...e){return $(this.configuration).placeCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}placeForceOrder(...e){return $(this.configuration).placeForceOrder(...e).then(e=>e(this.axios,this.basePath))}placeMlegOrder(...e){return $(this.configuration).placeMlegOrder(...e).then(e=>e(this.axios,this.basePath))}placeOrder(...e){return $(this.configuration).placeOrder(...e).then(e=>e(this.axios,this.basePath))}previewCryptoOrder(...e){return $(this.configuration).previewCryptoOrder(...e).then(e=>e(this.axios,this.basePath))}replaceOrder(...e){return $(this.configuration).replaceOrder(...e).then(e=>e(this.axios,this.basePath))}searchCryptocurrencyPairInstruments(...e){return $(this.configuration).searchCryptocurrencyPairInstruments(...e).then(e=>e(this.axios,this.basePath))}},di=class extends ui{},fi=class e{constructor(e){this.mode=`commercialApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},pi=class e{constructor(e){this.mode=`personalApiKey`,this.consumerKey=e.consumerKey,this.clientId=e.clientId}static create(t){return new e(t)}},mi=class e{constructor(e){this.mode=`oauth`,this.accessToken=e.accessToken}static create(t){return new e(t)}},hi=class{constructor(){}static commercialApiKey(e){return fi.create(e)}static personalApiKey(e){return pi.create(e)}static oauth(e){return mi.create(e)}},gi=class{constructor(e){this.authMode=e.auth.mode,this.apiKey={},e.auth.mode===`commercialApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`personalApiKey`&&(this.consumerKey=e.auth.consumerKey,e.auth.clientId!==void 0&&(this.apiKey.clientId=e.auth.clientId)),e.auth.mode===`oauth`&&(this.accessToken=e.auth.accessToken),this.basePath=e.basePath,this.baseOptions=e.baseOptions??{},this.userAgent=e.userAgent===void 0?`Konfig/13.2.4/typescript`:e.userAgent,this.formDataCtor=e.formDataCtor}isJsonMime(e){return e!==null&&(RegExp(`^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$`,`i`).test(e)||e.toLowerCase()===`application/json-patch+json`)}},_i=class{constructor(e){}},vi=class extends _i{constructor(e){super(e);let t=new gi(e);this.accountInformation=new Pr(t),this.apiStatus=new zr(t),this.authentication=new Wr(t),this.connections=new Jr(t),this.experimentalEndpoints=new Qr(t),this.management=new ri(t),this.referenceData=new si(t),this.trading=new di(t)}};let yi=()=>Error(`Device authorization expired. Start a new authorization.`),bi=()=>Object.assign(Error(`Device authorization cancelled.`),{name:`AbortError`}),xi=(e,t)=>new Promise((n,r)=>{if(t.aborted){r(bi());return}let i=()=>{clearTimeout(a),t.removeEventListener(`abort`,i),r(bi())},a=setTimeout(()=>{t.removeEventListener(`abort`,i),n()},e);t.addEventListener(`abort`,i,{once:!0})});var Si=class{constructor(e={}){this.issuer=(e.issuer??new URL(L).origin).replace(/\/+$/,``),this.http=e.axios??I}async startDeviceAuthorization(e){let t=Date.now(),{data:n}=await this.http.post(`${this.issuer}/oauth/device_authorization/`,new URLSearchParams({client_id:e.clientId,scope:`read`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:e.signal});if(typeof n.device_code!=`string`||!n.device_code||typeof n.user_code!=`string`||!n.user_code||typeof n.verification_uri!=`string`||!n.verification_uri||!Number.isFinite(n.expires_in)||n.expires_in<=0||n.interval!==void 0&&(!Number.isFinite(n.interval)||n.interval<=0))throw Error(`Invalid device authorization response.`);return{deviceCode:n.device_code,userCode:n.user_code,verificationUri:n.verification_uri,verificationUriComplete:n.verification_uri_complete,expiresAt:t+n.expires_in*1e3,interval:n.interval??5}}async waitForDeviceToken(e){let{authorization:t,signal:n}=e;if(n?.aborted)throw bi();let r=t.expiresAt-Date.now();if(!Number.isFinite(r)||r<=0)throw yi();if(!Number.isFinite(t.interval)||t.interval<=0)throw Error(`Invalid polling interval.`);let i=new AbortController,a=()=>i.abort();n?.addEventListener(`abort`,a,{once:!0});let o=setTimeout(a,Math.min(r,2147483647)),s=t.interval*1e3;try{for(;;){if(await xi(Math.min(s,Math.max(0,t.expiresAt-Date.now())),i.signal),Date.now()>=t.expiresAt)throw yi();try{let{data:n}=await this.http.post(`${this.issuer}/oauth/token/`,new URLSearchParams({client_id:e.clientId,device_code:t.deviceCode,grant_type:`urn:ietf:params:oauth:grant-type:device_code`}).toString(),{headers:{"Content-Type":`application/x-www-form-urlencoded`},signal:i.signal,timeout:Math.min(3e4,Math.max(1,t.expiresAt-Date.now()))});if(typeof n.access_token!=`string`||!n.access_token)throw Error(`OAuth response is missing access_token.`);return{accessToken:n.access_token,refreshToken:n.refresh_token,tokenType:n.token_type,expiresIn:n.expires_in,scope:n.scope}}catch(e){let t=e,n=t.response?.data?.error;if(n===`authorization_pending`)continue;if(n===`slow_down`){s+=5e3;continue}if(t.code===`ECONNABORTED`||t.code===`ETIMEDOUT`){s*=2;continue}throw e}}}catch(e){throw n?.aborted?bi():i.signal.aborted||Date.now()>=t.expiresAt?yi():e}finally{clearTimeout(o),n?.removeEventListener(`abort`,a)}}};e.AccountInformationApi=Pr,e.AccountInformationApiAxiosParamCreator=jr,e.AccountInformationApiFactory=Mr,e.AccountInformationApiFp=Y,e.AccountInformationApiGenerated=Nr,e.ApiStatusApi=zr,e.ApiStatusApiAxiosParamCreator=Fr,e.ApiStatusApiFactory=Lr,e.ApiStatusApiFp=Ir,e.ApiStatusApiGenerated=Rr,e.AuthenticationApi=Wr,e.AuthenticationApiAxiosParamCreator=Br,e.AuthenticationApiFactory=Hr,e.AuthenticationApiFp=Vr,e.AuthenticationApiGenerated=Ur,e.CommercialApiKeyAuth=fi,e.Configuration=gi,e.ConnectionsApi=Jr,e.ConnectionsApiAxiosParamCreator=Gr,e.ConnectionsApiFactory=Kr,e.ConnectionsApiFp=X,e.ConnectionsApiGenerated=qr,e.ExperimentalEndpointsApi=Qr,e.ExperimentalEndpointsApiAxiosParamCreator=Yr,e.ExperimentalEndpointsApiFactory=Xr,e.ExperimentalEndpointsApiFp=Z,e.ExperimentalEndpointsApiGenerated=Zr,e.ManagementApi=ri,e.ManagementApiAxiosParamCreator=$r,e.ManagementApiFactory=ti,e.ManagementApiFp=ei,e.ManagementApiGenerated=ni,e.OAuthAuth=mi,e.PersonalApiKeyAuth=pi,e.ReferenceDataApi=si,e.ReferenceDataApiAxiosParamCreator=ii,e.ReferenceDataApiFactory=ai,e.ReferenceDataApiFp=Q,e.ReferenceDataApiGenerated=oi,e.Snaptrade=vi,e.SnaptradeAuth=hi,e.SnaptradeError=Tr,e.SnaptradeOAuthDevice=Si,e.TradingApi=di,e.TradingApiAxiosParamCreator=ci,e.TradingApiFactory=li,e.TradingApiFp=$,e.TradingApiGenerated=ui,e.parseIfJson=Dr,e.readableStreamToString=Er});
|