@tarxemo/customer_support 1.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.
@@ -0,0 +1,73 @@
1
+ (function(P,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],S):(P=typeof globalThis<"u"?globalThis:P||self,S(P.CustomerSupport={},P.React))})(this,(function(P,S){"use strict";var Sn=Object.defineProperty;var _n=(P,S,q)=>S in P?Sn(P,S,{enumerable:!0,configurable:!0,writable:!0,value:q}):P[S]=q;var Ft=(P,S,q)=>_n(P,typeof S!="symbol"?S+"":S,q);var q={exports:{}},te={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Me;function Ut(){if(Me)return te;Me=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:n,key:i,ref:s!==void 0?s:null,props:o}}return te.Fragment=t,te.jsx=r,te.jsxs=r,te}var re={};/**
10
+ * @license React
11
+ * react-jsx-runtime.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var He;function vt(){return He||(He=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Te?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case h:return"Fragment";case C:return"Profiler";case _:return"StrictMode";case B:return"Suspense";case U:return"SuspenseList";case _e:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case y:return"Portal";case T:return l.displayName||"Context";case w:return(l._context.displayName||"Context")+".Consumer";case j:var E=l.render;return l=l.displayName,l||(l=E.displayName||E.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case ue:return E=l.displayName||null,E!==null?E:e(l.type)||"Memo";case $:E=l._payload,l=l._init;try{return e(l(E))}catch{}}return null}function t(l){return""+l}function r(l){try{t(l);var E=!1}catch{E=!0}if(E){E=console;var O=E.error,x=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return O.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",x),t(l)}}function n(l){if(l===h)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===$)return"<...>";try{var E=e(l);return E?"<"+E+">":"<...>"}catch{return"<...>"}}function s(){var l=J.A;return l===null?null:l.getOwner()}function o(){return Error("react-stack-top-frame")}function i(l){if(V.call(l,"key")){var E=Object.getOwnPropertyDescriptor(l,"key").get;if(E&&E.isReactWarning)return!1}return l.key!==void 0}function a(l,E){function O(){v||(v=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}O.isReactWarning=!0,Object.defineProperty(l,"key",{get:O,configurable:!0})}function p(){var l=e(this.type);return fe[l]||(fe[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function f(l,E,O,x,X,Ie){var k=O.ref;return l={$$typeof:d,type:l,key:E,props:O,_owner:x},(k!==void 0?k:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:p}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ie}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function u(l,E,O,x,X,Ie){var k=E.children;if(k!==void 0)if(x)if(z(k)){for(x=0;x<k.length;x++)m(k[x]);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(k);if(V.call(E,"key")){k=e(l);var ee=Object.keys(E).filter(function(Rn){return Rn!=="key"});x=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",Oe[k+x]||(ee=0<ee.length?"{"+ee.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
+ let props = %s;
19
+ <%s {...props} />
20
+ React keys must be passed directly to JSX without using spread:
21
+ let props = %s;
22
+ <%s key={someKey} {...props} />`,x,k,ee,k),Oe[k+x]=!0)}if(k=null,O!==void 0&&(r(O),k=""+O),i(E)&&(r(E.key),k=""+E.key),"key"in E){O={};for(var Be in E)Be!=="key"&&(O[Be]=E[Be])}else O=E;return k&&a(O,typeof l=="function"?l.displayName||l.name||"Unknown":l),f(l,k,O,s(),X,Ie)}function m(l){g(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===$&&(l._payload.status==="fulfilled"?g(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function g(l){return typeof l=="object"&&l!==null&&l.$$typeof===d}var A=S,d=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),T=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),Te=Symbol.for("react.client.reference"),J=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=Object.prototype.hasOwnProperty,z=Array.isArray,Q=console.createTask?console.createTask:function(){return null};A={react_stack_bottom_frame:function(l){return l()}};var v,fe={},M=A.react_stack_bottom_frame.bind(A,o)(),de=Q(n(o)),Oe={};re.Fragment=h,re.jsx=function(l,E,O){var x=1e4>J.recentlyCreatedOwnerStacks++;return u(l,E,O,!1,x?Error("react-stack-top-frame"):M,x?Q(n(l)):de)},re.jsxs=function(l,E,O){var x=1e4>J.recentlyCreatedOwnerStacks++;return u(l,E,O,!0,x?Error("react-stack-top-frame"):M,x?Q(n(l)):de)}})()),re}var qe;function It(){return qe||(qe=1,process.env.NODE_ENV==="production"?q.exports=Ut():q.exports=vt()),q.exports}var R=It();/**
23
+ * @license lucide-react v0.469.0 - ISC
24
+ *
25
+ * This source code is licensed under the ISC license.
26
+ * See the LICENSE file in the root directory of this source tree.
27
+ */const Bt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ze=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/**
28
+ * @license lucide-react v0.469.0 - ISC
29
+ *
30
+ * This source code is licensed under the ISC license.
31
+ * See the LICENSE file in the root directory of this source tree.
32
+ */var Mt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
33
+ * @license lucide-react v0.469.0 - ISC
34
+ *
35
+ * This source code is licensed under the ISC license.
36
+ * See the LICENSE file in the root directory of this source tree.
37
+ */const Ht=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:o,iconNode:i,...a},p)=>S.createElement("svg",{ref:p,...Mt,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:ze("lucide",s),...a},[...i.map(([f,u])=>S.createElement(f,u)),...Array.isArray(o)?o:[o]]));/**
38
+ * @license lucide-react v0.469.0 - ISC
39
+ *
40
+ * This source code is licensed under the ISC license.
41
+ * See the LICENSE file in the root directory of this source tree.
42
+ */const ne=(e,t)=>{const r=S.forwardRef(({className:n,...s},o)=>S.createElement(Ht,{ref:o,iconNode:t,className:ze(`lucide-${Bt(e)}`,n),...s}));return r.displayName=`${e}`,r};/**
43
+ * @license lucide-react v0.469.0 - ISC
44
+ *
45
+ * This source code is licensed under the ISC license.
46
+ * See the LICENSE file in the root directory of this source tree.
47
+ */const qt=ne("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
48
+ * @license lucide-react v0.469.0 - ISC
49
+ *
50
+ * This source code is licensed under the ISC license.
51
+ * See the LICENSE file in the root directory of this source tree.
52
+ */const zt=ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
53
+ * @license lucide-react v0.469.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */const $t=ne("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
58
+ * @license lucide-react v0.469.0 - ISC
59
+ *
60
+ * This source code is licensed under the ISC license.
61
+ * See the LICENSE file in the root directory of this source tree.
62
+ */const Jt=ne("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
63
+ * @license lucide-react v0.469.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const Vt=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function $e(e,t){return function(){return e.apply(t,arguments)}}const{toString:Wt}=Object.prototype,{getPrototypeOf:Ae}=Object,{iterator:pe,toStringTag:Je}=Symbol,he=(e=>t=>{const r=Wt.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),I=e=>(e=e.toLowerCase(),t=>he(t)===e),me=e=>t=>typeof t===e,{isArray:G}=Array,Z=me("undefined");function se(e){return e!==null&&!Z(e)&&e.constructor!==null&&!Z(e.constructor)&&D(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ve=I("ArrayBuffer");function Kt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ve(e.buffer),t}const Yt=me("string"),D=me("function"),We=me("number"),oe=e=>e!==null&&typeof e=="object",Xt=e=>e===!0||e===!1,ye=e=>{if(he(e)!=="object")return!1;const t=Ae(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Je in e)&&!(pe in e)},Gt=e=>{if(!oe(e)||se(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Zt=I("Date"),Qt=I("File"),er=I("Blob"),tr=I("FileList"),rr=e=>oe(e)&&D(e.pipe),nr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||D(e.append)&&((t=he(e))==="formdata"||t==="object"&&D(e.toString)&&e.toString()==="[object FormData]"))},sr=I("URLSearchParams"),[or,ir,ar,cr]=["ReadableStream","Request","Response","Headers"].map(I),lr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ie(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,s;if(typeof e!="object"&&(e=[e]),G(e))for(n=0,s=e.length;n<s;n++)t.call(null,e[n],n,e);else{if(se(e))return;const o=r?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let a;for(n=0;n<i;n++)a=o[n],t.call(null,e[a],a,e)}}function Ke(e,t){if(se(e))return null;t=t.toLowerCase();const r=Object.keys(e);let n=r.length,s;for(;n-- >0;)if(s=r[n],t===s.toLowerCase())return s;return null}const W=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ye=e=>!Z(e)&&e!==W;function xe(){const{caseless:e,skipUndefined:t}=Ye(this)&&this||{},r={},n=(s,o)=>{const i=e&&Ke(r,o)||o;ye(r[i])&&ye(s)?r[i]=xe(r[i],s):ye(s)?r[i]=xe({},s):G(s)?r[i]=s.slice():(!t||!Z(s))&&(r[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&ie(arguments[s],n);return r}const ur=(e,t,r,{allOwnKeys:n}={})=>(ie(t,(s,o)=>{r&&D(s)?Object.defineProperty(e,o,{value:$e(s,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{value:s,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:n}),e),fr=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dr=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},pr=(e,t,r,n)=>{let s,o,i;const a={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!n||n(i,e,t))&&!a[i]&&(t[i]=e[i],a[i]=!0);e=r!==!1&&Ae(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},hr=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},mr=e=>{if(!e)return null;if(G(e))return e;let t=e.length;if(!We(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},yr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ae(Uint8Array)),wr=(e,t)=>{const n=(e&&e[pe]).call(e);let s;for(;(s=n.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},br=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},Er=I("HTMLFormElement"),gr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,s){return n.toUpperCase()+s}),Xe=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Rr=I("RegExp"),Ge=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};ie(r,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(n[o]=i||s)}),Object.defineProperties(e,n)},Sr=e=>{Ge(e,(t,r)=>{if(D(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(D(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},_r=(e,t)=>{const r={},n=s=>{s.forEach(o=>{r[o]=!0})};return G(e)?n(e):n(String(e).split(t)),r},Tr=()=>{},Or=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ar(e){return!!(e&&D(e.append)&&e[Je]==="FormData"&&e[pe])}const xr=e=>{const t=new Array(10),r=(n,s)=>{if(oe(n)){if(t.indexOf(n)>=0)return;if(se(n))return n;if(!("toJSON"in n)){t[s]=n;const o=G(n)?[]:{};return ie(n,(i,a)=>{const p=r(i,s+1);!Z(p)&&(o[a]=p)}),t[s]=void 0,o}}return n};return r(e,0)},Cr=I("AsyncFunction"),Nr=e=>e&&(oe(e)||D(e))&&D(e.then)&&D(e.catch),Ze=((e,t)=>e?setImmediate:t?((r,n)=>(W.addEventListener("message",({source:s,data:o})=>{s===W&&o===r&&n.length&&n.shift()()},!1),s=>{n.push(s),W.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",D(W.postMessage)),Pr=typeof queueMicrotask<"u"?queueMicrotask.bind(W):typeof process<"u"&&process.nextTick||Ze,c={isArray:G,isArrayBuffer:Ve,isBuffer:se,isFormData:nr,isArrayBufferView:Kt,isString:Yt,isNumber:We,isBoolean:Xt,isObject:oe,isPlainObject:ye,isEmptyObject:Gt,isReadableStream:or,isRequest:ir,isResponse:ar,isHeaders:cr,isUndefined:Z,isDate:Zt,isFile:Qt,isBlob:er,isRegExp:Rr,isFunction:D,isStream:rr,isURLSearchParams:sr,isTypedArray:yr,isFileList:tr,forEach:ie,merge:xe,extend:ur,trim:lr,stripBOM:fr,inherits:dr,toFlatObject:pr,kindOf:he,kindOfTest:I,endsWith:hr,toArray:mr,forEachEntry:wr,matchAll:br,isHTMLForm:Er,hasOwnProperty:Xe,hasOwnProp:Xe,reduceDescriptors:Ge,freezeMethods:Sr,toObjectSet:_r,toCamelCase:gr,noop:Tr,toFiniteNumber:Or,findKey:Ke,global:W,isContextDefined:Ye,isSpecCompliantForm:Ar,toJSONObject:xr,isAsyncFn:Cr,isThenable:Nr,setImmediate:Ze,asap:Pr,isIterable:e=>e!=null&&D(e[pe])};let b=class Dt extends Error{static from(t,r,n,s,o,i){const a=new Dt(t.message,r||t.code,n,s,o);return a.cause=t,a.name=t.name,i&&Object.assign(a,i),a}constructor(t,r,n,s,o){super(t),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),n&&(this.config=n),s&&(this.request=s),o&&(this.response=o,this.status=o.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:c.toJSONObject(this.config),code:this.code,status:this.status}}};b.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",b.ERR_BAD_OPTION="ERR_BAD_OPTION",b.ECONNABORTED="ECONNABORTED",b.ETIMEDOUT="ETIMEDOUT",b.ERR_NETWORK="ERR_NETWORK",b.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",b.ERR_DEPRECATED="ERR_DEPRECATED",b.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",b.ERR_BAD_REQUEST="ERR_BAD_REQUEST",b.ERR_CANCELED="ERR_CANCELED",b.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",b.ERR_INVALID_URL="ERR_INVALID_URL";const kr=null;function Ce(e){return c.isPlainObject(e)||c.isArray(e)}function Qe(e){return c.endsWith(e,"[]")?e.slice(0,-2):e}function et(e,t,r){return e?e.concat(t).map(function(s,o){return s=Qe(s),!r&&o?"["+s+"]":s}).join(r?".":""):t}function jr(e){return c.isArray(e)&&!e.some(Ce)}const Fr=c.toFlatObject(c,{},null,function(t){return/^is[A-Z]/.test(t)});function we(e,t,r){if(!c.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=c.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,h){return!c.isUndefined(h[y])});const n=r.metaTokens,s=r.visitor||u,o=r.dots,i=r.indexes,p=(r.Blob||typeof Blob<"u"&&Blob)&&c.isSpecCompliantForm(t);if(!c.isFunction(s))throw new TypeError("visitor must be a function");function f(d){if(d===null)return"";if(c.isDate(d))return d.toISOString();if(c.isBoolean(d))return d.toString();if(!p&&c.isBlob(d))throw new b("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(d)||c.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function u(d,y,h){let _=d;if(d&&!h&&typeof d=="object"){if(c.endsWith(y,"{}"))y=n?y:y.slice(0,-2),d=JSON.stringify(d);else if(c.isArray(d)&&jr(d)||(c.isFileList(d)||c.endsWith(y,"[]"))&&(_=c.toArray(d)))return y=Qe(y),_.forEach(function(w,T){!(c.isUndefined(w)||w===null)&&t.append(i===!0?et([y],T,o):i===null?y:y+"[]",f(w))}),!1}return Ce(d)?!0:(t.append(et(h,y,o),f(d)),!1)}const m=[],g=Object.assign(Fr,{defaultVisitor:u,convertValue:f,isVisitable:Ce});function A(d,y){if(!c.isUndefined(d)){if(m.indexOf(d)!==-1)throw Error("Circular reference detected in "+y.join("."));m.push(d),c.forEach(d,function(_,C){(!(c.isUndefined(_)||_===null)&&s.call(t,_,c.isString(C)?C.trim():C,y,g))===!0&&A(_,y?y.concat(C):[C])}),m.pop()}}if(!c.isObject(e))throw new TypeError("data must be an object");return A(e),t}function tt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Ne(e,t){this._pairs=[],e&&we(e,this,t)}const rt=Ne.prototype;rt.append=function(t,r){this._pairs.push([t,r])},rt.toString=function(t){const r=t?function(n){return t.call(this,n,tt)}:tt;return this._pairs.map(function(s){return r(s[0])+"="+r(s[1])},"").join("&")};function Dr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function nt(e,t,r){if(!t)return e;const n=r&&r.encode||Dr,s=c.isFunction(r)?{serialize:r}:r,o=s&&s.serialize;let i;if(o?i=o(t,s):i=c.isURLSearchParams(t)?t.toString():new Ne(t,s).toString(n),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class st{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){c.forEach(this.handlers,function(n){n!==null&&t(n)})}}const ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Lr={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Ne,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Pe=typeof window<"u"&&typeof document<"u",ke=typeof navigator=="object"&&navigator||void 0,Ur=Pe&&(!ke||["ReactNative","NativeScript","NS"].indexOf(ke.product)<0),vr=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ir=Pe&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Pe,hasStandardBrowserEnv:Ur,hasStandardBrowserWebWorkerEnv:vr,navigator:ke,origin:Ir},Symbol.toStringTag,{value:"Module"})),...Lr};function Br(e,t){return we(e,new F.classes.URLSearchParams,{visitor:function(r,n,s,o){return F.isNode&&c.isBuffer(r)?(this.append(n,r.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function Mr(e){return c.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Hr(e){const t={},r=Object.keys(e);let n;const s=r.length;let o;for(n=0;n<s;n++)o=r[n],t[o]=e[o];return t}function it(e){function t(r,n,s,o){let i=r[o++];if(i==="__proto__")return!0;const a=Number.isFinite(+i),p=o>=r.length;return i=!i&&c.isArray(s)?s.length:i,p?(c.hasOwnProp(s,i)?s[i]=[s[i],n]:s[i]=n,!a):((!s[i]||!c.isObject(s[i]))&&(s[i]=[]),t(r,n,s[i],o)&&c.isArray(s[i])&&(s[i]=Hr(s[i])),!a)}if(c.isFormData(e)&&c.isFunction(e.entries)){const r={};return c.forEachEntry(e,(n,s)=>{t(Mr(n),s,r,0)}),r}return null}function qr(e,t,r){if(c.isString(e))try{return(t||JSON.parse)(e),c.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const ae={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",s=n.indexOf("application/json")>-1,o=c.isObject(t);if(o&&c.isHTMLForm(t)&&(t=new FormData(t)),c.isFormData(t))return s?JSON.stringify(it(t)):t;if(c.isArrayBuffer(t)||c.isBuffer(t)||c.isStream(t)||c.isFile(t)||c.isBlob(t)||c.isReadableStream(t))return t;if(c.isArrayBufferView(t))return t.buffer;if(c.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return Br(t,this.formSerializer).toString();if((a=c.isFileList(t))||n.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return we(a?{"files[]":t}:t,p&&new p,this.formSerializer)}}return o||s?(r.setContentType("application/json",!1),qr(t)):t}],transformResponse:[function(t){const r=this.transitional||ae.transitional,n=r&&r.forcedJSONParsing,s=this.responseType==="json";if(c.isResponse(t)||c.isReadableStream(t))return t;if(t&&c.isString(t)&&(n&&!this.responseType||s)){const i=!(r&&r.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(a){if(i)throw a.name==="SyntaxError"?b.from(a,b.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],e=>{ae.headers[e]={}});const zr=c.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"]),$r=e=>{const t={};let r,n,s;return e&&e.split(`
68
+ `).forEach(function(i){s=i.indexOf(":"),r=i.substring(0,s).trim().toLowerCase(),n=i.substring(s+1).trim(),!(!r||t[r]&&zr[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},at=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function be(e){return e===!1||e==null?e:c.isArray(e)?e.map(be):String(e)}function Jr(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const Vr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function je(e,t,r,n,s){if(c.isFunction(n))return n.call(this,t,r);if(s&&(t=r),!!c.isString(t)){if(c.isString(n))return t.indexOf(n)!==-1;if(c.isRegExp(n))return n.test(t)}}function Wr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function Kr(e,t){const r=c.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(s,o,i){return this[n].call(this,t,s,o,i)},configurable:!0})})}let L=class{constructor(t){t&&this.set(t)}set(t,r,n){const s=this;function o(a,p,f){const u=ce(p);if(!u)throw new Error("header name must be a non-empty string");const m=c.findKey(s,u);(!m||s[m]===void 0||f===!0||f===void 0&&s[m]!==!1)&&(s[m||p]=be(a))}const i=(a,p)=>c.forEach(a,(f,u)=>o(f,u,p));if(c.isPlainObject(t)||t instanceof this.constructor)i(t,r);else if(c.isString(t)&&(t=t.trim())&&!Vr(t))i($r(t),r);else if(c.isObject(t)&&c.isIterable(t)){let a={},p,f;for(const u of t){if(!c.isArray(u))throw TypeError("Object iterator must return a key-value pair");a[f=u[0]]=(p=a[f])?c.isArray(p)?[...p,u[1]]:[p,u[1]]:u[1]}i(a,r)}else t!=null&&o(r,t,n);return this}get(t,r){if(t=ce(t),t){const n=c.findKey(this,t);if(n){const s=this[n];if(!r)return s;if(r===!0)return Jr(s);if(c.isFunction(r))return r.call(this,s,n);if(c.isRegExp(r))return r.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ce(t),t){const n=c.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||je(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let s=!1;function o(i){if(i=ce(i),i){const a=c.findKey(n,i);a&&(!r||je(n,n[a],a,r))&&(delete n[a],s=!0)}}return c.isArray(t)?t.forEach(o):o(t),s}clear(t){const r=Object.keys(this);let n=r.length,s=!1;for(;n--;){const o=r[n];(!t||je(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const r=this,n={};return c.forEach(this,(s,o)=>{const i=c.findKey(n,o);if(i){r[i]=be(s),delete r[o];return}const a=t?Wr(o):String(o).trim();a!==o&&delete r[o],r[a]=be(s),n[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return c.forEach(this,(n,s)=>{n!=null&&n!==!1&&(r[s]=t&&c.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(`
69
+ `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(s=>n.set(s)),n}static accessor(t){const n=(this[at]=this[at]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=ce(i);n[a]||(Kr(s,i),n[a]=!0)}return c.isArray(t)?t.forEach(o):o(t),this}};L.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(L.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(L);function Fe(e,t){const r=this||ae,n=t||r,s=L.from(n.headers);let o=n.data;return c.forEach(e,function(a){o=a.call(r,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function ct(e){return!!(e&&e.__CANCEL__)}let le=class extends b{constructor(t,r,n){super(t??"canceled",b.ERR_CANCELED,r,n),this.name="CanceledError",this.__CANCEL__=!0}};function lt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new b("Request failed with status code "+r.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function Yr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Xr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(p){const f=Date.now(),u=n[o];i||(i=f),r[s]=p,n[s]=f;let m=o,g=0;for(;m!==s;)g+=r[m++],m=m%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-i<t)return;const A=u&&f-u;return A?Math.round(g*1e3/A):void 0}}function Gr(e,t){let r=0,n=1e3/t,s,o;const i=(f,u=Date.now())=>{r=u,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const u=Date.now(),m=u-r;m>=n?i(f,u):(s=f,o||(o=setTimeout(()=>{o=null,i(s)},n-m)))},()=>s&&i(s)]}const Ee=(e,t,r=3)=>{let n=0;const s=Xr(50,250);return Gr(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,p=i-n,f=s(p),u=i<=a;n=i;const m={loaded:i,total:a,progress:a?i/a:void 0,bytes:p,rate:f||void 0,estimated:f&&a&&u?(a-i)/f:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(m)},r)},ut=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},ft=e=>(...t)=>c.asap(()=>e(...t)),Zr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,s,o,i){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(s)&&a.push(`domain=${s}`),o===!0&&a.push("secure"),c.isString(i)&&a.push(`SameSite=${i}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function en(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function tn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function dt(e,t,r){let n=!en(t);return e&&(n||r==!1)?tn(e,t):t}const pt=e=>e instanceof L?{...e}:e;function K(e,t){t=t||{};const r={};function n(f,u,m,g){return c.isPlainObject(f)&&c.isPlainObject(u)?c.merge.call({caseless:g},f,u):c.isPlainObject(u)?c.merge({},u):c.isArray(u)?u.slice():u}function s(f,u,m,g){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f,m,g)}else return n(f,u,m,g)}function o(f,u){if(!c.isUndefined(u))return n(void 0,u)}function i(f,u){if(c.isUndefined(u)){if(!c.isUndefined(f))return n(void 0,f)}else return n(void 0,u)}function a(f,u,m){if(m in t)return n(f,u);if(m in e)return n(void 0,f)}const p={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(f,u,m)=>s(pt(f),pt(u),m,!0)};return c.forEach(Object.keys({...e,...t}),function(u){const m=p[u]||s,g=m(e[u],t[u],u);c.isUndefined(g)&&m!==a||(r[u]=g)}),r}const ht=e=>{const t=K({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:a}=t;if(t.headers=i=L.from(i),t.url=nt(dt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const p=r.getHeaders(),f=["content-type","content-length"];Object.entries(p).forEach(([u,m])=>{f.includes(u.toLowerCase())&&i.set(u,m)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Zr(t.url))){const p=s&&o&&Qr.read(o);p&&i.set(s,p)}return t},rn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const s=ht(e);let o=s.data;const i=L.from(s.headers).normalize();let{responseType:a,onUploadProgress:p,onDownloadProgress:f}=s,u,m,g,A,d;function y(){A&&A(),d&&d(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let h=new XMLHttpRequest;h.open(s.method.toUpperCase(),s.url,!0),h.timeout=s.timeout;function _(){if(!h)return;const w=L.from("getAllResponseHeaders"in h&&h.getAllResponseHeaders()),j={data:!a||a==="text"||a==="json"?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:w,config:e,request:h};lt(function(U){r(U),y()},function(U){n(U),y()},j),h=null}"onloadend"in h?h.onloadend=_:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf("file:")===0)||setTimeout(_)},h.onabort=function(){h&&(n(new b("Request aborted",b.ECONNABORTED,e,h)),h=null)},h.onerror=function(T){const j=T&&T.message?T.message:"Network Error",B=new b(j,b.ERR_NETWORK,e,h);B.event=T||null,n(B),h=null},h.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const j=s.transitional||ot;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),n(new b(T,j.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,e,h)),h=null},o===void 0&&i.setContentType(null),"setRequestHeader"in h&&c.forEach(i.toJSON(),function(T,j){h.setRequestHeader(j,T)}),c.isUndefined(s.withCredentials)||(h.withCredentials=!!s.withCredentials),a&&a!=="json"&&(h.responseType=s.responseType),f&&([g,d]=Ee(f,!0),h.addEventListener("progress",g)),p&&h.upload&&([m,A]=Ee(p),h.upload.addEventListener("progress",m),h.upload.addEventListener("loadend",A)),(s.cancelToken||s.signal)&&(u=w=>{h&&(n(!w||w.type?new le(null,e,h):w),h.abort(),h=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const C=Yr(s.url);if(C&&F.protocols.indexOf(C)===-1){n(new b("Unsupported protocol "+C+":",b.ERR_BAD_REQUEST,e));return}h.send(o||null)})},nn=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,s;const o=function(f){if(!s){s=!0,a();const u=f instanceof Error?f:this.reason;n.abort(u instanceof b?u:new le(u instanceof Error?u.message:u))}};let i=t&&setTimeout(()=>{i=null,o(new b(`timeout of ${t}ms exceeded`,b.ETIMEDOUT))},t);const a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:p}=n;return p.unsubscribe=()=>c.asap(a),p}},sn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,s;for(;n<r;)s=n+t,yield e.slice(n,s),n=s},on=async function*(e,t){for await(const r of an(e))yield*sn(r,t)},an=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},mt=(e,t,r,n)=>{const s=on(e,t);let o=0,i,a=p=>{i||(i=!0,n&&n(p))};return new ReadableStream({async pull(p){try{const{done:f,value:u}=await s.next();if(f){a(),p.close();return}let m=u.byteLength;if(r){let g=o+=m;r(g)}p.enqueue(new Uint8Array(u))}catch(f){throw a(f),f}},cancel(p){return a(p),s.return()}},{highWaterMark:2})},yt=64*1024,{isFunction:ge}=c,cn=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:wt,TextEncoder:bt}=c.global,Et=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ln=e=>{e=c.merge.call({skipUndefined:!0},cn,e);const{fetch:t,Request:r,Response:n}=e,s=t?ge(t):typeof fetch=="function",o=ge(r),i=ge(n);if(!s)return!1;const a=s&&ge(wt),p=s&&(typeof bt=="function"?(d=>y=>d.encode(y))(new bt):async d=>new Uint8Array(await new r(d).arrayBuffer())),f=o&&a&&Et(()=>{let d=!1;const y=new r(F.origin,{body:new wt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!y}),u=i&&a&&Et(()=>c.isReadableStream(new n("").body)),m={stream:u&&(d=>d.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!m[d]&&(m[d]=(y,h)=>{let _=y&&y[d];if(_)return _.call(y);throw new b(`Response type '${d}' is not supported`,b.ERR_NOT_SUPPORT,h)})});const g=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await p(d)).byteLength},A=async(d,y)=>{const h=c.toFiniteNumber(d.getContentLength());return h??g(y)};return async d=>{let{url:y,method:h,data:_,signal:C,cancelToken:w,timeout:T,onDownloadProgress:j,onUploadProgress:B,responseType:U,headers:ue,withCredentials:$="same-origin",fetchOptions:_e}=ht(d),Te=t||fetch;U=U?(U+"").toLowerCase():"text";let J=nn([C,w&&w.toAbortSignal()],T),V=null;const z=J&&J.unsubscribe&&(()=>{J.unsubscribe()});let Q;try{if(B&&f&&h!=="get"&&h!=="head"&&(Q=await A(ue,_))!==0){let l=new r(y,{method:"POST",body:_,duplex:"half"}),E;if(c.isFormData(_)&&(E=l.headers.get("content-type"))&&ue.setContentType(E),l.body){const[O,x]=ut(Q,Ee(ft(B)));_=mt(l.body,yt,O,x)}}c.isString($)||($=$?"include":"omit");const v=o&&"credentials"in r.prototype,fe={..._e,signal:J,method:h.toUpperCase(),headers:ue.normalize().toJSON(),body:_,duplex:"half",credentials:v?$:void 0};V=o&&new r(y,fe);let M=await(o?Te(V,_e):Te(y,fe));const de=u&&(U==="stream"||U==="response");if(u&&(j||de&&z)){const l={};["status","statusText","headers"].forEach(X=>{l[X]=M[X]});const E=c.toFiniteNumber(M.headers.get("content-length")),[O,x]=j&&ut(E,Ee(ft(j),!0))||[];M=new n(mt(M.body,yt,O,()=>{x&&x(),z&&z()}),l)}U=U||"text";let Oe=await m[c.findKey(m,U)||"text"](M,d);return!de&&z&&z(),await new Promise((l,E)=>{lt(l,E,{data:Oe,headers:L.from(M.headers),status:M.status,statusText:M.statusText,config:d,request:V})})}catch(v){throw z&&z(),v&&v.name==="TypeError"&&/Load failed|fetch/i.test(v.message)?Object.assign(new b("Network Error",b.ERR_NETWORK,d,V),{cause:v.cause||v}):b.from(v,v&&v.code,d,V)}}},un=new Map,gt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:s}=t,o=[n,s,r];let i=o.length,a=i,p,f,u=un;for(;a--;)p=o[a],f=u.get(p),f===void 0&&u.set(p,f=a?new Map:ln(t)),u=f;return f};gt();const De={http:kr,xhr:rn,fetch:{get:gt}};c.forEach(De,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Rt=e=>`- ${e}`,fn=e=>c.isFunction(e)||e===null||e===!1;function dn(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,s;const o={};for(let i=0;i<r;i++){n=e[i];let a;if(s=n,!fn(n)&&(s=De[(a=String(n)).toLowerCase()],s===void 0))throw new b(`Unknown adapter '${a}'`);if(s&&(c.isFunction(s)||(s=s.get(t))))break;o[a||"#"+i]=s}if(!s){const i=Object.entries(o).map(([p,f])=>`adapter ${p} `+(f===!1?"is not supported by the environment":"is not available in the build"));let a=r?i.length>1?`since :
70
+ `+i.map(Rt).join(`
71
+ `):" "+Rt(i[0]):"as no adapter specified";throw new b("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const St={getAdapter:dn,adapters:De};function Le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new le(null,e)}function _t(e){return Le(e),e.headers=L.from(e.headers),e.data=Fe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),St.getAdapter(e.adapter||ae.adapter,e)(e).then(function(n){return Le(e),n.data=Fe.call(e,e.transformResponse,n),n.headers=L.from(n.headers),n},function(n){return ct(n)||(Le(e),n&&n.response&&(n.response.data=Fe.call(e,e.transformResponse,n.response),n.response.headers=L.from(n.response.headers))),Promise.reject(n)})}const Tt="1.13.4",Re={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Re[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Ot={};Re.transitional=function(t,r,n){function s(o,i){return"[Axios v"+Tt+"] Transitional option '"+o+"'"+i+(n?". "+n:"")}return(o,i,a)=>{if(t===!1)throw new b(s(i," has been removed"+(r?" in "+r:"")),b.ERR_DEPRECATED);return r&&!Ot[i]&&(Ot[i]=!0,console.warn(s(i," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(o,i,a):!0}},Re.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function pn(e,t,r){if(typeof e!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let s=n.length;for(;s-- >0;){const o=n[s],i=t[o];if(i){const a=e[o],p=a===void 0||i(a,o,e);if(p!==!0)throw new b("option "+o+" must be "+p,b.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new b("Unknown option "+o,b.ERR_BAD_OPTION)}}const Se={assertOptions:pn,validators:Re},H=Se.validators;let Y=class{constructor(t){this.defaults=t||{},this.interceptors={request:new st,response:new st}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{n.stack?o&&!String(n.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(n.stack+=`
72
+ `+o):n.stack=o}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=K(this.defaults,r);const{transitional:n,paramsSerializer:s,headers:o}=r;n!==void 0&&Se.assertOptions(n,{silentJSONParsing:H.transitional(H.boolean),forcedJSONParsing:H.transitional(H.boolean),clarifyTimeoutError:H.transitional(H.boolean)},!1),s!=null&&(c.isFunction(s)?r.paramsSerializer={serialize:s}:Se.assertOptions(s,{encode:H.function,serialize:H.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Se.assertOptions(r,{baseUrl:H.spelling("baseURL"),withXsrfToken:H.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let i=o&&c.merge(o.common,o[r.method]);o&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete o[d]}),r.headers=L.concat(i,o);const a=[];let p=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(r)===!1||(p=p&&y.synchronous,a.unshift(y.fulfilled,y.rejected))});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let u,m=0,g;if(!p){const d=[_t.bind(this),void 0];for(d.unshift(...a),d.push(...f),g=d.length,u=Promise.resolve(r);m<g;)u=u.then(d[m++],d[m++]);return u}g=a.length;let A=r;for(;m<g;){const d=a[m++],y=a[m++];try{A=d(A)}catch(h){y.call(this,h);break}}try{u=_t.call(this,A)}catch(d){return Promise.reject(d)}for(m=0,g=f.length;m<g;)u=u.then(f[m++],f[m++]);return u}getUri(t){t=K(this.defaults,t);const r=dt(t.baseURL,t.url,t.allowAbsoluteUrls);return nt(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Y.prototype[t]=function(r,n){return this.request(K(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(o,i,a){return this.request(K(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}Y.prototype[t]=r(),Y.prototype[t+"Form"]=r(!0)});let hn=class Lt{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(o){r=o});const n=this;this.promise.then(s=>{if(!n._listeners)return;let o=n._listeners.length;for(;o-- >0;)n._listeners[o](s);n._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{n.subscribe(a),o=a}).then(s);return i.cancel=function(){n.unsubscribe(o)},i},t(function(o,i,a){n.reason||(n.reason=new le(o,i,a),r(n.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 r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Lt(function(s){t=s}),cancel:t}}};function mn(e){return function(r){return e.apply(null,r)}}function yn(e){return c.isObject(e)&&e.isAxiosError===!0}const Ue={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(Ue).forEach(([e,t])=>{Ue[t]=e});function At(e){const t=new Y(e),r=$e(Y.prototype.request,t);return c.extend(r,Y.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(s){return At(K(e,s))},r}const N=At(ae);N.Axios=Y,N.CanceledError=le,N.CancelToken=hn,N.isCancel=ct,N.VERSION=Tt,N.toFormData=we,N.AxiosError=b,N.Cancel=N.CanceledError,N.all=function(t){return Promise.all(t)},N.spread=mn,N.isAxiosError=yn,N.mergeConfig=K,N.AxiosHeaders=L,N.formToJSON=e=>it(c.isHTMLForm(e)?new FormData(e):e),N.getAdapter=St.getAdapter,N.HttpStatusCode=Ue,N.default=N;const{Axios:Pn,AxiosError:kn,CanceledError:jn,isCancel:Fn,CancelToken:Dn,VERSION:Ln,all:Un,Cancel:vn,isAxiosError:In,spread:Bn,toFormData:Mn,AxiosHeaders:Hn,HttpStatusCode:qn,formToJSON:zn,getAdapter:$n,mergeConfig:Jn}=N,wn="http://localhost:8000/api";class xt{constructor(t,r=wn){Ft(this,"client");this.client=N.create({baseURL:r,headers:{"Content-Type":"application/json","X-API-Key":t},timeout:3e4}),this.client.interceptors.response.use(n=>n,n=>{var s,o;if((s=n.response)!=null&&s.data){const a=((o=n.response.data.response)==null?void 0:o.message)||"An unknown error occurred";throw new Error(a)}else throw n.request?new Error("No response from server. Please check your connection."):new Error(n.message||"Request failed")})}async sendMessage(t,r){try{const n=await this.client.post("/chat/",{question:t,session_id:r});if(n.data.response.status!=="success")throw new Error(n.data.response.message);return n.data.data}catch(n){throw n instanceof Error?n:new Error("Failed to send message")}}async getConversationHistory(t){try{const r=await this.client.get(`/chat/history/${t}/`);if(r.data.response.status!=="success")throw new Error(r.data.response.message);return r.data.data}catch(r){throw r instanceof Error?r:new Error("Failed to load conversation history")}}updateApiKey(t){this.client.defaults.headers.common["X-API-Key"]=t}updateBaseUrl(t){this.client.defaults.baseURL=t}}function ve(e,t){const[r,n]=S.useState(()=>{try{const o=window.localStorage.getItem(e);return o?JSON.parse(o):t}catch(o){return console.warn(`Error reading localStorage key "${e}":`,o),t}});return[r,o=>{try{const i=o instanceof Function?o(r):o;n(i),window.localStorage.setItem(e,JSON.stringify(i))}catch(i){console.warn(`Error setting localStorage key "${e}":`,i)}}]}function Ct(){return`session_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}const bn="customer_support_session_id",En="customer_support_messages";function Nt(e){const{apiKey:t,baseUrl:r,onError:n}=e,[s,o]=ve(En,[]),[i,a]=ve(bn,Ct()),[p,f]=S.useState(!1),[u,m]=S.useState(null),g=S.useRef(null);S.useEffect(()=>{g.current=new xt(t,r)},[t,r]);const A=S.useCallback(()=>{m(null)},[]),d=S.useCallback(async _=>{if(!g.current){const w=new Error("API client not initialized");m(w),n==null||n(w);return}if(!_.trim())return;const C={id:`user_${Date.now()}`,role:"USER",content:_,timestamp:new Date};o(w=>[...w,C]),f(!0),m(null);try{const w=await g.current.sendMessage(_,i),T={id:`assistant_${Date.now()}`,role:"ASSISTANT",content:w.answer,timestamp:new Date,sources:w.sources};o(j=>[...j,T]),w.session_id!==i&&a(w.session_id)}catch(w){const T=w instanceof Error?w:new Error("Failed to send message");m(T),n==null||n(T);const j={id:`error_${Date.now()}`,role:"ASSISTANT",content:`Sorry, I encountered an error: ${T.message}`,timestamp:new Date};o(B=>[...B,j])}finally{f(!1)}},[i,n,o,a]),y=S.useCallback(async()=>{if(!(!g.current||!i)){f(!0),m(null);try{const C=(await g.current.getConversationHistory(i)).messages.map((w,T)=>({id:`${w.role.toLowerCase()}_${T}_${Date.now()}`,role:w.role,content:w.content,timestamp:new Date(w.created_at)}));o(C)}catch(_){const C=_ instanceof Error?_:new Error("Failed to load history");m(C),n==null||n(C)}finally{f(!1)}}},[i,n,o]),h=S.useCallback(()=>{o([]),a(Ct())},[o,a]);return{messages:s,sendMessage:d,isLoading:p,error:u,clearError:A,sessionId:i,loadHistory:y,clearHistory:h}}const Pt=({message:e})=>{const t=e.role==="USER";return R.jsxs("div",{className:`cs-message ${t?"cs-message--user":"cs-message--assistant"}`,children:[R.jsxs("div",{className:"cs-message__content",children:[R.jsx("p",{className:"cs-message__text",children:e.content}),e.sources&&e.sources.length>0&&R.jsxs("div",{className:"cs-message__sources",children:[R.jsx("p",{className:"cs-message__sources-title",children:"Sources:"}),R.jsx("ul",{className:"cs-message__sources-list",children:e.sources.map((r,n)=>R.jsxs("li",{className:"cs-message__source-item",children:[R.jsxs("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"cs-message__source-link",children:[R.jsx(qt,{size:12}),R.jsx("span",{children:r.title})]}),R.jsxs("span",{className:"cs-message__source-similarity",children:[Math.round(r.similarity*100),"% match"]})]},n))})]})]}),R.jsx("time",{className:"cs-message__time",children:e.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})},kt=({onSendMessage:e,isLoading:t,placeholder:r="Type your message..."})=>{const[n,s]=S.useState(""),o=a=>{a.preventDefault(),n.trim()&&!t&&(e(n),s(""))},i=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),o(a))};return R.jsxs("form",{className:"cs-input",onSubmit:o,children:[R.jsx("textarea",{className:"cs-input__textarea",value:n,onChange:a=>s(a.target.value),onKeyDown:i,placeholder:r,disabled:t,rows:1,"aria-label":"Message input"}),R.jsx("button",{type:"submit",className:"cs-input__button",disabled:!n.trim()||t,"aria-label":"Send message",children:R.jsx(Jt,{size:20})})]})},jt=({messages:e,onSendMessage:t,onClose:r,isLoading:n,error:s,placeholder:o,welcomeMessage:i="Hi! How can I help you today?"})=>{const a=S.useRef(null);return S.useEffect(()=>{var p;(p=a.current)==null||p.scrollIntoView({behavior:"smooth"})},[e]),R.jsxs("div",{className:"cs-window",children:[R.jsxs("div",{className:"cs-window__header",children:[R.jsx("h3",{className:"cs-window__title",children:"Customer Support"}),R.jsx("button",{className:"cs-window__close",onClick:r,"aria-label":"Close chat",children:R.jsx(Vt,{size:20})})]}),R.jsxs("div",{className:"cs-window__messages",children:[e.length===0&&!n&&R.jsx("div",{className:"cs-window__welcome",children:R.jsx("p",{children:i})}),e.map(p=>R.jsx(Pt,{message:p},p.id)),n&&R.jsxs("div",{className:"cs-window__typing",children:[R.jsx(zt,{size:20,className:"cs-window__typing-icon"}),R.jsx("span",{children:"Thinking..."})]}),s&&R.jsx("div",{className:"cs-window__error",children:R.jsx("p",{children:s.message})}),R.jsx("div",{ref:a})]}),R.jsx("div",{className:"cs-window__input-wrapper",children:R.jsx(kt,{onSendMessage:t,isLoading:n,placeholder:o})})]})},gn=({apiKey:e,baseUrl:t,theme:r,position:n="bottom-right",welcomeMessage:s,placeholder:o,className:i="",onError:a,onMessageSent:p,onMessageReceived:f})=>{const[u,m]=S.useState(!1),{messages:g,sendMessage:A,isLoading:d,error:y,clearError:h}=Nt({apiKey:e,baseUrl:t,onError:a});S.useEffect(()=>{if(r){const w=document.documentElement;r.primaryColor&&w.style.setProperty("--cs-primary-color",r.primaryColor),r.secondaryColor&&w.style.setProperty("--cs-secondary-color",r.secondaryColor),r.backgroundColor&&w.style.setProperty("--cs-bg-color",r.backgroundColor),r.textColor&&w.style.setProperty("--cs-text-color",r.textColor),r.fontFamily&&w.style.setProperty("--cs-font-family",r.fontFamily),r.borderRadius&&w.style.setProperty("--cs-border-radius",r.borderRadius),r.buttonColor&&w.style.setProperty("--cs-button-color",r.buttonColor),r.userMessageColor&&w.style.setProperty("--cs-user-message-color",r.userMessageColor),r.assistantMessageColor&&w.style.setProperty("--cs-assistant-message-color",r.assistantMessageColor)}},[r]);const _=async w=>{if(p==null||p(w),await A(w),!y){const T=g[g.length-1];(T==null?void 0:T.role)==="ASSISTANT"&&(f==null||f(T.content))}},C=()=>{m(!u),y&&h()};return R.jsxs("div",{className:`cs-widget cs-widget--${n} ${i}`,children:[u&&R.jsx(jt,{messages:g,onSendMessage:_,onClose:()=>m(!1),isLoading:d,error:y,placeholder:o,welcomeMessage:s}),R.jsxs("button",{className:`cs-widget__toggle ${u?"cs-widget__toggle--open":""}`,onClick:C,"aria-label":u?"Close chat":"Open chat","aria-expanded":u,children:[R.jsx($t,{size:24}),!u&&g.length>0&&R.jsx("span",{className:"cs-widget__badge",children:g.filter(w=>w.role==="ASSISTANT").length})]})]})};P.ChatInput=kt,P.ChatMessage=Pt,P.ChatWindow=jt,P.CustomerSupportAPIClient=xt,P.CustomerSupportWidget=gn,P.useCustomerSupport=Nt,P.useLocalStorage=ve,Object.defineProperty(P,Symbol.toStringTag,{value:"Module"})}));
73
+ //# sourceMappingURL=index.umd.js.map