@fuul/sdk 3.4.1 → 4.0.0
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/dist/core.d.ts +34 -12
- package/dist/core.d.ts.map +1 -1
- package/dist/index.mjs +290 -276
- package/dist/index.umd.js +5 -5
- package/dist/payouts/PayoutService.d.ts +5 -3
- package/dist/payouts/PayoutService.d.ts.map +1 -1
- package/dist/types/api.d.ts +43 -13
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(E,b){typeof exports=="object"&&typeof module<"u"?b(exports):typeof define=="function"&&define.amd?define(["exports"],b):(E=typeof globalThis<"u"?globalThis:E||self,b(E.Fuul={}))})(this,function(E){"use strict";var Xn=Object.defineProperty;var Gn=(E,b,D)=>b in E?Xn(E,b,{enumerable:!0,configurable:!0,writable:!0,value:D}):E[b]=D;var A=(E,b,D)=>(Gn(E,typeof b!="symbol"?b+"":b,D),D);function b(e,t){return function(){return e.apply(t,arguments)}}const{toString:D}=Object.prototype,{getPrototypeOf:Z}=Object,z=(e=>t=>{const n=D.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>z(t)===e),V=e=>t=>typeof t===e,{isArray:U}=Array,k=V("undefined");function it(e){return e!==null&&!k(e)&&e.constructor!==null&&!k(e.constructor)&&R(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Re=O("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Re(e.buffer),t}const ct=V("string"),R=V("function"),Ce=V("number"),K=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,J=e=>{if(z(e)!=="object")return!1;const t=Z(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=O("Date"),ft=O("File"),dt=O("Blob"),pt=O("FileList"),ht=e=>K(e)&&R(e.pipe),mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||R(e.append)&&((t=z(e))==="formdata"||t==="object"&&R(e.toString)&&e.toString()==="[object FormData]"))},yt=O("URLSearchParams"),wt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),U(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Oe(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Te=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),Pe=e=>!k(e)&&e!==Te;function ee(){const{caseless:e}=Pe(this)&&this||{},t={},n=(r,s)=>{const i=e&&Oe(t,s)||s;J(t[i])&&J(r)?t[i]=ee(t[i],r):J(r)?t[i]=ee({},r):U(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&$(arguments[r],n);return t}const gt=(e,t,n,{allOwnKeys:r}={})=>($(t,(s,i)=>{n&&R(s)?e[i]=b(s,n):e[i]=s},{allOwnKeys:r}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),St=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},bt=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&Z(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},At=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Rt=e=>{if(!e)return null;if(U(e))return e;let t=e.length;if(!Ce(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Ct=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Z(Uint8Array)),Ot=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Tt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=O("HTMLFormElement"),_t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),_e=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=O("RegExp"),Ne=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},xt=e=>{Ne(e,(t,n)=>{if(R(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(R(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+"'")})}})},Ft=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return U(e)?r(e):r(String(e).split(t)),n},Dt=()=>{},Ut=(e,t)=>(e=+e,Number.isFinite(e)?e:t),te="abcdefghijklmnopqrstuvwxyz",xe="0123456789",Fe={DIGIT:xe,ALPHA:te,ALPHA_DIGIT:te+te.toUpperCase()+xe},Lt=(e=16,t=Fe.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Bt(e){return!!(e&&R(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(r,s)=>{if(K(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=U(r)?[]:{};return $(r,(o,c)=>{const p=n(o,s+1);!k(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},jt=O("AsyncFunction"),a={isArray:U,isArrayBuffer:Re,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Ce,isBoolean:ut,isObject:K,isPlainObject:J,isUndefined:k,isDate:lt,isFile:ft,isBlob:dt,isRegExp:Nt,isFunction:R,isStream:ht,isURLSearchParams:yt,isTypedArray:Ct,isFileList:pt,forEach:$,merge:ee,extend:gt,trim:wt,stripBOM:Et,inherits:St,toFlatObject:bt,kindOf:z,kindOfTest:O,endsWith:At,toArray:Rt,forEachEntry:Ot,matchAll:Tt,isHTMLForm:Pt,hasOwnProperty:_e,hasOwnProp:_e,reduceDescriptors:Ne,freezeMethods:xt,toObjectSet:Ft,toCamelCase:_t,noop:Dt,toFiniteNumber:Ut,findKey:Oe,global:Te,isContextDefined:Pe,ALPHABET:Fe,generateString:Lt,isSpecCompliantForm:Bt,toJSONObject:It,isAsyncFn:jt,isThenable:e=>e&&(K(e)||R(e))&&R(e.then)&&R(e.catch)};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const De=m.prototype,Ue={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ue[e]={value:e}}),Object.defineProperties(m,Ue),Object.defineProperty(De,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,i)=>{const o=Object.create(De);return a.toFlatObject(e,o,function(p){return p!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const kt=null;function ne(e){return a.isPlainObject(e)||a.isArray(e)}function Le(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Be(e,t,n){return e?e.concat(t).map(function(s,i){return s=Le(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function $t(e){return a.isArray(e)&&!e.some(ne)}const qt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function M(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,g){return!a.isUndefined(g[d])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!p&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,d,g){let S=f;if(f&&!g&&typeof f=="object"){if(a.endsWith(d,"{}"))d=r?d:d.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&$t(f)||(a.isFileList(f)||a.endsWith(d,"[]"))&&(S=a.toArray(f)))return d=Le(d),S.forEach(function(F,Wn){!(a.isUndefined(F)||F===null)&&t.append(o===!0?Be([d],Wn,i):o===null?d:d+"[]",h(F))}),!1}return ne(f)?!0:(t.append(Be(g,d,i),h(f)),!1)}const u=[],w=Object.assign(qt,{defaultVisitor:l,convertValue:h,isVisitable:ne});function C(f,d){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));u.push(f),a.forEach(f,function(S,x){(!(a.isUndefined(S)||S===null)&&s.call(t,S,a.isString(x)?x.trim():x,d,w))===!0&&C(S,d?d.concat(x):[x])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return C(e),t}function Ie(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function re(e,t){this._pairs=[],e&&M(e,this,t)}const je=re.prototype;je.append=function(t,n){this._pairs.push([t,n])},je.toString=function(t){const n=t?function(r){return t.call(this,r,Ie)}:Ie;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function Ht(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ke(e,t,n){if(!t)return e;const r=n&&n.encode||Ht,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const $e=vt,qe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:re,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",Vt=(e=>He&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Kt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:Kt},Symbol.toStringTag,{value:"Module"})),...zt};function Jt(e,t){return M(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return T.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Mt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ve(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Wt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Mt(r),s,n,0)}),n}return null}function Xt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const se={transitional:qe,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(ve(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return M(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Xt(t)):t}],transformResponse:[function(t){const n=this.transitional||se.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{se.headers[e]={}});const oe=se,Gt=a.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"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
-
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Gt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},
|
|
3
|
-
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[
|
|
4
|
-
`+i.map(
|
|
5
|
-
`):" "+Me(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:ce};function ue(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new H(null,e)}function Xe(e){return ue(e),e.headers=P.from(e.headers),e.data=ae.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),We.getAdapter(e.adapter||oe.adapter)(e).then(function(r){return ue(e),r.data=ae.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Ve(r)||(ue(e),r&&r.response&&(r.response.data=ae.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const Ge=e=>e instanceof P?e.toJSON():e;function L(e,t){t=t||{};const n={};function r(h,l,u){return a.isPlainObject(h)&&a.isPlainObject(l)?a.merge.call({caseless:u},h,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(h,l,u){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h,u)}else return r(h,l,u)}function i(h,l){if(!a.isUndefined(l))return r(void 0,l)}function o(h,l){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function c(h,l,u){if(u in t)return r(h,l);if(u in e)return r(void 0,h)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage: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,responseEncoding:o,validateStatus:c,headers:(h,l)=>s(Ge(h),Ge(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=p[l]||s,w=u(e[l],t[l],l);a.isUndefined(w)&&u!==c||(n[l]=w)}),n}const Qe="1.6.3",le={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{le[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ye={};le.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Qe+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ye[o]&&(Ye[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function fn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new m("option "+i+" must be "+p,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const fe={assertOptions:fn,validators:le},N=fe.validators;let G=class{constructor(t){this.defaults=t,this.interceptors={request:new $e,response:new $e}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=L(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&fe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:fe.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=P.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(p=p&&d.synchronous,c.unshift(d.fulfilled,d.rejected))});const h=[];this.interceptors.response.forEach(function(d){h.push(d.fulfilled,d.rejected)});let l,u=0,w;if(!p){const f=[Xe.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,h),w=f.length,l=Promise.resolve(n);u<w;)l=l.then(f[u++],f[u++]);return l}w=c.length;let C=n;for(u=0;u<w;){const f=c[u++],d=c[u++];try{C=f(C)}catch(g){d.call(this,g);break}}try{l=Xe.call(this,C)}catch(f){return Promise.reject(f)}for(u=0,w=h.length;u<w;)l=l.then(h[u++],h[u++]);return l}getUri(t){t=L(this.defaults,t);const n=Ke(t.baseURL,t.url);return ke(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){G.prototype[t]=function(n,r){return this.request(L(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(L(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}G.prototype[t]=n(),G.prototype[t+"Form"]=n(!0)});const Q=G,dn=class ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new H(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ot(function(s){t=s}),cancel:t}}};function pn(e){return function(n){return e.apply(null,n)}}function hn(e){return a.isObject(e)&&e.isAxiosError===!0}const de={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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};Object.entries(de).forEach(([e,t])=>{de[t]=e});const mn=de;function Ze(e){const t=new Q(e),n=b(Q.prototype.request,t);return a.extend(n,Q.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return Ze(L(e,s))},n}const y=Ze(oe);y.Axios=Q,y.CanceledError=H,y.CancelToken=dn,y.isCancel=Ve,y.VERSION=Qe,y.toFormData=M,y.AxiosError=m,y.Cancel=y.CanceledError,y.all=function(t){return Promise.all(t)},y.spread=pn,y.isAxiosError=hn,y.mergeConfig=L,y.AxiosHeaders=P,y.formToJSON=e=>ve(a.isHTMLForm(e)?new FormData(e):e),y.getAdapter=We.getAdapter,y.HttpStatusCode=mn,y.default=y;const et=y,{Axios:or,AxiosError:pe,CanceledError:ir,isCancel:ar,CancelToken:cr,VERSION:ur,all:lr,Cancel:fr,isAxiosError:dr,spread:pr,toFormData:hr,AxiosHeaders:mr,HttpStatusCode:yr,formToJSON:wr,getAdapter:gr,mergeConfig:Er}=et;class he extends Error{constructor(n){super(n.join(", "));A(this,"errors");this.name="ValidationError",this.errors=n}}class me extends Error{constructor(n){super("Address already registered.");A(this,"address");this.name="AddressInUseError",this.address=n}}class ye extends Error{constructor(n){super("Code already registered.");A(this,"code");this.name="CodeInUseError",this.code=n}}class we extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class yn{constructor(t){A(this,"httpClient");A(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r){var s;try{await this.httpClient.post("/affiliates",{address:t,name:n,code:n,signature:r})}catch(i){if(i instanceof pe){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new we:c=="address in use"?new me(t):c=="code in use"?new ye(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new he(o.message)}throw i}}async update(t,n,r){var s;try{await this.httpClient.post(`/affiliates/${t}`,{code:n,address:t,signature:r})}catch(i){if(i instanceof pe){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new we:c=="address in use"?new me(t):c=="code in use"?new ye(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new he(o.message)}throw i}}async isCodeFree(t){var n;try{return await this.httpClient.get(`/affiliates/codes/${t}`),!1}catch(r){return r instanceof pe&&((n=r.response)==null?void 0:n.status)===404?!0:(console.error("Fuul SDK: Could not check affiliate code",r),!1)}}async getCode(t){try{return(await this.httpClient.get(`/affiliates/${t}`)).data.code}catch(n){return console.error("Fuul SDK: Could not get affiliate code",n),null}}}class wn{constructor(t){A(this,"httpClient");this.httpClient=t.httpClient}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}const tt="fuul.sent",gn=60;class En{constructor(t){A(this,"debug");A(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}await this.httpClient.post("events",t),this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){const n=`${tt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>gn)return!1;let p=!1;t.metadata&&(p=s.metadata.tracking_id===t.metadata.tracking_id&&s.metadata.project_id===t.metadata.project_id&&s.metadata.referrer===t.metadata.referrer&&s.metadata.source===t.metadata.source&&s.metadata.category===t.metadata.category&&s.metadata.title===t.metadata.title&&s.metadata.tag===t.metadata.tag&&s.user_address===t.user_address&&s.signature===t.signature&&s.signature_message===t.signature_message);let h=!1;return t.args&&s.args&&(h=s.args.page===t.args.page),h&&p}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){const n=`${tt}_${t.name}`,r=this.getCurrentTimestamp(),s={...t,timestamp:r};localStorage.setItem(n,JSON.stringify(s))}}const Sn={version:"3.4.1"};class bn{constructor(t){A(this,"client");A(this,"queryParams");this.client=et.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":Sn.version}}),this.queryParams=t.queryParams?this.buildQueryParams(t.queryParams):""}buildQueryParams(t){let n="";return Object.keys(t).forEach(r=>{n=n===""?n+`?${r}=${t[r]}`:n+`&${r}=${t[r]}`}),n}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}}const nt="/payouts";class An{constructor(t){A(this,"httpClient");A(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getProjectPayoutsLeaderboard(t){return(await this.httpClient.get(`${nt}/leaderboard`,t)).data}async getUserPayouts(t){return(await this.httpClient.get(nt,t)).data}}let Rn=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Cn="fuul.tracking_id",ge=()=>xn(Cn,()=>Rn()),rt=()=>B("af")||B("referrer"),On=()=>document.referrer,Tn=()=>Fn(),Pn=()=>B("category"),_n=()=>B("title"),Nn=()=>B("tag"),xn=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},B=e=>new URLSearchParams(window.location.search).get(e),Fn=()=>{const e=B("source");if(e)return e},Dn="https://api.fuul.xyz/api/v1/";let I=!1,Ee=!1,Se,v,st,j,Y,be;function Un(e){I=!!e.debug,!Ee&&(Se=e.apiKey,Kn(),v=Jn(e.baseApiUrl??Dn,e.defaultQueryParams??{}),st=new wn({httpClient:v,debug:I}),Y=new En({httpClient:v,debug:I}),j=new yn({httpClient:v,debug:I}),be=new An({httpClient:v,debug:I}),Ee=!0,I&&console.debug("Fuul SDK: init() complete"))}function _(){if(!Ee)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Ln(e,t){_(),Ae();const n={name:e,args:t??{},metadata:{tracking_id:ge()}};await Y.sendEvent(n)}async function Bn(e){_(),Ae();const t={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:ge(),referrer_url:On(),source:Tn(),affiliate_id:rt()??void 0,referrer:rt()??void 0,category:Pn()??void 0,title:_n()??void 0,tag:Nn()??void 0}};await Y.sendEvent(t)}async function In(e){_(),Ae();const t={name:"connect_wallet",args:{},metadata:{tracking_id:ge()}};e!=null&&e.address&&(t.user_address=e.address),e!=null&&e.signature&&(t.signature=e==null?void 0:e.signature,t.signature_message=e==null?void 0:e.message),await Y.sendEvent(t)}async function jn(e,t,n){_(),await j.create(e,t,n)}async function kn(e,t,n){_(),await j.update(e,t,n)}async function $n(e){return _(),await j.getCode(e)}async function qn(e){return _(),await j.isCodeFree(e)}async function Hn(e,t,n){_();const r=await j.getCode(t),s=new URLSearchParams({af:r??t});return n!=null&&n.title&&s.append("af_title",n.title),n!=null&&n.format&&s.append("af_format",n.format),n!=null&&n.place&&s.append("af_place",n.place),`${e}?${s.toString()}`}function vn(e){return be.getProjectPayoutsLeaderboard(e)}function zn(e){return be.getUserPayouts(e)}async function Vn(){return _(),st.getAll()}function Ae(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Kn(){if(!Se)throw new Error("Fuul SDK: Invalid API key")}function Jn(e,t){return new bn({baseURL:e,timeout:1e4,apiKey:Se,queryParams:t})}const Mn={init:Un,sendEvent:Ln,sendPageview:Bn,sendConnectWallet:In,generateTrackingLink:Hn,getConversions:Vn,createAffiliateCode:jn,updateAffiliateCode:kn,getAffiliateCode:$n,isAffiliateCodeFree:qn,getUserPayouts:zn,getProjectPayoutsLeaderboard:vn};E.AddressInUseError=me,E.CodeInUseError=ye,E.Fuul=Mn,E.InvalidSignatureError=we,E.ValidationError=he,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(E,S){typeof exports=="object"&&typeof module<"u"?S(exports):typeof define=="function"&&define.amd?define(["exports"],S):(E=typeof globalThis<"u"?globalThis:E||self,S(E.Fuul={}))})(this,function(E){"use strict";var Qn=Object.defineProperty;var Yn=(E,S,U)=>S in E?Qn(E,S,{enumerable:!0,configurable:!0,writable:!0,value:U}):E[S]=U;var C=(E,S,U)=>(Yn(E,typeof S!="symbol"?S+"":S,U),U);function S(e,t){return function(){return e.apply(t,arguments)}}const{toString:U}=Object.prototype,{getPrototypeOf:te}=Object,V=(e=>t=>{const n=U.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),O=e=>(e=e.toLowerCase(),t=>V(t)===e),K=e=>t=>typeof t===e,{isArray:D}=Array,k=K("undefined");function it(e){return e!==null&&!k(e)&&e.constructor!==null&&!k(e.constructor)&&A(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Re=O("ArrayBuffer");function at(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Re(e.buffer),t}const ct=K("string"),A=K("function"),Oe=K("number"),J=e=>e!==null&&typeof e=="object",ut=e=>e===!0||e===!1,M=e=>{if(V(e)!=="object")return!1;const t=te(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},lt=O("Date"),ft=O("File"),dt=O("Blob"),pt=O("FileList"),ht=e=>J(e)&&A(e.pipe),mt=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||A(e.append)&&((t=V(e))==="formdata"||t==="object"&&A(e.toString)&&e.toString()==="[object FormData]"))},yt=O("URLSearchParams"),gt=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),D(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let c;for(r=0;r<o;r++)c=i[r],t.call(null,e[c],c,e)}}function Te(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Pe=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),_e=e=>!k(e)&&e!==Pe;function ne(){const{caseless:e}=_e(this)&&this||{},t={},n=(r,s)=>{const i=e&&Te(t,s)||s;M(t[i])&&M(r)?t[i]=ne(t[i],r):M(r)?t[i]=ne({},r):D(r)?t[i]=r.slice():t[i]=r};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&$(arguments[r],n);return t}const wt=(e,t,n,{allOwnKeys:r}={})=>($(t,(s,i)=>{n&&A(s)?e[i]=S(s,n):e[i]=s},{allOwnKeys:r}),e),Et=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},St=(e,t,n,r)=>{let s,i,o;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),i=s.length;i-- >0;)o=s[i],(!r||r(o,e,t))&&!c[o]&&(t[o]=e[o],c[o]=!0);e=n!==!1&&te(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ct=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},At=e=>{if(!e)return null;if(D(e))return e;let t=e.length;if(!Oe(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Rt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&te(Uint8Array)),Ot=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let s;for(;(s=r.next())&&!s.done;){const i=s.value;t.call(e,i[0],i[1])}},Tt=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Pt=O("HTMLFormElement"),_t=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),Ne=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Nt=O("RegExp"),xe=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$(n,(s,i)=>{let o;(o=t(s,i,e))!==!1&&(r[i]=o||s)}),Object.defineProperties(e,r)},xt=e=>{xe(e,(t,n)=>{if(A(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(A(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+"'")})}})},Ft=(e,t)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return D(e)?r(e):r(String(e).split(t)),n},Ut=()=>{},Dt=(e,t)=>(e=+e,Number.isFinite(e)?e:t),re="abcdefghijklmnopqrstuvwxyz",Fe="0123456789",Ue={DIGIT:Fe,ALPHA:re,ALPHA_DIGIT:re+re.toUpperCase()+Fe},Lt=(e=16,t=Ue.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Bt(e){return!!(e&&A(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const It=e=>{const t=new Array(10),n=(r,s)=>{if(J(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[s]=r;const i=D(r)?[]:{};return $(r,(o,c)=>{const p=n(o,s+1);!k(p)&&(i[c]=p)}),t[s]=void 0,i}}return r};return n(e,0)},jt=O("AsyncFunction"),a={isArray:D,isArrayBuffer:Re,isBuffer:it,isFormData:mt,isArrayBufferView:at,isString:ct,isNumber:Oe,isBoolean:ut,isObject:J,isPlainObject:M,isUndefined:k,isDate:lt,isFile:ft,isBlob:dt,isRegExp:Nt,isFunction:A,isStream:ht,isURLSearchParams:yt,isTypedArray:Rt,isFileList:pt,forEach:$,merge:ne,extend:wt,trim:gt,stripBOM:Et,inherits:bt,toFlatObject:St,kindOf:V,kindOfTest:O,endsWith:Ct,toArray:At,forEachEntry:Ot,matchAll:Tt,isHTMLForm:Pt,hasOwnProperty:Ne,hasOwnProp:Ne,reduceDescriptors:xe,freezeMethods:xt,toObjectSet:Ft,toCamelCase:_t,noop:Ut,toFiniteNumber:Dt,findKey:Te,global:Pe,isContextDefined:_e,ALPHABET:Ue,generateString:Lt,isSpecCompliantForm:Bt,toJSONObject:It,isAsyncFn:jt,isThenable:e=>e&&(J(e)||A(e))&&A(e.then)&&A(e.catch)};function m(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s)}a.inherits(m,Error,{toJSON:function(){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:a.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const De=m.prototype,Le={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Le[e]={value:e}}),Object.defineProperties(m,Le),Object.defineProperty(De,"isAxiosError",{value:!0}),m.from=(e,t,n,r,s,i)=>{const o=Object.create(De);return a.toFlatObject(e,o,function(p){return p!==Error.prototype},c=>c!=="isAxiosError"),m.call(o,e.message,t,n,r,s),o.cause=e,o.name=e.name,i&&Object.assign(o,i),o};const kt=null;function se(e){return a.isPlainObject(e)||a.isArray(e)}function Be(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Ie(e,t,n){return e?e.concat(t).map(function(s,i){return s=Be(s),!n&&i?"["+s+"]":s}).join(n?".":""):t}function $t(e){return a.isArray(e)&&!e.some(se)}const qt=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function W(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(d,w){return!a.isUndefined(w[d])});const r=n.metaTokens,s=n.visitor||l,i=n.dots,o=n.indexes,p=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function h(f){if(f===null)return"";if(a.isDate(f))return f.toISOString();if(!p&&a.isBlob(f))throw new m("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(f)||a.isTypedArray(f)?p&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function l(f,d,w){let b=f;if(f&&!w&&typeof f=="object"){if(a.endsWith(d,"{}"))d=r?d:d.slice(0,-2),f=JSON.stringify(f);else if(a.isArray(f)&&$t(f)||(a.isFileList(f)||a.endsWith(d,"[]"))&&(b=a.toArray(f)))return d=Be(d),b.forEach(function(F,Gn){!(a.isUndefined(F)||F===null)&&t.append(o===!0?Ie([d],Gn,i):o===null?d:d+"[]",h(F))}),!1}return se(f)?!0:(t.append(Ie(w,d,i),h(f)),!1)}const u=[],g=Object.assign(qt,{defaultVisitor:l,convertValue:h,isVisitable:se});function R(f,d){if(!a.isUndefined(f)){if(u.indexOf(f)!==-1)throw Error("Circular reference detected in "+d.join("."));u.push(f),a.forEach(f,function(b,x){(!(a.isUndefined(b)||b===null)&&s.call(t,b,a.isString(x)?x.trim():x,d,g))===!0&&R(b,d?d.concat(x):[x])}),u.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return R(e),t}function je(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oe(e,t){this._pairs=[],e&&W(e,this,t)}const ke=oe.prototype;ke.append=function(t,n){this._pairs.push([t,n])},ke.toString=function(t){const n=t?function(r){return t.call(this,r,je)}:je;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function vt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $e(e,t,n){if(!t)return e;const r=n&&n.encode||vt,s=n&&n.serialize;let i;if(s?i=s(t,n):i=a.isURLSearchParams(t)?t.toString():new oe(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class Ht{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const qe=Ht,ve={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zt={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oe,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},He=typeof window<"u"&&typeof document<"u",Vt=(e=>He&&["ReactNative","NativeScript","NS"].indexOf(e)<0)(typeof navigator<"u"&&navigator.product),Kt=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),T={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:He,hasStandardBrowserEnv:Vt,hasStandardBrowserWebWorkerEnv:Kt},Symbol.toStringTag,{value:"Module"})),...zt};function Jt(e,t){return W(e,new T.classes.URLSearchParams,Object.assign({visitor:function(n,r,s,i){return T.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function Mt(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Wt(e){const t={},n=Object.keys(e);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],t[i]=e[i];return t}function ze(e){function t(n,r,s,i){let o=n[i++];const c=Number.isFinite(+o),p=i>=n.length;return o=!o&&a.isArray(s)?s.length:o,p?(a.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!c):((!s[o]||!a.isObject(s[o]))&&(s[o]=[]),t(n,r,s[o],i)&&a.isArray(s[o])&&(s[o]=Wt(s[o])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(Mt(r),s,n,0)}),n}return null}function Xt(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const ie={transitional:ve,adapter:["xhr","http"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=a.isObject(t);if(i&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s&&s?JSON.stringify(ze(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Jt(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return W(c?{"files[]":t}:t,p&&new p,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),Xt(t)):t}],transformResponse:[function(t){const n=this.transitional||ie.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(t&&a.isString(t)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t)}catch(c){if(o)throw c.name==="SyntaxError"?m.from(c,m.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:T.classes.FormData,Blob:T.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{ie.headers[e]={}});const ae=ie,Gt=a.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"]),Qt=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||t[n]&&Gt[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Ve=Symbol("internals");function q(e){return e&&String(e).trim().toLowerCase()}function X(e){return e===!1||e==null?e:a.isArray(e)?e.map(X):String(e)}function Yt(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Zt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ce(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function en(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function tn(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,i,o){return this[r].call(this,t,s,i,o)},configurable:!0})})}let G=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function i(c,p,h){const l=q(p);if(!l)throw new Error("header name must be a non-empty string");const u=a.findKey(s,l);(!u||s[u]===void 0||h===!0||h===void 0&&s[u]!==!1)&&(s[u||p]=X(c))}const o=(c,p)=>a.forEach(c,(h,l)=>i(h,l,p));return a.isPlainObject(t)||t instanceof this.constructor?o(t,n):a.isString(t)&&(t=t.trim())&&!Zt(t)?o(Qt(t),n):t!=null&&i(n,t,r),this}get(t,n){if(t=q(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Yt(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=q(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ce(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function i(o){if(o=q(o),o){const c=a.findKey(r,o);c&&(!n||ce(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(i):i(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!t||ce(this,this[i],i,t,!0))&&(delete this[i],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,i)=>{const o=a.findKey(r,i);if(o){n[o]=X(s),delete n[i];return}const c=t?en(i):String(i).trim();c!==i&&delete n[i],n[c]=X(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Ve]=this[Ve]={accessors:{}}).accessors,s=this.prototype;function i(o){const c=q(o);r[c]||(tn(s,o),r[c]=!0)}return a.isArray(t)?t.forEach(i):i(t),this}};G.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),a.reduceDescriptors(G.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),a.freezeMethods(G);const P=G;function ue(e,t){const n=this||ae,r=t||n,s=P.from(r.headers);let i=r.data;return a.forEach(e,function(c){i=c.call(n,i,s.normalize(),t?t.status:void 0)}),s.normalize(),i}function Ke(e){return!!(e&&e.__CANCEL__)}function v(e,t,n){m.call(this,e??"canceled",m.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(v,m,{__CANCEL__:!0});function nn(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new m("Request failed with status code "+n.status,[m.ERR_BAD_REQUEST,m.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const rn=T.hasStandardBrowserEnv?{write(e,t,n,r,s,i){const o=[e+"="+encodeURIComponent(t)];a.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),a.isString(r)&&o.push("path="+r),a.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function sn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function on(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Je(e,t){return e&&!sn(t)?on(e,t):t}const an=T.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function s(i){let o=i;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=s(window.location.href),function(o){const c=a.isString(o)?s(o):o;return c.protocol===r.protocol&&c.host===r.host}}():function(){return function(){return!0}}();function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function un(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,i=0,o;return t=t!==void 0?t:1e3,function(p){const h=Date.now(),l=r[i];o||(o=h),n[s]=p,r[s]=h;let u=i,g=0;for(;u!==s;)g+=n[u++],u=u%e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),h-o<t)return;const R=l&&h-l;return R?Math.round(g*1e3/R):void 0}}function Me(e,t){let n=0;const r=un(50,250);return s=>{const i=s.loaded,o=s.lengthComputable?s.total:void 0,c=i-n,p=r(c),h=i<=o;n=i;const l={loaded:i,total:o,progress:o?i/o:void 0,bytes:c,rate:p||void 0,estimated:p&&o&&h?(o-i)/p:void 0,event:s};l[t?"download":"upload"]=!0,e(l)}}const le={http:kt,xhr:typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){let s=e.data;const i=P.from(e.headers).normalize();let{responseType:o,withXSRFToken:c}=e,p;function h(){e.cancelToken&&e.cancelToken.unsubscribe(p),e.signal&&e.signal.removeEventListener("abort",p)}let l;if(a.isFormData(s)){if(T.hasStandardBrowserEnv||T.hasStandardBrowserWebWorkerEnv)i.setContentType(!1);else if((l=i.getContentType())!==!1){const[d,...w]=l?l.split(";").map(b=>b.trim()).filter(Boolean):[];i.setContentType([d||"multipart/form-data",...w].join("; "))}}let u=new XMLHttpRequest;if(e.auth){const d=e.auth.username||"",w=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(d+":"+w))}const g=Je(e.baseURL,e.url);u.open(e.method.toUpperCase(),$e(g,e.params,e.paramsSerializer),!0),u.timeout=e.timeout;function R(){if(!u)return;const d=P.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders()),b={data:!o||o==="text"||o==="json"?u.responseText:u.response,status:u.status,statusText:u.statusText,headers:d,config:e,request:u};nn(function(F){n(F),h()},function(F){r(F),h()},b),u=null}if("onloadend"in u?u.onloadend=R:u.onreadystatechange=function(){!u||u.readyState!==4||u.status===0&&!(u.responseURL&&u.responseURL.indexOf("file:")===0)||setTimeout(R)},u.onabort=function(){u&&(r(new m("Request aborted",m.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new m("Network Error",m.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let w=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const b=e.transitional||ve;e.timeoutErrorMessage&&(w=e.timeoutErrorMessage),r(new m(w,b.clarifyTimeoutError?m.ETIMEDOUT:m.ECONNABORTED,e,u)),u=null},T.hasStandardBrowserEnv&&(c&&a.isFunction(c)&&(c=c(e)),c||c!==!1&&an(g))){const d=e.xsrfHeaderName&&e.xsrfCookieName&&rn.read(e.xsrfCookieName);d&&i.set(e.xsrfHeaderName,d)}s===void 0&&i.setContentType(null),"setRequestHeader"in u&&a.forEach(i.toJSON(),function(w,b){u.setRequestHeader(b,w)}),a.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),o&&o!=="json"&&(u.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&u.addEventListener("progress",Me(e.onDownloadProgress,!0)),typeof e.onUploadProgress=="function"&&u.upload&&u.upload.addEventListener("progress",Me(e.onUploadProgress)),(e.cancelToken||e.signal)&&(p=d=>{u&&(r(!d||d.type?new v(null,e,u):d),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(p),e.signal&&(e.signal.aborted?p():e.signal.addEventListener("abort",p)));const f=cn(g);if(f&&T.protocols.indexOf(f)===-1){r(new m("Unsupported protocol "+f+":",m.ERR_BAD_REQUEST,e));return}u.send(s||null)})}};a.forEach(le,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const We=e=>`- ${e}`,ln=e=>a.isFunction(e)||e===null||e===!1,Xe={getAdapter:e=>{e=a.isArray(e)?e:[e];const{length:t}=e;let n,r;const s={};for(let i=0;i<t;i++){n=e[i];let o;if(r=n,!ln(n)&&(r=le[(o=String(n)).toLowerCase()],r===void 0))throw new m(`Unknown adapter '${o}'`);if(r)break;s[o||"#"+i]=r}if(!r){const i=Object.entries(s).map(([c,p])=>`adapter ${c} `+(p===!1?"is not supported by the environment":"is not available in the build"));let o=t?i.length>1?`since :
|
|
4
|
+
`+i.map(We).join(`
|
|
5
|
+
`):" "+We(i[0]):"as no adapter specified";throw new m("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:le};function fe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new v(null,e)}function Ge(e){return fe(e),e.headers=P.from(e.headers),e.data=ue.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xe.getAdapter(e.adapter||ae.adapter)(e).then(function(r){return fe(e),r.data=ue.call(e,e.transformResponse,r),r.headers=P.from(r.headers),r},function(r){return Ke(r)||(fe(e),r&&r.response&&(r.response.data=ue.call(e,e.transformResponse,r.response),r.response.headers=P.from(r.response.headers))),Promise.reject(r)})}const Qe=e=>e instanceof P?e.toJSON():e;function L(e,t){t=t||{};const n={};function r(h,l,u){return a.isPlainObject(h)&&a.isPlainObject(l)?a.merge.call({caseless:u},h,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(h,l,u){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h,u)}else return r(h,l,u)}function i(h,l){if(!a.isUndefined(l))return r(void 0,l)}function o(h,l){if(a.isUndefined(l)){if(!a.isUndefined(h))return r(void 0,h)}else return r(void 0,l)}function c(h,l,u){if(u in t)return r(h,l);if(u in e)return r(void 0,h)}const p={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage: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,responseEncoding:o,validateStatus:c,headers:(h,l)=>s(Qe(h),Qe(l),!0)};return a.forEach(Object.keys(Object.assign({},e,t)),function(l){const u=p[l]||s,g=u(e[l],t[l],l);a.isUndefined(g)&&u!==c||(n[l]=g)}),n}const Ye="1.6.3",de={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{de[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ze={};de.transitional=function(t,n,r){function s(i,o){return"[Axios v"+Ye+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,c)=>{if(t===!1)throw new m(s(o," has been removed"+(n?" in "+n:"")),m.ERR_DEPRECATED);return n&&!Ze[o]&&(Ze[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,c):!0}};function fn(e,t,n){if(typeof e!="object")throw new m("options must be an object",m.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const i=r[s],o=t[i];if(o){const c=e[i],p=c===void 0||o(c,i,e);if(p!==!0)throw new m("option "+i+" must be "+p,m.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new m("Unknown option "+i,m.ERR_BAD_OPTION)}}const pe={assertOptions:fn,validators:de},N=pe.validators;let Q=class{constructor(t){this.defaults=t,this.interceptors={request:new qe,response:new qe}}request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=L(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&pe.assertOptions(r,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:pe.assertOptions(s,{encode:N.function,serialize:N.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&a.merge(i.common,i[n.method]);i&&a.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),n.headers=P.concat(o,i);const c=[];let p=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(n)===!1||(p=p&&d.synchronous,c.unshift(d.fulfilled,d.rejected))});const h=[];this.interceptors.response.forEach(function(d){h.push(d.fulfilled,d.rejected)});let l,u=0,g;if(!p){const f=[Ge.bind(this),void 0];for(f.unshift.apply(f,c),f.push.apply(f,h),g=f.length,l=Promise.resolve(n);u<g;)l=l.then(f[u++],f[u++]);return l}g=c.length;let R=n;for(u=0;u<g;){const f=c[u++],d=c[u++];try{R=f(R)}catch(w){d.call(this,w);break}}try{l=Ge.call(this,R)}catch(f){return Promise.reject(f)}for(u=0,g=h.length;u<g;)l=l.then(h[u++],h[u++]);return l}getUri(t){t=L(this.defaults,t);const n=Je(t.baseURL,t.url);return $e(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){Q.prototype[t]=function(n,r){return this.request(L(r||{},{method:t,url:n,data:(r||{}).data}))}}),a.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,c){return this.request(L(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Q.prototype[t]=n(),Q.prototype[t+"Form"]=n(!0)});const Y=Q,dn=class ot{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(c=>{r.subscribe(c),i=c}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,c){r.reason||(r.reason=new v(i,o,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ot(function(s){t=s}),cancel:t}}};function pn(e){return function(n){return e.apply(null,n)}}function hn(e){return a.isObject(e)&&e.isAxiosError===!0}const he={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,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity: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};Object.entries(he).forEach(([e,t])=>{he[t]=e});const mn=he;function et(e){const t=new Y(e),n=S(Y.prototype.request,t);return a.extend(n,Y.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return et(L(e,s))},n}const y=et(ae);y.Axios=Y,y.CanceledError=v,y.CancelToken=dn,y.isCancel=Ke,y.VERSION=Ye,y.toFormData=W,y.AxiosError=m,y.Cancel=y.CanceledError,y.all=function(t){return Promise.all(t)},y.spread=pn,y.isAxiosError=hn,y.mergeConfig=L,y.AxiosHeaders=P,y.formToJSON=e=>ze(a.isHTMLForm(e)?new FormData(e):e),y.getAdapter=Xe.getAdapter,y.HttpStatusCode=mn,y.default=y;const tt=y,{Axios:ar,AxiosError:me,CanceledError:cr,isCancel:ur,CancelToken:lr,VERSION:fr,all:dr,Cancel:pr,isAxiosError:hr,spread:mr,toFormData:yr,AxiosHeaders:gr,HttpStatusCode:wr,formToJSON:Er,getAdapter:br,mergeConfig:Sr}=tt;class ye extends Error{constructor(n){super(n.join(", "));C(this,"errors");this.name="ValidationError",this.errors=n}}class ge extends Error{constructor(n){super("Address already registered.");C(this,"address");this.name="AddressInUseError",this.address=n}}class we extends Error{constructor(n){super("Code already registered.");C(this,"code");this.name="CodeInUseError",this.code=n}}class Ee extends Error{constructor(){super("Invalid signature provided"),this.name="InvalidSignatureError"}}class yn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async create(t,n,r){var s;try{await this.httpClient.post("/affiliates",{address:t,name:n,code:n,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async update(t,n,r){var s;try{await this.httpClient.post(`/affiliates/${t}`,{code:n,address:t,signature:r})}catch(i){if(i instanceof me){const o=(s=i.response)==null?void 0:s.data;if(typeof(o==null?void 0:o.message)=="string"){const c=o.message.toLowerCase();throw c=="invalid signature"?new Ee:c=="address in use"?new ge(t):c=="code in use"?new we(n):new Error(c)}else if((o==null?void 0:o.message)instanceof Array)throw new ye(o.message)}throw i}}async isCodeFree(t){var n;try{return await this.httpClient.get(`/affiliates/codes/${t}`),!1}catch(r){return r instanceof me&&((n=r.response)==null?void 0:n.status)===404?!0:(console.error("Fuul SDK: Could not check affiliate code",r),!1)}}async getCode(t){try{return(await this.httpClient.get(`/affiliates/${t}`)).data.code}catch(n){return console.error("Fuul SDK: Could not get affiliate code",n),null}}}class gn{constructor(t){C(this,"httpClient");this.httpClient=t.httpClient}async getAll(){const{data:t}=await this.httpClient.get("conversions");return t}}const nt="fuul.sent",wn=60;class En{constructor(t){C(this,"debug");C(this,"httpClient");this.httpClient=t.httpClient,this.debug=!!t.debug}async sendEvent(t){if(this.isDuplicate(t)){this.debug&&console.debug("Fuul SDK: Event is considered duplicate and will not be sent");return}await this.httpClient.post("events",t),this.debug&&console.debug(`Fuul SDK: Sent '${t.name}' event`),this.saveSentEvent(t)}isDuplicate(t){const n=`${nt}_${t.name}`,r=localStorage.getItem(n);if(!r)return!1;const s=JSON.parse(r);if(this.getCurrentTimestamp()-s.timestamp>wn)return!1;let p=!1;t.metadata&&(p=s.metadata.tracking_id===t.metadata.tracking_id&&s.metadata.project_id===t.metadata.project_id&&s.metadata.referrer===t.metadata.referrer&&s.metadata.source===t.metadata.source&&s.metadata.category===t.metadata.category&&s.metadata.title===t.metadata.title&&s.metadata.tag===t.metadata.tag&&s.user_address===t.user_address&&s.signature===t.signature&&s.signature_message===t.signature_message);let h=!1;return t.args&&s.args&&(h=s.args.page===t.args.page),h&&p}getCurrentTimestamp(){return Date.now()/1e3}saveSentEvent(t){const n=`${nt}_${t.name}`,r=this.getCurrentTimestamp(),s={...t,timestamp:r};localStorage.setItem(n,JSON.stringify(s))}}const bn={version:"4.0.0"};class Sn{constructor(t){C(this,"client");C(this,"queryParams");this.client=tt.create({...t,headers:{Authorization:`Bearer ${t.apiKey}`,"X-Fuul-Sdk-Version":bn.version}}),this.queryParams=t.queryParams?this.buildQueryParams(t.queryParams):""}buildQueryParams(t){let n="";return Object.keys(t).forEach(r=>{n=n===""?n+`?${r}=${t[r]}`:n+`&${r}=${t[r]}`}),n}async get(t,n){return this.client.get(t+this.queryParams,{params:n})}async post(t,n){return this.client.post(t+this.queryParams,n)}async put(t,n){return this.client.put(t+this.queryParams,n)}async delete(t){return this.client.delete(t+this.queryParams)}}const Z="/payouts";class Cn{constructor(t){C(this,"httpClient");C(this,"_debug");this.httpClient=t.httpClient,this._debug=t.debug}async getPayoutsLeaderboard(t){return(await this.httpClient.get(`${Z}/leaderboard`,t)).data}async getPointsLeaderboard(t){return(await this.httpClient.get(`${Z}/leaderboard`,t)).data}async getUserPayoutsByConversion(t){return(await this.httpClient.get(Z,{...t,type:"onchain-currency"})).data}async getUserPointsByConversion(t){return(await this.httpClient.get(Z,{...t,type:"point"})).data}}let An=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,n)=>(n&=63,n<36?t+=n.toString(36):n<62?t+=(n-26).toString(36).toUpperCase():n>62?t+="-":t+="_",t),"");const Rn="fuul.tracking_id",be=()=>xn(Rn,()=>An()),rt=()=>B("af")||B("referrer"),On=()=>document.referrer,Tn=()=>Fn(),Pn=()=>B("category"),_n=()=>B("title"),Nn=()=>B("tag"),xn=(e,t)=>{const n=localStorage.getItem(e);if(n)return n;{const r=t();return r?localStorage.setItem(e,r):localStorage.removeItem(e),r}},B=e=>new URLSearchParams(window.location.search).get(e),Fn=()=>{const e=B("source");if(e)return e},Un="https://api.fuul.xyz/api/v1/";let I=!1,Se=!1,Ce,H,st,j,ee,z;function Dn(e){I=!!e.debug,!Se&&(Ce=e.apiKey,Mn(),H=Wn(e.baseApiUrl??Un,e.defaultQueryParams??{}),st=new gn({httpClient:H,debug:I}),ee=new En({httpClient:H,debug:I}),j=new yn({httpClient:H,debug:I}),z=new Cn({httpClient:H,debug:I}),Se=!0,I&&console.debug("Fuul SDK: init() complete"))}function _(){if(!Se)throw new Error("Fuul SDK: You need to call init() to initialize the library before using any methods")}async function Ln(e,t){_(),Ae();const n={name:e,args:t??{},metadata:{tracking_id:be()}};await ee.sendEvent(n)}async function Bn(e){_(),Ae();const t={name:"pageview",args:{page:e??document.location.pathname,locationOrigin:document.location.origin},metadata:{tracking_id:be(),referrer_url:On(),source:Tn(),affiliate_id:rt()??void 0,referrer:rt()??void 0,category:Pn()??void 0,title:_n()??void 0,tag:Nn()??void 0}};await ee.sendEvent(t)}async function In(e){_(),Ae();const t={name:"connect_wallet",args:{},metadata:{tracking_id:be()}};e!=null&&e.address&&(t.user_address=e.address),e!=null&&e.signature&&(t.signature=e==null?void 0:e.signature,t.signature_message=e==null?void 0:e.message),await ee.sendEvent(t)}async function jn(e,t,n){_(),await j.create(e,t,n)}async function kn(e,t,n){_(),await j.update(e,t,n)}async function $n(e){return _(),await j.getCode(e)}async function qn(e){return _(),await j.isCodeFree(e)}async function vn(e,t,n){_();const r=await j.getCode(t),s=new URLSearchParams({af:r??t});return n!=null&&n.title&&s.append("af_title",n.title),n!=null&&n.format&&s.append("af_format",n.format),n!=null&&n.place&&s.append("af_place",n.place),`${e}?${s.toString()}`}function Hn(e){return z.getPayoutsLeaderboard(e)}function zn(e){return z.getPointsLeaderboard(e)}function Vn(e){return z.getUserPayoutsByConversion(e)}function Kn(e){return z.getUserPointsByConversion(e)}async function Jn(){return _(),st.getAll()}function Ae(){if(typeof window>"u"||typeof document>"u")throw new Error("Fuul SDK: Browser context required")}function Mn(){if(!Ce)throw new Error("Fuul SDK: Invalid API key")}function Wn(e,t){return new Sn({baseURL:e,timeout:1e4,apiKey:Ce,queryParams:t})}const Xn={init:Dn,sendEvent:Ln,sendPageview:Bn,sendConnectWallet:In,generateTrackingLink:vn,getConversions:Jn,createAffiliateCode:jn,updateAffiliateCode:kn,getAffiliateCode:$n,isAffiliateCodeFree:qn,getPayoutsLeaderboard:Hn,getPointsLeaderboard:zn,getUserPayoutsByConversion:Vn,getUserPointsByConversion:Kn};E.AddressInUseError=ge,E.CodeInUseError=we,E.Fuul=Xn,E.InvalidSignatureError=Ee,E.ValidationError=ye,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient } from '../HttpClient';
|
|
2
|
-
import {
|
|
2
|
+
import { GetPayoutsLeaderboardParams, GetPointsLeaderboardParams, GetUserPayoutsByConversionParams, GetUserPointsByConversionParams, LeaderboardResponse, PayoutsLeaderboard, PointsLeaderboard, UserPayoutsByConversionResponse, UserPointsByConversionResponse } from '../types/api';
|
|
3
3
|
export type PayoutServiceSettings = {
|
|
4
4
|
httpClient: HttpClient;
|
|
5
5
|
debug?: boolean;
|
|
@@ -8,7 +8,9 @@ export declare class PayoutService {
|
|
|
8
8
|
private readonly httpClient;
|
|
9
9
|
private readonly _debug;
|
|
10
10
|
constructor(settings: PayoutServiceSettings);
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
getPayoutsLeaderboard(params: GetPayoutsLeaderboardParams): Promise<LeaderboardResponse<PayoutsLeaderboard>>;
|
|
12
|
+
getPointsLeaderboard(params: GetPointsLeaderboardParams): Promise<LeaderboardResponse<PointsLeaderboard>>;
|
|
13
|
+
getUserPayoutsByConversion(params: GetUserPayoutsByConversionParams): Promise<UserPayoutsByConversionResponse>;
|
|
14
|
+
getUserPointsByConversion(params: GetUserPointsByConversionParams): Promise<UserPointsByConversionResponse>;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=PayoutService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PayoutService.d.ts","sourceRoot":"","sources":["../../../src/payouts/PayoutService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"PayoutService.d.ts","sourceRoot":"","sources":["../../../src/payouts/PayoutService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAG,2BAA2B,EAAE,0BAA0B,EAAE,gCAAgC,EAAE,+BAA+B,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,+BAA+B,EAAE,8BAA8B,EAAC,MAAM,cAAc,CAAC;AAEvR,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;gBAEjC,QAAQ,EAAE,qBAAqB;IAK9B,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;IAK5G,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAKzG,0BAA0B,CAAC,MAAM,EAAE,gCAAgC,GAAG,OAAO,CAAC,+BAA+B,CAAC;IAK9G,yBAAyB,CAAC,MAAM,EAAE,+BAA+B,GAAG,OAAO,CAAC,8BAA8B,CAAC;CAIzH"}
|
package/dist/types/api.d.ts
CHANGED
|
@@ -174,39 +174,69 @@ export interface Conversion {
|
|
|
174
174
|
currency: string;
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
export interface
|
|
178
|
-
currency_address
|
|
177
|
+
export interface GetPayoutsLeaderboardParams {
|
|
178
|
+
currency_address?: string;
|
|
179
179
|
page?: number;
|
|
180
180
|
page_size?: number;
|
|
181
181
|
}
|
|
182
|
-
export interface
|
|
182
|
+
export interface GetPointsLeaderboardParams {
|
|
183
|
+
page?: number;
|
|
184
|
+
page_size?: number;
|
|
185
|
+
}
|
|
186
|
+
export interface LeaderboardResponse<T> {
|
|
183
187
|
total_results: number;
|
|
184
188
|
page: number;
|
|
185
189
|
page_size: number;
|
|
186
|
-
results:
|
|
190
|
+
results: T[];
|
|
187
191
|
}
|
|
188
|
-
export interface
|
|
192
|
+
export interface PayoutsLeaderboard {
|
|
189
193
|
address: string;
|
|
190
|
-
|
|
194
|
+
total_amount: string;
|
|
195
|
+
chain_id: number;
|
|
196
|
+
rank: number;
|
|
191
197
|
}
|
|
192
|
-
export interface
|
|
198
|
+
export interface PointsLeaderboard {
|
|
199
|
+
address: string;
|
|
200
|
+
total_amount: string;
|
|
201
|
+
rank: number;
|
|
202
|
+
}
|
|
203
|
+
export interface GetUserPayoutsByConversionParams {
|
|
193
204
|
user_address: string;
|
|
194
205
|
page?: number;
|
|
195
206
|
page_size?: number;
|
|
196
207
|
group_by?: string;
|
|
197
208
|
}
|
|
198
|
-
export interface
|
|
209
|
+
export interface GetUserPointsByConversionParams {
|
|
210
|
+
user_address: string;
|
|
211
|
+
page?: number;
|
|
212
|
+
page_size?: number;
|
|
213
|
+
group_by?: string;
|
|
214
|
+
}
|
|
215
|
+
export interface UserPayoutsByConversionResponse {
|
|
199
216
|
total_results: number;
|
|
200
217
|
page: number;
|
|
201
218
|
page_size: number;
|
|
202
|
-
results:
|
|
219
|
+
results: UserConversionPayout[];
|
|
203
220
|
}
|
|
204
|
-
export interface
|
|
221
|
+
export interface UserConversionPayout {
|
|
205
222
|
is_referrer: boolean;
|
|
206
|
-
|
|
223
|
+
total_amount: string;
|
|
224
|
+
conversion_id: string;
|
|
225
|
+
conversion_name: string;
|
|
207
226
|
currency_address: string;
|
|
208
|
-
|
|
209
|
-
|
|
227
|
+
chain_id: number;
|
|
228
|
+
}
|
|
229
|
+
export interface UserPointsByConversionResponse {
|
|
230
|
+
total_results: number;
|
|
231
|
+
page: number;
|
|
232
|
+
page_size: number;
|
|
233
|
+
results: UserConversionPoints[];
|
|
234
|
+
}
|
|
235
|
+
export interface UserConversionPoints {
|
|
236
|
+
is_referrer: boolean;
|
|
237
|
+
total_amount: string;
|
|
238
|
+
conversion_id: string;
|
|
239
|
+
conversion_name: string;
|
|
210
240
|
}
|
|
211
241
|
export {};
|
|
212
242
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/types/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/types/api.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IACh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