@kivox/client 0.1.0-beta.34 → 0.1.0-beta.36
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/index.cjs +6 -0
- package/dist/index.d.ts +222 -284
- package/dist/{index.js → index.mjs} +5 -5
- package/package.json +7 -5
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
var{defineProperty:A0,getOwnPropertyNames:e1,getOwnPropertyDescriptor:$4}=Object,Q4=Object.prototype.hasOwnProperty;function Y4($){return this[$]}var Z4=($)=>{var Q=(K1??=new WeakMap).get($),Y;if(Q)return Q;if(Q=A0({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var Z of e1($))if(!Q4.call(Q,Z))A0(Q,Z,{get:Y4.bind($,Z),enumerable:!(Y=$4($,Z))||Y.enumerable})}return K1.set($,Q),Q},K1;var G4=($)=>$;function z4($,Q){this[$]=G4.bind(null,Q)}var k0=($,Q)=>{for(var Y in Q)A0($,Y,{get:Q[Y],enumerable:!0,configurable:!0,set:z4.bind(Q,Y)})};var L2={};k0(L2,{createSessionClient:()=>B2,createApiKeyClient:()=>P2,ConversationTransportError:()=>v,ConversationSession:()=>M0});module.exports=Z4(L2);function s($,Q){return function(){return $.apply(Q,arguments)}}var{toString:X4}=Object.prototype,{getPrototypeOf:j0}=Object,{iterator:P0,toStringTag:P1}=Symbol,L0=(($)=>(Q)=>{let Y=X4.call(Q);return $[Y]||($[Y]=Y.slice(8,-1).toLowerCase())})(Object.create(null)),j=($)=>{return $=$.toLowerCase(),(Q)=>L0(Q)===$},_0=($)=>(Q)=>typeof Q===$,{isArray:p}=Array,l=_0("undefined");function r($){return $!==null&&!l($)&&$.constructor!==null&&!l($.constructor)&&T($.constructor.isBuffer)&&$.constructor.isBuffer($)}var L1=j("ArrayBuffer");function W4($){let Q;if(typeof ArrayBuffer<"u"&&ArrayBuffer.isView)Q=ArrayBuffer.isView($);else Q=$&&$.buffer&&L1($.buffer);return Q}var J4=_0("string"),T=_0("function"),_1=_0("number"),o=($)=>$!==null&&typeof $==="object",N4=($)=>$===!0||$===!1,B0=($)=>{if(L0($)!=="object")return!1;let Q=j0($);return(Q===null||Q===Object.prototype||Object.getPrototypeOf(Q)===null)&&!(P1 in $)&&!(P0 in $)},M4=($)=>{if(!o($)||r($))return!1;try{return Object.keys($).length===0&&Object.getPrototypeOf($)===Object.prototype}catch(Q){return!1}},K4=j("Date"),V4=j("File"),H4=($)=>{return!!($&&typeof $.uri<"u")},B4=($)=>$&&typeof $.getParts<"u",P4=j("Blob"),L4=j("FileList"),_4=($)=>o($)&&T($.pipe);function w4(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;return{}}var V1=w4(),H1=typeof V1.FormData<"u"?V1.FormData:void 0,F4=($)=>{let Q;return $&&(H1&&$ instanceof H1||T($.append)&&((Q=L0($))==="formdata"||Q==="object"&&T($.toString)&&$.toString()==="[object FormData]"))},U4=j("URLSearchParams"),[I4,R4,q4,S4]=["ReadableStream","Request","Response","Headers"].map(j),D4=($)=>{return $.trim?$.trim():$.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function e($,Q,{allOwnKeys:Y=!1}={}){if($===null||typeof $>"u")return;let Z,G;if(typeof $!=="object")$=[$];if(p($))for(Z=0,G=$.length;Z<G;Z++)Q.call(null,$[Z],Z,$);else{if(r($))return;let W=Y?Object.getOwnPropertyNames($):Object.keys($),z=W.length,J;for(Z=0;Z<z;Z++)J=W[Z],Q.call(null,$[J],J,$)}}function w1($,Q){if(r($))return null;Q=Q.toLowerCase();let Y=Object.keys($),Z=Y.length,G;while(Z-- >0)if(G=Y[Z],Q===G.toLowerCase())return G;return null}var c=(()=>{if(typeof globalThis<"u")return globalThis;return typeof self<"u"?self:typeof window<"u"?window:global})(),F1=($)=>!l($)&&$!==c;function x0(){let{caseless:$,skipUndefined:Q}=F1(this)&&this||{},Y={},Z=(G,W)=>{if(W==="__proto__"||W==="constructor"||W==="prototype")return;let z=$&&w1(Y,W)||W;if(B0(Y[z])&&B0(G))Y[z]=x0(Y[z],G);else if(B0(G))Y[z]=x0({},G);else if(p(G))Y[z]=G.slice();else if(!Q||!l(G))Y[z]=G};for(let G=0,W=arguments.length;G<W;G++)arguments[G]&&e(arguments[G],Z);return Y}var E4=($,Q,Y,{allOwnKeys:Z}={})=>{return e(Q,(G,W)=>{if(Y&&T(G))Object.defineProperty($,W,{value:s(G,Y),writable:!0,enumerable:!0,configurable:!0});else Object.defineProperty($,W,{value:G,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:Z}),$},O4=($)=>{if($.charCodeAt(0)===65279)$=$.slice(1);return $},T4=($,Q,Y,Z)=>{$.prototype=Object.create(Q.prototype,Z),Object.defineProperty($.prototype,"constructor",{value:$,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($,"super",{value:Q.prototype}),Y&&Object.assign($.prototype,Y)},C4=($,Q,Y,Z)=>{let G,W,z,J={};if(Q=Q||{},$==null)return Q;do{G=Object.getOwnPropertyNames($),W=G.length;while(W-- >0)if(z=G[W],(!Z||Z(z,$,Q))&&!J[z])Q[z]=$[z],J[z]=!0;$=Y!==!1&&j0($)}while($&&(!Y||Y($,Q))&&$!==Object.prototype);return Q},A4=($,Q,Y)=>{if($=String($),Y===void 0||Y>$.length)Y=$.length;Y-=Q.length;let Z=$.indexOf(Q,Y);return Z!==-1&&Z===Y},k4=($)=>{if(!$)return null;if(p($))return $;let Q=$.length;if(!_1(Q))return null;let Y=Array(Q);while(Q-- >0)Y[Q]=$[Q];return Y},x4=(($)=>{return(Q)=>{return $&&Q instanceof $}})(typeof Uint8Array<"u"&&j0(Uint8Array)),j4=($,Q)=>{let Z=($&&$[P0]).call($),G;while((G=Z.next())&&!G.done){let W=G.value;Q.call($,W[0],W[1])}},y4=($,Q)=>{let Y,Z=[];while((Y=$.exec(Q))!==null)Z.push(Y);return Z},b4=j("HTMLFormElement"),v4=($)=>{return $.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(Y,Z,G){return Z.toUpperCase()+G})},B1=(({hasOwnProperty:$})=>(Q,Y)=>$.call(Q,Y))(Object.prototype),m4=j("RegExp"),U1=($,Q)=>{let Y=Object.getOwnPropertyDescriptors($),Z={};e(Y,(G,W)=>{let z;if((z=Q(G,W,$))!==!1)Z[W]=z||G}),Object.defineProperties($,Z)},h4=($)=>{U1($,(Q,Y)=>{if(T($)&&["arguments","caller","callee"].indexOf(Y)!==-1)return!1;let Z=$[Y];if(!T(Z))return;if(Q.enumerable=!1,"writable"in Q){Q.writable=!1;return}if(!Q.set)Q.set=()=>{throw Error("Can not rewrite read-only method '"+Y+"'")}})},f4=($,Q)=>{let Y={},Z=(G)=>{G.forEach((W)=>{Y[W]=!0})};return p($)?Z($):Z(String($).split(Q)),Y},g4=()=>{},u4=($,Q)=>{return $!=null&&Number.isFinite($=+$)?$:Q};function c4($){return!!($&&T($.append)&&$[P1]==="FormData"&&$[P0])}var d4=($)=>{let Q=[,,,,,,,,,,],Y=(Z,G)=>{if(o(Z)){if(Q.indexOf(Z)>=0)return;if(r(Z))return Z;if(!("toJSON"in Z)){Q[G]=Z;let W=p(Z)?[]:{};return e(Z,(z,J)=>{let V=Y(z,G+1);!l(V)&&(W[J]=V)}),Q[G]=void 0,W}}return Z};return Y($,0)},l4=j("AsyncFunction"),p4=($)=>$&&(o($)||T($))&&T($.then)&&T($.catch),I1=(($,Q)=>{if($)return setImmediate;return Q?((Y,Z)=>{return c.addEventListener("message",({source:G,data:W})=>{if(G===c&&W===Y)Z.length&&Z.shift()()},!1),(G)=>{Z.push(G),c.postMessage(Y,"*")}})(`axios@${Math.random()}`,[]):(Y)=>setTimeout(Y)})(typeof setImmediate==="function",T(c.postMessage)),i4=typeof queueMicrotask<"u"?queueMicrotask.bind(c):typeof process<"u"&&process.nextTick||I1,n4=($)=>$!=null&&T($[P0]),X={isArray:p,isArrayBuffer:L1,isBuffer:r,isFormData:F4,isArrayBufferView:W4,isString:J4,isNumber:_1,isBoolean:N4,isObject:o,isPlainObject:B0,isEmptyObject:M4,isReadableStream:I4,isRequest:R4,isResponse:q4,isHeaders:S4,isUndefined:l,isDate:K4,isFile:V4,isReactNativeBlob:H4,isReactNative:B4,isBlob:P4,isRegExp:m4,isFunction:T,isStream:_4,isURLSearchParams:U4,isTypedArray:x4,isFileList:L4,forEach:e,merge:x0,extend:E4,trim:D4,stripBOM:O4,inherits:T4,toFlatObject:C4,kindOf:L0,kindOfTest:j,endsWith:A4,toArray:k4,forEachEntry:j4,matchAll:y4,isHTMLForm:b4,hasOwnProperty:B1,hasOwnProp:B1,reduceDescriptors:U1,freezeMethods:h4,toObjectSet:f4,toCamelCase:v4,noop:g4,toFiniteNumber:u4,findKey:w1,global:c,isContextDefined:F1,isSpecCompliantForm:c4,toJSONObject:d4,isAsyncFn:l4,isThenable:p4,setImmediate:I1,asap:i4,isIterable:n4};class D extends Error{static from($,Q,Y,Z,G,W){let z=new D($.message,Q||$.code,Y,Z,G);if(z.cause=$,z.name=$.name,$.status!=null&&z.status==null)z.status=$.status;return W&&Object.assign(z,W),z}constructor($,Q,Y,Z,G){super($);if(Object.defineProperty(this,"message",{value:$,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,Q&&(this.code=Q),Y&&(this.config=Y),Z&&(this.request=Z),G)this.response=G,this.status=G.status}toJSON(){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:X.toJSONObject(this.config),code:this.code,status:this.status}}}D.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";D.ERR_BAD_OPTION="ERR_BAD_OPTION";D.ECONNABORTED="ECONNABORTED";D.ETIMEDOUT="ETIMEDOUT";D.ERR_NETWORK="ERR_NETWORK";D.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";D.ERR_DEPRECATED="ERR_DEPRECATED";D.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";D.ERR_BAD_REQUEST="ERR_BAD_REQUEST";D.ERR_CANCELED="ERR_CANCELED";D.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";D.ERR_INVALID_URL="ERR_INVALID_URL";var P=D;var w0=null;function b0($){return X.isPlainObject($)||X.isArray($)}function R1($){return X.endsWith($,"[]")?$.slice(0,-2):$}function y0($,Q,Y){if(!$)return Q;return $.concat(Q).map(function(G,W){return G=R1(G),!Y&&W?"["+G+"]":G}).join(Y?".":"")}function t4($){return X.isArray($)&&!$.some(b0)}var a4=X.toFlatObject(X,{},null,function(Q){return/^is[A-Z]/.test(Q)});function s4($,Q,Y){if(!X.isObject($))throw TypeError("target must be an object");Q=Q||new(w0||FormData),Y=X.toFlatObject(Y,{metaTokens:!0,dots:!1,indexes:!1},!1,function(_,H){return!X.isUndefined(H[_])});let Z=Y.metaTokens,G=Y.visitor||M,W=Y.dots,z=Y.indexes,V=(Y.Blob||typeof Blob<"u"&&Blob)&&X.isSpecCompliantForm(Q);if(!X.isFunction(G))throw TypeError("visitor must be a function");function N(K){if(K===null)return"";if(X.isDate(K))return K.toISOString();if(X.isBoolean(K))return K.toString();if(!V&&X.isBlob(K))throw new P("Blob is not supported. Use a Buffer instead.");if(X.isArrayBuffer(K)||X.isTypedArray(K))return V&&typeof Blob==="function"?new Blob([K]):Buffer.from(K);return K}function M(K,_,H){let R=K;if(X.isReactNative(Q)&&X.isReactNativeBlob(K))return Q.append(y0(H,_,W),N(K)),!1;if(K&&!H&&typeof K==="object"){if(X.endsWith(_,"{}"))_=Z?_:_.slice(0,-2),K=JSON.stringify(K);else if(X.isArray(K)&&t4(K)||(X.isFileList(K)||X.endsWith(_,"[]"))&&(R=X.toArray(K)))return _=R1(_),R.forEach(function(S,E){!(X.isUndefined(S)||S===null)&&Q.append(z===!0?y0([_],E,W):z===null?_:_+"[]",N(S))}),!1}if(b0(K))return!0;return Q.append(y0(H,_,W),N(K)),!1}let L=[],F=Object.assign(a4,{defaultVisitor:M,convertValue:N,isVisitable:b0});function w(K,_){if(X.isUndefined(K))return;if(L.indexOf(K)!==-1)throw Error("Circular reference detected in "+_.join("."));L.push(K),X.forEach(K,function(R,C){if((!(X.isUndefined(R)||R===null)&&G.call(Q,R,X.isString(C)?C.trim():C,_,F))===!0)w(R,_?_.concat(C):[C])}),L.pop()}if(!X.isObject($))throw TypeError("data must be an object");return w($),Q}var f=s4;function q1($){let Q={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\x00"};return encodeURIComponent($).replace(/[!'()~]|%20|%00/g,function(Z){return Q[Z]})}function S1($,Q){this._pairs=[],$&&f($,this,Q)}var D1=S1.prototype;D1.append=function(Q,Y){this._pairs.push([Q,Y])};D1.toString=function(Q){let Y=Q?function(Z){return Q.call(this,Z,q1)}:q1;return this._pairs.map(function(G){return Y(G[0])+"="+Y(G[1])},"").join("&")};var F0=S1;function r4($){return encodeURIComponent($).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $0($,Q,Y){if(!Q)return $;let Z=Y&&Y.encode||r4,G=X.isFunction(Y)?{serialize:Y}:Y,W=G&&G.serialize,z;if(W)z=W(Q,G);else z=X.isURLSearchParams(Q)?Q.toString():new F0(Q,G).toString(Z);if(z){let J=$.indexOf("#");if(J!==-1)$=$.slice(0,J);$+=($.indexOf("?")===-1?"?":"&")+z}return $}class E1{constructor(){this.handlers=[]}use($,Q,Y){return this.handlers.push({fulfilled:$,rejected:Q,synchronous:Y?Y.synchronous:!1,runWhen:Y?Y.runWhen:null}),this.handlers.length-1}eject($){if(this.handlers[$])this.handlers[$]=null}clear(){if(this.handlers)this.handlers=[]}forEach($){X.forEach(this.handlers,function(Y){if(Y!==null)$(Y)})}}var v0=E1;var i={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0};var O1=typeof URLSearchParams<"u"?URLSearchParams:F0;var T1=typeof FormData<"u"?FormData:null;var C1=typeof Blob<"u"?Blob:null;var A1={isBrowser:!0,classes:{URLSearchParams:O1,FormData:T1,Blob:C1},protocols:["http","https","file","blob","url","data"]};var f0={};k0(f0,{origin:()=>$5,navigator:()=>m0,hasStandardBrowserWebWorkerEnv:()=>e4,hasStandardBrowserEnv:()=>o4,hasBrowserEnv:()=>h0});var h0=typeof window<"u"&&typeof document<"u",m0=typeof navigator==="object"&&navigator||void 0,o4=h0&&(!m0||["ReactNative","NativeScript","NS"].indexOf(m0.product)<0),e4=(()=>{return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function"})(),$5=h0&&window.location.href||"http://localhost";var U={...f0,...A1};function g0($,Q){return f($,new U.classes.URLSearchParams,{visitor:function(Y,Z,G,W){if(U.isNode&&X.isBuffer(Y))return this.append(Z,Y.toString("base64")),!1;return W.defaultVisitor.apply(this,arguments)},...Q})}function Q5($){return X.matchAll(/\w+|\[(\w*)]/g,$).map((Q)=>{return Q[0]==="[]"?"":Q[1]||Q[0]})}function Y5($){let Q={},Y=Object.keys($),Z,G=Y.length,W;for(Z=0;Z<G;Z++)W=Y[Z],Q[W]=$[W];return Q}function Z5($){function Q(Y,Z,G,W){let z=Y[W++];if(z==="__proto__")return!0;let J=Number.isFinite(+z),V=W>=Y.length;if(z=!z&&X.isArray(G)?G.length:z,V){if(X.hasOwnProp(G,z))G[z]=[G[z],Z];else G[z]=Z;return!J}if(!G[z]||!X.isObject(G[z]))G[z]=[];if(Q(Y,Z,G[z],W)&&X.isArray(G[z]))G[z]=Y5(G[z]);return!J}if(X.isFormData($)&&X.isFunction($.entries)){let Y={};return X.forEachEntry($,(Z,G)=>{Q(Q5(Z),G,Y,0)}),Y}return null}var U0=Z5;function G5($,Q,Y){if(X.isString($))try{return(Q||JSON.parse)($),X.trim($)}catch(Z){if(Z.name!=="SyntaxError")throw Z}return(Y||JSON.stringify)($)}var u0={transitional:i,adapter:["xhr","http","fetch"],transformRequest:[function(Q,Y){let Z=Y.getContentType()||"",G=Z.indexOf("application/json")>-1,W=X.isObject(Q);if(W&&X.isHTMLForm(Q))Q=new FormData(Q);if(X.isFormData(Q))return G?JSON.stringify(U0(Q)):Q;if(X.isArrayBuffer(Q)||X.isBuffer(Q)||X.isStream(Q)||X.isFile(Q)||X.isBlob(Q)||X.isReadableStream(Q))return Q;if(X.isArrayBufferView(Q))return Q.buffer;if(X.isURLSearchParams(Q))return Y.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),Q.toString();let J;if(W){if(Z.indexOf("application/x-www-form-urlencoded")>-1)return g0(Q,this.formSerializer).toString();if((J=X.isFileList(Q))||Z.indexOf("multipart/form-data")>-1){let V=this.env&&this.env.FormData;return f(J?{"files[]":Q}:Q,V&&new V,this.formSerializer)}}if(W||G)return Y.setContentType("application/json",!1),G5(Q);return Q}],transformResponse:[function(Q){let Y=this.transitional||u0.transitional,Z=Y&&Y.forcedJSONParsing,G=this.responseType==="json";if(X.isResponse(Q)||X.isReadableStream(Q))return Q;if(Q&&X.isString(Q)&&(Z&&!this.responseType||G)){let z=!(Y&&Y.silentJSONParsing)&&G;try{return JSON.parse(Q,this.parseReviver)}catch(J){if(z){if(J.name==="SyntaxError")throw P.from(J,P.ERR_BAD_RESPONSE,this,null,this.response);throw J}}}return Q}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:U.classes.FormData,Blob:U.classes.Blob},validateStatus:function(Q){return Q>=200&&Q<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};X.forEach(["delete","get","head","post","put","patch"],($)=>{u0.headers[$]={}});var n=u0;var z5=X.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"]),k1=($)=>{let Q={},Y,Z,G;return $&&$.split(`
|
|
2
|
+
`).forEach(function(z){if(G=z.indexOf(":"),Y=z.substring(0,G).trim().toLowerCase(),Z=z.substring(G+1).trim(),!Y||Q[Y]&&z5[Y])return;if(Y==="set-cookie")if(Q[Y])Q[Y].push(Z);else Q[Y]=[Z];else Q[Y]=Q[Y]?Q[Y]+", "+Z:Z}),Q};var x1=Symbol("internals");function Q0($){return $&&String($).trim().toLowerCase()}function I0($){if($===!1||$==null)return $;return X.isArray($)?$.map(I0):String($)}function X5($){let Q=Object.create(null),Y=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,Z;while(Z=Y.exec($))Q[Z[1]]=Z[2];return Q}var W5=($)=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test($.trim());function c0($,Q,Y,Z,G){if(X.isFunction(Z))return Z.call(this,Q,Y);if(G)Q=Y;if(!X.isString(Q))return;if(X.isString(Z))return Q.indexOf(Z)!==-1;if(X.isRegExp(Z))return Z.test(Q)}function J5($){return $.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(Q,Y,Z)=>{return Y.toUpperCase()+Z})}function N5($,Q){let Y=X.toCamelCase(" "+Q);["get","set","has"].forEach((Z)=>{Object.defineProperty($,Z+Y,{value:function(G,W,z){return this[Z].call(this,Q,G,W,z)},configurable:!0})})}class Y0{constructor($){$&&this.set($)}set($,Q,Y){let Z=this;function G(z,J,V){let N=Q0(J);if(!N)throw Error("header name must be a non-empty string");let M=X.findKey(Z,N);if(!M||Z[M]===void 0||V===!0||V===void 0&&Z[M]!==!1)Z[M||J]=I0(z)}let W=(z,J)=>X.forEach(z,(V,N)=>G(V,N,J));if(X.isPlainObject($)||$ instanceof this.constructor)W($,Q);else if(X.isString($)&&($=$.trim())&&!W5($))W(k1($),Q);else if(X.isObject($)&&X.isIterable($)){let z={},J,V;for(let N of $){if(!X.isArray(N))throw TypeError("Object iterator must return a key-value pair");z[V=N[0]]=(J=z[V])?X.isArray(J)?[...J,N[1]]:[J,N[1]]:N[1]}W(z,Q)}else $!=null&&G(Q,$,Y);return this}get($,Q){if($=Q0($),$){let Y=X.findKey(this,$);if(Y){let Z=this[Y];if(!Q)return Z;if(Q===!0)return X5(Z);if(X.isFunction(Q))return Q.call(this,Z,Y);if(X.isRegExp(Q))return Q.exec(Z);throw TypeError("parser must be boolean|regexp|function")}}}has($,Q){if($=Q0($),$){let Y=X.findKey(this,$);return!!(Y&&this[Y]!==void 0&&(!Q||c0(this,this[Y],Y,Q)))}return!1}delete($,Q){let Y=this,Z=!1;function G(W){if(W=Q0(W),W){let z=X.findKey(Y,W);if(z&&(!Q||c0(Y,Y[z],z,Q)))delete Y[z],Z=!0}}if(X.isArray($))$.forEach(G);else G($);return Z}clear($){let Q=Object.keys(this),Y=Q.length,Z=!1;while(Y--){let G=Q[Y];if(!$||c0(this,this[G],G,$,!0))delete this[G],Z=!0}return Z}normalize($){let Q=this,Y={};return X.forEach(this,(Z,G)=>{let W=X.findKey(Y,G);if(W){Q[W]=I0(Z),delete Q[G];return}let z=$?J5(G):String(G).trim();if(z!==G)delete Q[G];Q[z]=I0(Z),Y[z]=!0}),this}concat(...$){return this.constructor.concat(this,...$)}toJSON($){let Q=Object.create(null);return X.forEach(this,(Y,Z)=>{Y!=null&&Y!==!1&&(Q[Z]=$&&X.isArray(Y)?Y.join(", "):Y)}),Q}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([$,Q])=>$+": "+Q).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from($){return $ instanceof this?$:new this($)}static concat($,...Q){let Y=new this($);return Q.forEach((Z)=>Y.set(Z)),Y}static accessor($){let Y=(this[x1]=this[x1]={accessors:{}}).accessors,Z=this.prototype;function G(W){let z=Q0(W);if(!Y[z])N5(Z,W),Y[z]=!0}return X.isArray($)?$.forEach(G):G($),this}}Y0.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);X.reduceDescriptors(Y0.prototype,({value:$},Q)=>{let Y=Q[0].toUpperCase()+Q.slice(1);return{get:()=>$,set(Z){this[Y]=Z}}});X.freezeMethods(Y0);var q=Y0;function Z0($,Q){let Y=this||n,Z=Q||Y,G=q.from(Z.headers),W=Z.data;return X.forEach($,function(J){W=J.call(Y,W,G.normalize(),Q?Q.status:void 0)}),G.normalize(),W}function G0($){return!!($&&$.__CANCEL__)}class j1 extends P{constructor($,Q,Y){super($==null?"canceled":$,P.ERR_CANCELED,Q,Y);this.name="CanceledError",this.__CANCEL__=!0}}var b=j1;function z0($,Q,Y){let Z=Y.config.validateStatus;if(!Y.status||!Z||Z(Y.status))$(Y);else Q(new P("Request failed with status code "+Y.status,[P.ERR_BAD_REQUEST,P.ERR_BAD_RESPONSE][Math.floor(Y.status/100)-4],Y.config,Y.request,Y))}function d0($){let Q=/^([-+\w]{1,25})(:?\/\/|:)/.exec($);return Q&&Q[1]||""}function M5($,Q){$=$||10;let Y=Array($),Z=Array($),G=0,W=0,z;return Q=Q!==void 0?Q:1000,function(V){let N=Date.now(),M=Z[W];if(!z)z=N;Y[G]=V,Z[G]=N;let L=W,F=0;while(L!==G)F+=Y[L++],L=L%$;if(G=(G+1)%$,G===W)W=(W+1)%$;if(N-z<Q)return;let w=M&&N-M;return w?Math.round(F*1000/w):void 0}}var y1=M5;function K5($,Q){let Y=0,Z=1000/Q,G,W,z=(N,M=Date.now())=>{if(Y=M,G=null,W)clearTimeout(W),W=null;$(...N)};return[(...N)=>{let M=Date.now(),L=M-Y;if(L>=Z)z(N,M);else if(G=N,!W)W=setTimeout(()=>{W=null,z(G)},Z-L)},()=>G&&z(G)]}var b1=K5;var t=($,Q,Y=3)=>{let Z=0,G=y1(50,250);return b1((W)=>{let z=W.loaded,J=W.lengthComputable?W.total:void 0,V=z-Z,N=G(V),M=z<=J;Z=z;let L={loaded:z,total:J,progress:J?z/J:void 0,bytes:V,rate:N?N:void 0,estimated:N&&J&&M?(J-z)/N:void 0,event:W,lengthComputable:J!=null,[Q?"download":"upload"]:!0};$(L)},Y)},l0=($,Q)=>{let Y=$!=null;return[(Z)=>Q[0]({lengthComputable:Y,total:$,loaded:Z}),Q[1]]},p0=($)=>(...Q)=>X.asap(()=>$(...Q));var v1=U.hasStandardBrowserEnv?(($,Q)=>(Y)=>{return Y=new URL(Y,U.origin),$.protocol===Y.protocol&&$.host===Y.host&&(Q||$.port===Y.port)})(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0;var m1=U.hasStandardBrowserEnv?{write($,Q,Y,Z,G,W,z){if(typeof document>"u")return;let J=[`${$}=${encodeURIComponent(Q)}`];if(X.isNumber(Y))J.push(`expires=${new Date(Y).toUTCString()}`);if(X.isString(Z))J.push(`path=${Z}`);if(X.isString(G))J.push(`domain=${G}`);if(W===!0)J.push("secure");if(X.isString(z))J.push(`SameSite=${z}`);document.cookie=J.join("; ")},read($){if(typeof document>"u")return null;let Q=document.cookie.match(new RegExp("(?:^|; )"+$+"=([^;]*)"));return Q?decodeURIComponent(Q[1]):null},remove($){this.write($,"",Date.now()-86400000,"/")}}:{write(){},read(){return null},remove(){}};function i0($){if(typeof $!=="string")return!1;return/^([a-z][a-z\d+\-.]*:)?\/\//i.test($)}function n0($,Q){return Q?$.replace(/\/?\/$/,"")+"/"+Q.replace(/^\/+/,""):$}function X0($,Q,Y){let Z=!i0(Q);if($&&(Z||Y==!1))return n0($,Q);return Q}var h1=($)=>$ instanceof q?{...$}:$;function y($,Q){Q=Q||{};let Y={};function Z(N,M,L,F){if(X.isPlainObject(N)&&X.isPlainObject(M))return X.merge.call({caseless:F},N,M);else if(X.isPlainObject(M))return X.merge({},M);else if(X.isArray(M))return M.slice();return M}function G(N,M,L,F){if(!X.isUndefined(M))return Z(N,M,L,F);else if(!X.isUndefined(N))return Z(void 0,N,L,F)}function W(N,M){if(!X.isUndefined(M))return Z(void 0,M)}function z(N,M){if(!X.isUndefined(M))return Z(void 0,M);else if(!X.isUndefined(N))return Z(void 0,N)}function J(N,M,L){if(L in Q)return Z(N,M);else if(L in $)return Z(void 0,N)}let V={url:W,method:W,data:W,baseURL:z,transformRequest:z,transformResponse:z,paramsSerializer:z,timeout:z,timeoutMessage:z,withCredentials:z,withXSRFToken:z,adapter:z,responseType:z,xsrfCookieName:z,xsrfHeaderName:z,onUploadProgress:z,onDownloadProgress:z,decompress:z,maxContentLength:z,maxBodyLength:z,beforeRedirect:z,transport:z,httpAgent:z,httpsAgent:z,cancelToken:z,socketPath:z,responseEncoding:z,validateStatus:J,headers:(N,M,L)=>G(h1(N),h1(M),L,!0)};return X.forEach(Object.keys({...$,...Q}),function(M){if(M==="__proto__"||M==="constructor"||M==="prototype")return;let L=X.hasOwnProp(V,M)?V[M]:G,F=L($[M],Q[M],M);X.isUndefined(F)&&L!==J||(Y[M]=F)}),Y}var R0=($)=>{let Q=y({},$),{data:Y,withXSRFToken:Z,xsrfHeaderName:G,xsrfCookieName:W,headers:z,auth:J}=Q;if(Q.headers=z=q.from(z),Q.url=$0(X0(Q.baseURL,Q.url,Q.allowAbsoluteUrls),$.params,$.paramsSerializer),J)z.set("Authorization","Basic "+btoa((J.username||"")+":"+(J.password?unescape(encodeURIComponent(J.password)):"")));if(X.isFormData(Y)){if(U.hasStandardBrowserEnv||U.hasStandardBrowserWebWorkerEnv)z.setContentType(void 0);else if(X.isFunction(Y.getHeaders)){let V=Y.getHeaders(),N=["content-type","content-length"];Object.entries(V).forEach(([M,L])=>{if(N.includes(M.toLowerCase()))z.set(M,L)})}}if(U.hasStandardBrowserEnv){if(Z&&X.isFunction(Z)&&(Z=Z(Q)),Z||Z!==!1&&v1(Q.url)){let V=G&&W&&m1.read(W);if(V)z.set(G,V)}}return Q};var V5=typeof XMLHttpRequest<"u",f1=V5&&function($){return new Promise(function(Y,Z){let G=R0($),W=G.data,z=q.from(G.headers).normalize(),{responseType:J,onUploadProgress:V,onDownloadProgress:N}=G,M,L,F,w,K;function _(){w&&w(),K&&K(),G.cancelToken&&G.cancelToken.unsubscribe(M),G.signal&&G.signal.removeEventListener("abort",M)}let H=new XMLHttpRequest;H.open(G.method.toUpperCase(),G.url,!0),H.timeout=G.timeout;function R(){if(!H)return;let S=q.from("getAllResponseHeaders"in H&&H.getAllResponseHeaders()),x={data:!J||J==="text"||J==="json"?H.responseText:H.response,status:H.status,statusText:H.statusText,headers:S,config:$,request:H};z0(function(A){Y(A),_()},function(A){Z(A),_()},x),H=null}if("onloadend"in H)H.onloadend=R;else H.onreadystatechange=function(){if(!H||H.readyState!==4)return;if(H.status===0&&!(H.responseURL&&H.responseURL.indexOf("file:")===0))return;setTimeout(R)};if(H.onabort=function(){if(!H)return;Z(new P("Request aborted",P.ECONNABORTED,$,H)),H=null},H.onerror=function(E){let x=E&&E.message?E.message:"Network Error",g=new P(x,P.ERR_NETWORK,$,H);g.event=E||null,Z(g),H=null},H.ontimeout=function(){let E=G.timeout?"timeout of "+G.timeout+"ms exceeded":"timeout exceeded",x=G.transitional||i;if(G.timeoutErrorMessage)E=G.timeoutErrorMessage;Z(new P(E,x.clarifyTimeoutError?P.ETIMEDOUT:P.ECONNABORTED,$,H)),H=null},W===void 0&&z.setContentType(null),"setRequestHeader"in H)X.forEach(z.toJSON(),function(E,x){H.setRequestHeader(x,E)});if(!X.isUndefined(G.withCredentials))H.withCredentials=!!G.withCredentials;if(J&&J!=="json")H.responseType=G.responseType;if(N)[F,K]=t(N,!0),H.addEventListener("progress",F);if(V&&H.upload)[L,w]=t(V),H.upload.addEventListener("progress",L),H.upload.addEventListener("loadend",w);if(G.cancelToken||G.signal){if(M=(S)=>{if(!H)return;Z(!S||S.type?new b(null,$,H):S),H.abort(),H=null},G.cancelToken&&G.cancelToken.subscribe(M),G.signal)G.signal.aborted?M():G.signal.addEventListener("abort",M)}let C=d0(G.url);if(C&&U.protocols.indexOf(C)===-1){Z(new P("Unsupported protocol "+C+":",P.ERR_BAD_REQUEST,$));return}H.send(W||null)})};var H5=($,Q)=>{let{length:Y}=$=$?$.filter(Boolean):[];if(Q||Y){let Z=new AbortController,G,W=function(N){if(!G){G=!0,J();let M=N instanceof Error?N:this.reason;Z.abort(M instanceof P?M:new b(M instanceof Error?M.message:M))}},z=Q&&setTimeout(()=>{z=null,W(new P(`timeout of ${Q}ms exceeded`,P.ETIMEDOUT))},Q),J=()=>{if($)z&&clearTimeout(z),z=null,$.forEach((N)=>{N.unsubscribe?N.unsubscribe(W):N.removeEventListener("abort",W)}),$=null};$.forEach((N)=>N.addEventListener("abort",W));let{signal:V}=Z;return V.unsubscribe=()=>X.asap(J),V}},g1=H5;var B5=function*($,Q){let Y=$.byteLength;if(!Q||Y<Q){yield $;return}let Z=0,G;while(Z<Y)G=Z+Q,yield $.slice(Z,G),Z=G},P5=async function*($,Q){for await(let Y of L5($))yield*B5(Y,Q)},L5=async function*($){if($[Symbol.asyncIterator]){yield*$;return}let Q=$.getReader();try{for(;;){let{done:Y,value:Z}=await Q.read();if(Y)break;yield Z}}finally{await Q.cancel()}},t0=($,Q,Y,Z)=>{let G=P5($,Q),W=0,z,J=(V)=>{if(!z)z=!0,Z&&Z(V)};return new ReadableStream({async pull(V){try{let{done:N,value:M}=await G.next();if(N){J(),V.close();return}let L=M.byteLength;if(Y){let F=W+=L;Y(F)}V.enqueue(new Uint8Array(M))}catch(N){throw J(N),N}},cancel(V){return J(V),G.return()}},{highWaterMark:2})};var u1=65536,{isFunction:q0}=X,_5=(({Request:$,Response:Q})=>({Request:$,Response:Q}))(X.global),{ReadableStream:c1,TextEncoder:d1}=X.global,l1=($,...Q)=>{try{return!!$(...Q)}catch(Y){return!1}},w5=($)=>{$=X.merge.call({skipUndefined:!0},_5,$);let{fetch:Q,Request:Y,Response:Z}=$,G=Q?q0(Q):typeof fetch==="function",W=q0(Y),z=q0(Z);if(!G)return!1;let J=G&&q0(c1),V=G&&(typeof d1==="function"?((K)=>(_)=>K.encode(_))(new d1):async(K)=>new Uint8Array(await new Y(K).arrayBuffer())),N=W&&J&&l1(()=>{let K=!1,_=new Y(U.origin,{body:new c1,method:"POST",get duplex(){return K=!0,"half"}}).headers.has("Content-Type");return K&&!_}),M=z&&J&&l1(()=>X.isReadableStream(new Z("").body)),L={stream:M&&((K)=>K.body)};G&&(()=>{["text","arrayBuffer","blob","formData","stream"].forEach((K)=>{!L[K]&&(L[K]=(_,H)=>{let R=_&&_[K];if(R)return R.call(_);throw new P(`Response type '${K}' is not supported`,P.ERR_NOT_SUPPORT,H)})})})();let F=async(K)=>{if(K==null)return 0;if(X.isBlob(K))return K.size;if(X.isSpecCompliantForm(K))return(await new Y(U.origin,{method:"POST",body:K}).arrayBuffer()).byteLength;if(X.isArrayBufferView(K)||X.isArrayBuffer(K))return K.byteLength;if(X.isURLSearchParams(K))K=K+"";if(X.isString(K))return(await V(K)).byteLength},w=async(K,_)=>{let H=X.toFiniteNumber(K.getContentLength());return H==null?F(_):H};return async(K)=>{let{url:_,method:H,data:R,signal:C,cancelToken:S,timeout:E,onDownloadProgress:x,onUploadProgress:g,responseType:A,headers:T0,withCredentials:K0="same-origin",fetchOptions:z1}=R0(K),X1=Q||fetch;A=A?(A+"").toLowerCase():"text";let V0=g1([C,S&&S.toAbortSignal()],E),a=null,u=V0&&V0.unsubscribe&&(()=>{V0.unsubscribe()}),W1;try{if(g&&N&&H!=="get"&&H!=="head"&&(W1=await w(T0,R))!==0){let h=new Y(_,{method:"POST",body:R,duplex:"half"}),d;if(X.isFormData(R)&&(d=h.headers.get("content-type")))T0.setContentType(d);if(h.body){let[C0,H0]=l0(W1,t(p0(g)));R=t0(h.body,u1,C0,H0)}}if(!X.isString(K0))K0=K0?"include":"omit";let O=W&&"credentials"in Y.prototype,J1={...z1,signal:V0,method:H.toUpperCase(),headers:T0.normalize().toJSON(),body:R,duplex:"half",credentials:O?K0:void 0};a=W&&new Y(_,J1);let m=await(W?X1(a,z1):X1(_,J1)),N1=M&&(A==="stream"||A==="response");if(M&&(x||N1&&u)){let h={};["status","statusText","headers"].forEach((M1)=>{h[M1]=m[M1]});let d=X.toFiniteNumber(m.headers.get("content-length")),[C0,H0]=x&&l0(d,t(p0(x),!0))||[];m=new Z(t0(m.body,u1,C0,()=>{H0&&H0(),u&&u()}),h)}A=A||"text";let o1=await L[X.findKey(L,A)||"text"](m,K);return!N1&&u&&u(),await new Promise((h,d)=>{z0(h,d,{data:o1,headers:q.from(m.headers),status:m.status,statusText:m.statusText,config:K,request:a})})}catch(O){if(u&&u(),O&&O.name==="TypeError"&&/Load failed|fetch/i.test(O.message))throw Object.assign(new P("Network Error",P.ERR_NETWORK,K,a,O&&O.response),{cause:O.cause||O});throw P.from(O,O&&O.code,K,a,O&&O.response)}}},F5=new Map,a0=($)=>{let Q=$&&$.env||{},{fetch:Y,Request:Z,Response:G}=Q,W=[Z,G,Y],z=W.length,J=z,V,N,M=F5;while(J--)V=W[J],N=M.get(V),N===void 0&&M.set(V,N=J?new Map:w5(Q)),M=N;return N},U8=a0();var s0={http:w0,xhr:f1,fetch:{get:a0}};X.forEach(s0,($,Q)=>{if($){try{Object.defineProperty($,"name",{value:Q})}catch(Y){}Object.defineProperty($,"adapterName",{value:Q})}});var p1=($)=>`- ${$}`,I5=($)=>X.isFunction($)||$===null||$===!1;function R5($,Q){$=X.isArray($)?$:[$];let{length:Y}=$,Z,G,W={};for(let z=0;z<Y;z++){Z=$[z];let J;if(G=Z,!I5(Z)){if(G=s0[(J=String(Z)).toLowerCase()],G===void 0)throw new P(`Unknown adapter '${J}'`)}if(G&&(X.isFunction(G)||(G=G.get(Q))))break;W[J||"#"+z]=G}if(!G){let z=Object.entries(W).map(([V,N])=>`adapter ${V} `+(N===!1?"is not supported by the environment":"is not available in the build")),J=Y?z.length>1?`since :
|
|
4
|
+
`+z.map(p1).join(`
|
|
5
|
+
`):" "+p1(z[0]):"as no adapter specified";throw new P("There is no suitable adapter to dispatch the request "+J,"ERR_NOT_SUPPORT")}return G}var S0={getAdapter:R5,adapters:s0};function r0($){if($.cancelToken)$.cancelToken.throwIfRequested();if($.signal&&$.signal.aborted)throw new b(null,$)}function D0($){if(r0($),$.headers=q.from($.headers),$.data=Z0.call($,$.transformRequest),["post","put","patch"].indexOf($.method)!==-1)$.headers.setContentType("application/x-www-form-urlencoded",!1);return S0.getAdapter($.adapter||n.adapter,$)($).then(function(Z){return r0($),Z.data=Z0.call($,$.transformResponse,Z),Z.headers=q.from(Z.headers),Z},function(Z){if(!G0(Z)){if(r0($),Z&&Z.response)Z.response.data=Z0.call($,$.transformResponse,Z.response),Z.response.headers=q.from(Z.response.headers)}return Promise.reject(Z)})}var E0="1.13.6";var O0={};["object","boolean","number","function","string","symbol"].forEach(($,Q)=>{O0[$]=function(Z){return typeof Z===$||"a"+(Q<1?"n ":" ")+$}});var i1={};O0.transitional=function(Q,Y,Z){function G(W,z){return"[Axios v"+E0+"] Transitional option '"+W+"'"+z+(Z?". "+Z:"")}return(W,z,J)=>{if(Q===!1)throw new P(G(z," has been removed"+(Y?" in "+Y:"")),P.ERR_DEPRECATED);if(Y&&!i1[z])i1[z]=!0,console.warn(G(z," has been deprecated since v"+Y+" and will be removed in the near future"));return Q?Q(W,z,J):!0}};O0.spelling=function(Q){return(Y,Z)=>{return console.warn(`${Z} is likely a misspelling of ${Q}`),!0}};function q5($,Q,Y){if(typeof $!=="object")throw new P("options must be an object",P.ERR_BAD_OPTION_VALUE);let Z=Object.keys($),G=Z.length;while(G-- >0){let W=Z[G],z=Q[W];if(z){let J=$[W],V=J===void 0||z(J,W,$);if(V!==!0)throw new P("option "+W+" must be "+V,P.ERR_BAD_OPTION_VALUE);continue}if(Y!==!0)throw new P("Unknown option "+W,P.ERR_BAD_OPTION)}}var W0={assertOptions:q5,validators:O0};var k=W0.validators;class J0{constructor($){this.defaults=$||{},this.interceptors={request:new v0,response:new v0}}async request($,Q){try{return await this._request($,Q)}catch(Y){if(Y instanceof Error){let Z={};Error.captureStackTrace?Error.captureStackTrace(Z):Z=Error();let G=Z.stack?Z.stack.replace(/^.+\n/,""):"";try{if(!Y.stack)Y.stack=G;else if(G&&!String(Y.stack).endsWith(G.replace(/^.+\n.+\n/,"")))Y.stack+=`
|
|
6
|
+
`+G}catch(W){}}throw Y}}_request($,Q){if(typeof $==="string")Q=Q||{},Q.url=$;else Q=$||{};Q=y(this.defaults,Q);let{transitional:Y,paramsSerializer:Z,headers:G}=Q;if(Y!==void 0)W0.assertOptions(Y,{silentJSONParsing:k.transitional(k.boolean),forcedJSONParsing:k.transitional(k.boolean),clarifyTimeoutError:k.transitional(k.boolean),legacyInterceptorReqResOrdering:k.transitional(k.boolean)},!1);if(Z!=null)if(X.isFunction(Z))Q.paramsSerializer={serialize:Z};else W0.assertOptions(Z,{encode:k.function,serialize:k.function},!0);if(Q.allowAbsoluteUrls!==void 0);else if(this.defaults.allowAbsoluteUrls!==void 0)Q.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls;else Q.allowAbsoluteUrls=!0;W0.assertOptions(Q,{baseUrl:k.spelling("baseURL"),withXsrfToken:k.spelling("withXSRFToken")},!0),Q.method=(Q.method||this.defaults.method||"get").toLowerCase();let W=G&&X.merge(G.common,G[Q.method]);G&&X.forEach(["delete","get","head","post","put","patch","common"],(w)=>{delete G[w]}),Q.headers=q.concat(W,G);let z=[],J=!0;this.interceptors.request.forEach(function(K){if(typeof K.runWhen==="function"&&K.runWhen(Q)===!1)return;J=J&&K.synchronous;let _=Q.transitional||i;if(_&&_.legacyInterceptorReqResOrdering)z.unshift(K.fulfilled,K.rejected);else z.push(K.fulfilled,K.rejected)});let V=[];this.interceptors.response.forEach(function(K){V.push(K.fulfilled,K.rejected)});let N,M=0,L;if(!J){let w=[D0.bind(this),void 0];w.unshift(...z),w.push(...V),L=w.length,N=Promise.resolve(Q);while(M<L)N=N.then(w[M++],w[M++]);return N}L=z.length;let F=Q;while(M<L){let w=z[M++],K=z[M++];try{F=w(F)}catch(_){K.call(this,_);break}}try{N=D0.call(this,F)}catch(w){return Promise.reject(w)}M=0,L=V.length;while(M<L)N=N.then(V[M++],V[M++]);return N}getUri($){$=y(this.defaults,$);let Q=X0($.baseURL,$.url,$.allowAbsoluteUrls);return $0(Q,$.params,$.paramsSerializer)}}X.forEach(["delete","get","head","options"],function(Q){J0.prototype[Q]=function(Y,Z){return this.request(y(Z||{},{method:Q,url:Y,data:(Z||{}).data}))}});X.forEach(["post","put","patch"],function(Q){function Y(Z){return function(W,z,J){return this.request(y(J||{},{method:Q,headers:Z?{"Content-Type":"multipart/form-data"}:{},url:W,data:z}))}}J0.prototype[Q]=Y(),J0.prototype[Q+"Form"]=Y(!0)});var N0=J0;class o0{constructor($){if(typeof $!=="function")throw TypeError("executor must be a function.");let Q;this.promise=new Promise(function(G){Q=G});let Y=this;this.promise.then((Z)=>{if(!Y._listeners)return;let G=Y._listeners.length;while(G-- >0)Y._listeners[G](Z);Y._listeners=null}),this.promise.then=(Z)=>{let G,W=new Promise((z)=>{Y.subscribe(z),G=z}).then(Z);return W.cancel=function(){Y.unsubscribe(G)},W},$(function(G,W,z){if(Y.reason)return;Y.reason=new b(G,W,z),Q(Y.reason)})}throwIfRequested(){if(this.reason)throw this.reason}subscribe($){if(this.reason){$(this.reason);return}if(this._listeners)this._listeners.push($);else this._listeners=[$]}unsubscribe($){if(!this._listeners)return;let Q=this._listeners.indexOf($);if(Q!==-1)this._listeners.splice(Q,1)}toAbortSignal(){let $=new AbortController,Q=(Y)=>{$.abort(Y)};return this.subscribe(Q),$.signal.unsubscribe=()=>this.unsubscribe(Q),$.signal}static source(){let $;return{token:new o0(function(Z){$=Z}),cancel:$}}}var n1=o0;function e0($){return function(Y){return $.apply(null,Y)}}function $1($){return X.isObject($)&&$.isAxiosError===!0}var Q1={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Q1).forEach(([$,Q])=>{Q1[Q]=$});var t1=Q1;function a1($){let Q=new N0($),Y=s(N0.prototype.request,Q);return X.extend(Y,N0.prototype,Q,{allOwnKeys:!0}),X.extend(Y,Q,null,{allOwnKeys:!0}),Y.create=function(G){return a1(y($,G))},Y}var I=a1(n);I.Axios=N0;I.CanceledError=b;I.CancelToken=n1;I.isCancel=G0;I.VERSION=E0;I.toFormData=f;I.AxiosError=P;I.Cancel=I.CanceledError;I.all=function(Q){return Promise.all(Q)};I.spread=e0;I.isAxiosError=$1;I.mergeConfig=y;I.AxiosHeaders=q;I.formToJSON=($)=>U0(X.isHTMLForm($)?new FormData($):$);I.getAdapter=S0.getAdapter;I.HttpStatusCode=t1;I.default=I;var B=I;var Y1={};k0(Y1,{updateTemplate:()=>G2,updateOrgMember:()=>e5,updateOrg:()=>n5,updateCurrentUserEmail:()=>M2,updateCurrentUser:()=>W2,updateAgentStatus:()=>x5,updateAgent:()=>C5,signup:()=>f5,revokeApiKey:()=>b5,removeOrgMember:()=>o5,logoutAll:()=>v5,logout:()=>h5,login:()=>m5,listUserTemplates:()=>K2,listUserAgents:()=>J2,listOrgs:()=>d5,listOrgTemplates:()=>$2,listOrgMembers:()=>s5,listOrgAgents:()=>t5,listMessages:()=>c5,listConversations:()=>A5,listApiKeys:()=>j5,lintAgent:()=>k5,getUser:()=>H2,getTemplate:()=>Z2,getOrg:()=>i5,getCurrentUser:()=>X2,getConversation:()=>u5,getAgent:()=>T5,deleteTemplate:()=>Y2,deleteOrg:()=>p5,deleteCurrentUser:()=>z2,deleteConversation:()=>g5,deleteAgent:()=>O5,createUserTemplate:()=>V2,createUserAgent:()=>N2,createOrgTemplate:()=>Q2,createOrgAgent:()=>a5,createOrg:()=>l5,createApiKey:()=>y5,addOrgMember:()=>r5,UpdateMemberInBodyRole:()=>E5,UpdateAgentStatusInBodyStatus:()=>D5,AddMemberInBodyRole:()=>S5});var S5={admin:"admin",member:"member",viewer:"viewer"},D5={draft:"draft",live:"live",archived:"archived"},E5={owner:"owner",admin:"admin",member:"member",viewer:"viewer"},O5=($,Q)=>{return B.delete(`/agents/${$}`,Q)},T5=($,Q)=>{return B.get(`/agents/${$}`,Q)},C5=($,Q,Y)=>{return B.patch(`/agents/${$}`,Q,Y)},A5=($,Q,Y)=>{return B.get(`/agents/${$}/conversations`,{...Y,params:{...Q,...Y?.params}})},k5=($,Q,Y)=>{return B.post(`/agents/${$}/lint`,Q,Y)},x5=($,Q,Y)=>{return B.patch(`/agents/${$}/status`,Q,Y)},j5=($)=>{return B.get("/auth/api-keys",$)},y5=($,Q)=>{return B.post("/auth/api-keys",$,Q)},b5=($,Q)=>{return B.delete(`/auth/api-keys/${$}`,Q)},v5=($)=>{return B.delete("/auth/sessions",$)},m5=($,Q)=>{return B.post("/auth/sessions",$,Q)},h5=($)=>{return B.delete("/auth/sessions/me",$)},f5=($,Q)=>{return B.post("/auth/signup",$,Q)},g5=($,Q)=>{return B.delete(`/conversations/${$}`,Q)},u5=($,Q)=>{return B.get(`/conversations/${$}`,Q)},c5=($,Q,Y)=>{return B.get(`/conversations/${$}/messages`,{...Y,params:{...Q,...Y?.params}})},d5=($)=>{return B.get("/orgs",$)},l5=($,Q)=>{return B.post("/orgs",$,Q)},p5=($,Q)=>{return B.delete(`/orgs/${$}`,Q)},i5=($,Q)=>{return B.get(`/orgs/${$}`,Q)},n5=($,Q,Y)=>{return B.patch(`/orgs/${$}`,Q,Y)},t5=($,Q,Y)=>{return B.get(`/orgs/${$}/agents`,{...Y,params:{...Q,...Y?.params}})},a5=($,Q,Y)=>{return B.post(`/orgs/${$}/agents`,Q,Y)},s5=($,Q)=>{return B.get(`/orgs/${$}/members`,Q)},r5=($,Q,Y)=>{return B.post(`/orgs/${$}/members`,Q,Y)},o5=($,Q,Y)=>{return B.delete(`/orgs/${$}/members/${Q}`,Y)},e5=($,Q,Y,Z)=>{return B.patch(`/orgs/${$}/members/${Q}`,Y,Z)},$2=($,Q,Y)=>{return B.get(`/orgs/${$}/templates`,{...Y,params:{...Q,...Y?.params}})},Q2=($,Q,Y)=>{return B.post(`/orgs/${$}/templates`,Q,Y)},Y2=($,Q)=>{return B.delete(`/templates/${$}`,Q)},Z2=($,Q)=>{return B.get(`/templates/${$}`,Q)},G2=($,Q,Y)=>{return B.patch(`/templates/${$}`,Q,Y)},z2=($)=>{return B.delete("/users/me",$)},X2=($)=>{return B.get("/users/me",$)},W2=($,Q)=>{return B.patch("/users/me",$,Q)},J2=($,Q)=>{return B.get("/users/me/agents",{...Q,params:{...$,...Q?.params}})},N2=($,Q)=>{return B.post("/users/me/agents",$,Q)},M2=($,Q)=>{return B.patch("/users/me/email",$,Q)},K2=($,Q)=>{return B.get("/users/me/templates",{...Q,params:{...$,...Q?.params}})},V2=($,Q)=>{return B.post("/users/me/templates",$,Q)},H2=($,Q)=>{return B.get(`/users/${$}`,Q)};class M0{_transport;_conversationId;_closed=!1;_onEvent;_pendingAudioMetadata=null;_remainingMs=0;_elapsedMs=0;get conversationId(){return this._conversationId}get remainingMs(){return this._remainingMs}get elapsedMs(){return this._elapsedMs}get closed(){return this._closed}constructor($,Q,Y){this._transport=$,this._conversationId=Q,this._onEvent=Y.onEvent,this.#$()}sendText($){if(this._closed){console.warn("Cannot send text: session is closed");return}this._transport.send({type:"input_text",text:$})}sendAudio($){if(this._closed){console.warn("Cannot send audio: session is closed");return}this._transport.send({type:"input_audio"}),this._transport.sendBinary($)}streamAudio($){if(this._closed){console.warn("Cannot stream audio: session is closed");return}this._transport.send({type:"input_audio_stream"}),this._transport.sendBinary($)}cancelRequest(){if(this._closed){console.warn("Cannot cancel request: session is closed");return}this._transport.send({type:"cancel"})}end(){if(this._closed){console.warn("Cannot end session: session is closed");return}this._transport.send({type:"end"})}close(){if(this._closed)return;this._closed=!0,this._transport.close()}#$(){this._transport.onMessage(($)=>{let Q=$;if(Q.type==="audio_delta"){this._pendingAudioMetadata={size:Q.size};return}if(Q.type==="tick")this._remainingMs=Q.remaining_ms,this._elapsedMs=Q.elapsed_ms;if(Q.type==="session_closed")this._closed=!0;this._onEvent?.(Q)}),this._transport.onBinary(($)=>{if(this._pendingAudioMetadata){let Q={type:"audio_delta",size:this._pendingAudioMetadata.size,audio:$};this._pendingAudioMetadata=null,this._onEvent?.(Q)}}),this._transport.onClose(()=>{if(this._closed)return;this._closed=!0,this._onEvent?.({type:"connection_lost",reason:"socket_closed"})}),this._transport.onError(()=>{if(this._closed)return;this._closed=!0,this._onEvent?.({type:"connection_lost",reason:"socket_error"})})}}class v extends Error{code;constructor($,Q="TRANSPORT_ERROR"){super($);this.code=Q;this.name="ConversationTransportError"}}class Z1{_ws;_closed=!1;_onMessage=null;_onBinary=null;_onError=null;_onClose=null;constructor($){this._ws=$}async connect(){if(this._ws.readyState===WebSocket.OPEN)throw new v("Already connected","ALREADY_CONNECTED");if(this._ws.readyState===WebSocket.CLOSING||this._ws.readyState===WebSocket.CLOSED)throw new v("Socket is closing or closed","SOCKET_CLOSED");return new Promise(($,Q)=>{let Y,Z;Y=()=>{this._ws.removeEventListener("open",Y),this._ws.removeEventListener("error",Z),this.#$(),$()},Z=()=>{this._ws.removeEventListener("open",Y),this._ws.removeEventListener("error",Z),Q(new v("Connection failed","CONNECTION_FAILED"))},this._ws.addEventListener("open",Y),this._ws.addEventListener("error",Z)})}send($){if(this._ws.readyState!==WebSocket.OPEN)throw new v("Not connected","NOT_CONNECTED");this._ws.send(JSON.stringify($))}async sendBinary($){if(this._ws.readyState!==WebSocket.OPEN)throw new v("Not connected","NOT_CONNECTED");let Q=await $.arrayBuffer();this._ws.send(Q)}onMessage($){this._onMessage=$}onBinary($){this._onBinary=$}onError($){this._onError=$}onClose($){this._onClose=$}close(){if(this._closed)return;if(this._closed=!0,this._ws.readyState===WebSocket.OPEN||this._ws.readyState===WebSocket.CONNECTING)this._ws.close();this._onClose?.()}#$(){this._ws.addEventListener("message",($)=>{if($.data instanceof Blob)this._onBinary?.($.data);else if($.data instanceof ArrayBuffer)this._onBinary?.(new Blob([$.data]));else if(typeof $.data==="string")try{let Q=JSON.parse($.data);this._onMessage?.(Q)}catch(Q){console.warn("Failed to parse JSON message:",$.data,Q)}}),this._ws.addEventListener("error",()=>{if(this._closed)return;this._onError?.(new v("WebSocket error")),this.close()}),this._ws.addEventListener("close",()=>{if(this._closed)return;this.close()})}}class G1{#$;constructor($){this.#$=$}async connect($){let Q=this.#Q("/conversations/ws"),Y=new Z1(new WebSocket(Q));return await Y.connect(),Y.send({type:"handshake",agent_id:$.agent_id,channel:$.channel}),new Promise((Z,G)=>{let W=!1;Y.onMessage((z)=>{switch(z.type){case"handshake_ok":W=!0,$.onConnection?.(z),Z(new M0(Y,z.conversation_id,$));break;case"handshake_error":W=!0,$.onConnection?.(z),Y.close(),G(Error(`Handshake rejected: ${z.reason}`));break;default:}}),Y.onError((z)=>{if(!W)G(z)}),Y.onClose(()=>{if(!W)G(Error("Connection lost during handshake"))})})}#Q($){return`${this.#$.replace(/^https:\/\//,"wss://").replace(/^http:\/\//,"ws://").replace(/\/$/,"")}${$}`}}var s1="https://server.kivox.com.co";function r1($,Q){$.interceptors.request.use((G)=>G),B.defaults.baseURL=Q,B.defaults.withCredentials=$.defaults.withCredentials??!1;let Y=$.defaults.headers?.Authorization;if(Y)B.defaults.headers.common.Authorization=Y;let Z={realtime:new G1(Q)};return new Proxy({...Z},{get(G,W){if(W in G)return G[W];let z=Y1[W];if(typeof z==="function")return(...J)=>z(...J,{axios:$});return z}})}function B2({baseUrl:$=s1}={}){let Q=B.create({baseURL:$,withCredentials:!0});return r1(Q,$)}function P2({apiKey:$,baseUrl:Q=s1}){let Y=B.create({baseURL:Q,headers:{Authorization:`Bearer ${$}`}});return r1(Y,Q)}
|