@opencx/widget 2.4.4-rn.4 → 2.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  "name": "@opencx/widget",
3
3
  "private": false,
4
- "version": "2.4.4-rn.4",
4
+ "version": "2.4.4",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DXhwJWO6.cjs"),s=["monday","tuesday","wednesday","thursday","friday","saturday","sunday","WeekDays","Everyday"];exports.WidgetRoot=e.WidgetRoot;exports.useChat=e.useChat;exports.useConfigData=e.useConfigData;exports.useContact=e.useContact;exports.useDownvote=e.useDownvote;exports.useLocale=e.useLocale;exports.usePreludeData=e.usePreludeData;exports.useUploadFiles=e.useUploadFiles;exports.useUpvote=e.useUpvote;exports.useVote=e.useVote;exports.useWidgetSoundEffects=e.useWidgetSoundEffects;exports.workingDays=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAb3AX4O.cjs"),s=["monday","tuesday","wednesday","thursday","friday","saturday","sunday","WeekDays","Everyday"];exports.WidgetRoot=e.WidgetRoot;exports.useChat=e.useChat;exports.useConfigData=e.useConfigData;exports.useContact=e.useContact;exports.useDownvote=e.useDownvote;exports.useLocale=e.useLocale;exports.usePreludeData=e.usePreludeData;exports.useUploadFiles=e.useUploadFiles;exports.useUpvote=e.useUpvote;exports.useVote=e.useVote;exports.useWidgetSoundEffects=e.useWidgetSoundEffects;exports.workingDays=s;
2
2
  //# sourceMappingURL=react.cjs.map
package/dist/react.js CHANGED
@@ -1,4 +1,4 @@
1
- import { W as t, f as o, a as u, b as d, m as y, e as n, d as r, h as f, l as i, u as l, n as D } from "./index-B09TSjhG.js";
1
+ import { W as t, f as o, a as u, b as d, m as y, e as n, d as r, h as f, l as i, u as l, n as D } from "./index-B6Q20SQP.js";
2
2
  const a = [
3
3
  "monday",
4
4
  "tuesday",
@@ -14,7 +14,7 @@ var sae=Object.defineProperty;var lae=(Ei,Hr,Xn)=>Hr in Ei?sae(Ei,Hr,{enumerable
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var II=y,DI=Symbol.for("react.element"),LI=Symbol.for("react.fragment"),MI=Object.prototype.hasOwnProperty,FI=II.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BI={key:!0,ref:!0,__self:!0,__source:!0};function ov(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)MI.call(t,r)&&!BI.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:DI,type:e,key:a,ref:o,props:i,_owner:FI.current}}oc.Fragment=LI,oc.jsx=ov,oc.jsxs=ov,qy.exports=oc;var E=qy.exports;const jI="@opencx/widget",eh="2.4.4-rn.4",zI={name:jI,private:!1,version:eh,type:"module",publishConfig:{access:"public"},scripts:{clean:"rm -rf ./dist ./dist-embed","clean:dist":"rm -rf ./dist ./dist-embed",prepublishOnly:"pnpm clean && pnpm test && pnpm batman","build:lib":"vite build",dev:"vite -c vite.config.ts","build:embed":"vite build -c vite.embed.config.ts",test:"vitest run",batman:"pnpm build:lib && pnpm build:embed","test:watch":"vitest --watch",cs:"changeset",csv:"changeset version",csp:"changeset publish","type-check":"tsc --noEmit",lint:"biome lint --fix",format:"biome format --fix"},peerDependencies:{"lucide-react":"^0.412.0",react:"^18.3.1","rehype-raw":"^7.0.0"},peerDependenciesMeta:{react:{optional:!0}},optionalDependencies:{axios:"^1.7.5",zod:"^3.23.8"},dependencies:{"@radix-ui/react-avatar":"^1.1.0","@radix-ui/react-dropdown-menu":"^2.1.4","@radix-ui/react-slot":"^1.1.0","@radix-ui/react-switch":"^1.1.0","@radix-ui/react-tooltip":"^1.1.2",clsx:"^2.1.1","date-fns":"^4.1.0","framer-motion":"^11.3.30","lodash.isequal":"^4.5.0","lodash.set":"^4.3.2","lucide-react":"^0.436.0",mutative:"^1.0.11","react-dropzone":"^14.3.5","react-hot-toast":"^2.4.1",tinycolor2:"^1.6.0",zod:"^3.23.8"},overrides:{"@opencx/widget":{react:{optional:!0,dependencies:{"react-hot-toast":"^2.4.1","react-markdown":"^9.0.1","framer-motion":"^11.3.30","date-fns":"^4.1.0"}}}},conditionalDependencies:{react:{"react-hot-toast":"^2.4.1","react-markdown":"^9.0.1","framer-motion":"^11.3.30","date-fns":"^4.1.0"}},files:["dist","dist-embed"],bugs:{url:"https://github.com/openchatai/widget/issues"},author:{name:"openchatai",url:"https://github.com/openchatai"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./basic":{types:"./dist/basic.d.ts",import:"./dist/basic.js",require:"./dist/basic.cjs"},"./react":{types:"./dist/react.d.ts",import:"./dist/react.js",require:"./dist/react.cjs"},"./package.json":"./package.json","./dist/*.css":"./dist/*.css"},devDependencies:{"@biomejs/biome":"1.9.4","@changesets/cli":"^2.27.9","@radix-ui/react-popover":"^1.1.2","@tailwindcss/typography":"^0.5.15","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^16.0.1","@types/lodash.debounce":"^4.0.9","@types/lodash.isequal":"^4.5.8","@types/lodash.set":"^4.3.9","@types/node":"^20.14.8","@types/react":"^18.3.4","@types/react-dom":"^18.3.0","@types/tinycolor2":"^1.4.6","@uiw/react-iframe":"^1.0.3","@vitejs/plugin-react":"^4.3.4",autoprefixer:"^10.4.20",axios:"^1.7.5","class-variance-authority":"^0.7.0",jsdom:"^25.0.1",mutative:"^1.0.11",postcss:"^8.4.41","postcss-prefix-selector":"^1.16.1",react:"^18.3.1","react-dom":"^18.3.1","react-markdown":"^9.0.1","react-use":"^17.5.1","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0",swr:"^2.2.5","tailwind-merge":"^2.4.0",tailwindcss:"^3.4.6","tailwindcss-animate":"^1.0.7",typescript:"^5.5.4",vite:"^5.4.2","vite-plugin-dts":"4.0.3","vite-plugin-externalize-deps":"^0.8.0","vite-tsconfig-paths":"^5.0.1",vitest:"^2.0.5"}},UI=typeof window>"u",sv={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function HI(e){return UI?sv:e==="local"?localStorage:e==="session"?sessionStorage:sv}function th(e,t,n="session"){const r=y.useMemo(()=>HI(n),[n]),[i,a]=y.useState(()=>{const l=r.getItem(e);if(l!==null)try{return JSON.parse(l)}catch(u){console.error(`Error parsing stored value for key '${e}':`,u)}return typeof t=="function"?t():t??null}),o=y.useCallback(l=>{if(a(l),l===null)r.removeItem(e);else try{r.setItem(e,JSON.stringify(l))}catch(u){console.error(`Error saving state to storage for key '${e}':`,u)}},[e,r]),s=y.useCallback(()=>{a(null),r.removeItem(e)},[e,r]);return y.useEffect(()=>{const l=u=>{u.key===e&&u.newValue!==JSON.stringify(i)&&a(u.newValue?JSON.parse(u.newValue):null)};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[e,i]),[i,o,s]}function lv(e,t){return function(){return e.apply(t,arguments)}}const{toString:VI}=Object.prototype,{getPrototypeOf:nh}=Object,cc=(e=>t=>{const n=VI.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qn=e=>(e=e.toLowerCase(),t=>cc(t)===e),dc=e=>t=>typeof t===e,{isArray:fo}=Array,zs=dc("undefined");function $I(e){return e!==null&&!zs(e)&&e.constructor!==null&&!zs(e.constructor)&&yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uv=Qn("ArrayBuffer");function WI(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uv(e.buffer),t}const YI=dc("string"),yn=dc("function"),cv=dc("number"),fc=e=>e!==null&&typeof e=="object",qI=e=>e===!0||e===!1,pc=e=>{if(cc(e)!=="object")return!1;const t=nh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},GI=Qn("Date"),KI=Qn("File"),XI=Qn("Blob"),QI=Qn("FileList"),ZI=e=>fc(e)&&yn(e.pipe),JI=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||yn(e.append)&&((t=cc(e))==="formdata"||t==="object"&&yn(e.toString)&&e.toString()==="[object FormData]"))},e6=Qn("URLSearchParams"),[t6,n6,r6,i6]=["ReadableStream","Request","Response","Headers"].map(Qn),a6=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Us(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),fo(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function dv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Ea=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,fv=e=>!zs(e)&&e!==Ea;function rh(){const{caseless:e}=fv(this)&&this||{},t={},n=(r,i)=>{const a=e&&dv(t,i)||i;pc(t[a])&&pc(r)?t[a]=rh(t[a],r):pc(r)?t[a]=rh({},r):fo(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Us(arguments[r],n);return t}const o6=(e,t,n,{allOwnKeys:r}={})=>(Us(t,(i,a)=>{n&&yn(i)?e[a]=lv(i,n):e[a]=i},{allOwnKeys:r}),e),s6=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),l6=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},u6=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&nh(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},c6=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},d6=e=>{if(!e)return null;if(fo(e))return e;let t=e.length;if(!cv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},f6=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nh(Uint8Array)),p6=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},h6=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},m6=Qn("HTMLFormElement"),g6=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),pv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),w6=Qn("RegExp"),hv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Us(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},y6=e=>{hv(e,(t,n)=>{if(yn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(yn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},v6=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return fo(e)?r(e):r(String(e).split(t)),n},b6=()=>{},x6=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ih="abcdefghijklmnopqrstuvwxyz",mv="0123456789",gv={DIGIT:mv,ALPHA:ih,ALPHA_DIGIT:ih+ih.toUpperCase()+mv},E6=(e=16,t=gv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function T6(e){return!!(e&&yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _6=e=>{const t=new Array(10),n=(r,i)=>{if(fc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=fo(r)?[]:{};return Us(r,(o,s)=>{const l=n(o,i+1);!zs(l)&&(a[s]=l)}),t[i]=void 0,a}}return r};return n(e,0)},S6=Qn("AsyncFunction"),k6=e=>e&&(fc(e)||yn(e))&&yn(e.then)&&yn(e.catch),wv=((e,t)=>e?setImmediate:t?((n,r)=>(Ea.addEventListener("message",({source:i,data:a})=>{i===Ea&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ea.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",yn(Ea.postMessage)),C6=typeof queueMicrotask<"u"?queueMicrotask.bind(Ea):typeof process<"u"&&process.nextTick||wv,z={isArray:fo,isArrayBuffer:uv,isBuffer:$I,isFormData:JI,isArrayBufferView:WI,isString:YI,isNumber:cv,isBoolean:qI,isObject:fc,isPlainObject:pc,isReadableStream:t6,isRequest:n6,isResponse:r6,isHeaders:i6,isUndefined:zs,isDate:GI,isFile:KI,isBlob:XI,isRegExp:w6,isFunction:yn,isStream:ZI,isURLSearchParams:e6,isTypedArray:f6,isFileList:QI,forEach:Us,merge:rh,extend:o6,trim:a6,stripBOM:s6,inherits:l6,toFlatObject:u6,kindOf:cc,kindOfTest:Qn,endsWith:c6,toArray:d6,forEachEntry:p6,matchAll:h6,isHTMLForm:m6,hasOwnProperty:pv,hasOwnProp:pv,reduceDescriptors:hv,freezeMethods:y6,toObjectSet:v6,toCamelCase:g6,noop:b6,toFiniteNumber:x6,findKey:dv,global:Ea,isContextDefined:fv,ALPHABET:gv,generateString:E6,isSpecCompliantForm:T6,toJSONObject:_6,isAsyncFn:S6,isThenable:k6,setImmediate:wv,asap:C6};function ge(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}z.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}});const yv=ge.prototype,vv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{vv[e]={value:e}}),Object.defineProperties(ge,vv),Object.defineProperty(yv,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,i,a)=>{const o=Object.create(yv);return z.toFlatObject(e,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),ge.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const A6=null;function ah(e){return z.isPlainObject(e)||z.isArray(e)}function bv(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function xv(e,t,n){return e?e.concat(t).map(function(i,a){return i=bv(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function N6(e){return z.isArray(e)&&!e.some(ah)}const R6=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function hc(e,t,n){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,b){return!z.isUndefined(b[g])});const r=n.metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(z.isDate(m))return m.toISOString();if(!l&&z.isBlob(m))throw new ge("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(m)||z.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,g,b){let w=m;if(m&&!b&&typeof m=="object"){if(z.endsWith(g,"{}"))g=r?g:g.slice(0,-2),m=JSON.stringify(m);else if(z.isArray(m)&&N6(m)||(z.isFileList(m)||z.endsWith(g,"[]"))&&(w=z.toArray(m)))return g=bv(g),w.forEach(function(x,T){!(z.isUndefined(x)||x===null)&&t.append(o===!0?xv([g],T,a):o===null?g:g+"[]",u(x))}),!1}return ah(m)?!0:(t.append(xv(b,g,a),u(m)),!1)}const d=[],f=Object.assign(R6,{defaultVisitor:c,convertValue:u,isVisitable:ah});function p(m,g){if(!z.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(m),z.forEach(m,function(w,v){(!(z.isUndefined(w)||w===null)&&i.call(t,w,z.isString(v)?v.trim():v,g,f))===!0&&p(w,g?g.concat(v):[v])}),d.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Ev(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oh(e,t){this._pairs=[],e&&hc(e,this,t)}const Tv=oh.prototype;Tv.append=function(t,n){this._pairs.push([t,n])},Tv.toString=function(t){const n=t?function(r){return t.call(this,r,Ev)}:Ev;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function P6(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _v(e,t,n){if(!t)return e;const r=n&&n.encode||P6,i=n&&n.serialize;let a;if(i?a=i(t,n):a=z.isURLSearchParams(t)?t.toString():new oh(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Sv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(r){r!==null&&t(r)})}}const kv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},O6={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oh,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sh=typeof window<"u"&&typeof document<"u",lh=typeof navigator=="object"&&navigator||void 0,I6=sh&&(!lh||["ReactNative","NativeScript","NS"].indexOf(lh.product)<0),D6=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",L6=sh&&window.location.href||"http://localhost",an={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sh,hasStandardBrowserEnv:I6,hasStandardBrowserWebWorkerEnv:D6,navigator:lh,origin:L6},Symbol.toStringTag,{value:"Module"})),...O6};function M6(e,t){return hc(e,new an.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return an.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function F6(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function B6(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Cv(e){function t(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),l=a>=n.length;return o=!o&&z.isArray(i)?i.length:o,l?(z.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!z.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&z.isArray(i[o])&&(i[o]=B6(i[o])),!s)}if(z.isFormData(e)&&z.isFunction(e.entries)){const n={};return z.forEachEntry(e,(r,i)=>{t(F6(r),i,n,0)}),n}return null}function j6(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Hs={transitional:kv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=z.isObject(t);if(a&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return i?JSON.stringify(Cv(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t)||z.isReadableStream(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return M6(t,this.formSerializer).toString();if((s=z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return hc(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),j6(t)):t}],transformResponse:[function(t){const n=this.transitional||Hs.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(t)||z.isReadableStream(t))return t;if(t&&z.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?ge.from(s,ge.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:an.classes.FormData,Blob:an.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{Hs.headers[e]={}});const z6=z.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"]),U6=e=>{const t={};let n,r,i;return e&&e.split(`
17
+ */var II=y,DI=Symbol.for("react.element"),LI=Symbol.for("react.fragment"),MI=Object.prototype.hasOwnProperty,FI=II.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,BI={key:!0,ref:!0,__self:!0,__source:!0};function ov(e,t,n){var r,i={},a=null,o=null;n!==void 0&&(a=""+n),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)MI.call(t,r)&&!BI.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:DI,type:e,key:a,ref:o,props:i,_owner:FI.current}}oc.Fragment=LI,oc.jsx=ov,oc.jsxs=ov,qy.exports=oc;var E=qy.exports;const jI="@opencx/widget",eh="2.4.4",zI={name:jI,private:!1,version:eh,type:"module",publishConfig:{access:"public"},scripts:{clean:"rm -rf ./dist ./dist-embed","clean:dist":"rm -rf ./dist ./dist-embed",prepublishOnly:"pnpm clean && pnpm test && pnpm batman","build:lib":"vite build",dev:"vite -c vite.config.ts","build:embed":"vite build -c vite.embed.config.ts",test:"vitest run",batman:"pnpm build:lib && pnpm build:embed","test:watch":"vitest --watch",cs:"changeset",csv:"changeset version",csp:"changeset publish","type-check":"tsc --noEmit",lint:"biome lint --fix",format:"biome format --fix"},peerDependencies:{"lucide-react":"^0.412.0",react:"^18.3.1","rehype-raw":"^7.0.0"},peerDependenciesMeta:{react:{optional:!0}},optionalDependencies:{axios:"^1.7.5",zod:"^3.23.8"},dependencies:{"@radix-ui/react-avatar":"^1.1.0","@radix-ui/react-dropdown-menu":"^2.1.4","@radix-ui/react-slot":"^1.1.0","@radix-ui/react-switch":"^1.1.0","@radix-ui/react-tooltip":"^1.1.2",clsx:"^2.1.1","date-fns":"^4.1.0","framer-motion":"^11.3.30","lodash.isequal":"^4.5.0","lodash.set":"^4.3.2","lucide-react":"^0.436.0",mutative:"^1.0.11","react-dropzone":"^14.3.5","react-hot-toast":"^2.4.1",tinycolor2:"^1.6.0",zod:"^3.23.8"},overrides:{"@opencx/widget":{react:{optional:!0,dependencies:{"react-hot-toast":"^2.4.1","react-markdown":"^9.0.1","framer-motion":"^11.3.30","date-fns":"^4.1.0"}}}},conditionalDependencies:{react:{"react-hot-toast":"^2.4.1","react-markdown":"^9.0.1","framer-motion":"^11.3.30","date-fns":"^4.1.0"}},files:["dist","dist-embed"],bugs:{url:"https://github.com/openchatai/widget/issues"},author:{name:"openchatai",url:"https://github.com/openchatai"},main:"./dist/index.js",module:"./dist/index.js",types:"./dist/index.d.ts",sideEffects:!1,exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./basic":{types:"./dist/basic.d.ts",import:"./dist/basic.js",require:"./dist/basic.cjs"},"./react":{types:"./dist/react.d.ts",import:"./dist/react.js",require:"./dist/react.cjs"},"./package.json":"./package.json","./dist/*.css":"./dist/*.css"},devDependencies:{"@biomejs/biome":"1.9.4","@changesets/cli":"^2.27.9","@radix-ui/react-popover":"^1.1.2","@tailwindcss/typography":"^0.5.15","@testing-library/dom":"^10.4.0","@testing-library/jest-dom":"^6.5.0","@testing-library/react":"^16.0.1","@types/lodash.debounce":"^4.0.9","@types/lodash.isequal":"^4.5.8","@types/lodash.set":"^4.3.9","@types/node":"^20.14.8","@types/react":"^18.3.4","@types/react-dom":"^18.3.0","@types/tinycolor2":"^1.4.6","@uiw/react-iframe":"^1.0.3","@vitejs/plugin-react":"^4.3.4",autoprefixer:"^10.4.20",axios:"^1.7.5","class-variance-authority":"^0.7.0",jsdom:"^25.0.1",mutative:"^1.0.11",postcss:"^8.4.41","postcss-prefix-selector":"^1.16.1",react:"^18.3.1","react-dom":"^18.3.1","react-markdown":"^9.0.1","react-use":"^17.5.1","rehype-raw":"^7.0.0","remark-gfm":"^4.0.0",swr:"^2.2.5","tailwind-merge":"^2.4.0",tailwindcss:"^3.4.6","tailwindcss-animate":"^1.0.7",typescript:"^5.5.4",vite:"^5.4.2","vite-plugin-dts":"4.0.3","vite-plugin-externalize-deps":"^0.8.0","vite-tsconfig-paths":"^5.0.1",vitest:"^2.0.5"}},UI=typeof window>"u",sv={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function HI(e){return UI?sv:e==="local"?localStorage:e==="session"?sessionStorage:sv}function th(e,t,n="session"){const r=y.useMemo(()=>HI(n),[n]),[i,a]=y.useState(()=>{const l=r.getItem(e);if(l!==null)try{return JSON.parse(l)}catch(u){console.error(`Error parsing stored value for key '${e}':`,u)}return typeof t=="function"?t():t??null}),o=y.useCallback(l=>{if(a(l),l===null)r.removeItem(e);else try{r.setItem(e,JSON.stringify(l))}catch(u){console.error(`Error saving state to storage for key '${e}':`,u)}},[e,r]),s=y.useCallback(()=>{a(null),r.removeItem(e)},[e,r]);return y.useEffect(()=>{const l=u=>{u.key===e&&u.newValue!==JSON.stringify(i)&&a(u.newValue?JSON.parse(u.newValue):null)};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[e,i]),[i,o,s]}function lv(e,t){return function(){return e.apply(t,arguments)}}const{toString:VI}=Object.prototype,{getPrototypeOf:nh}=Object,cc=(e=>t=>{const n=VI.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Qn=e=>(e=e.toLowerCase(),t=>cc(t)===e),dc=e=>t=>typeof t===e,{isArray:fo}=Array,zs=dc("undefined");function $I(e){return e!==null&&!zs(e)&&e.constructor!==null&&!zs(e.constructor)&&yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const uv=Qn("ArrayBuffer");function WI(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&uv(e.buffer),t}const YI=dc("string"),yn=dc("function"),cv=dc("number"),fc=e=>e!==null&&typeof e=="object",qI=e=>e===!0||e===!1,pc=e=>{if(cc(e)!=="object")return!1;const t=nh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},GI=Qn("Date"),KI=Qn("File"),XI=Qn("Blob"),QI=Qn("FileList"),ZI=e=>fc(e)&&yn(e.pipe),JI=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||yn(e.append)&&((t=cc(e))==="formdata"||t==="object"&&yn(e.toString)&&e.toString()==="[object FormData]"))},e6=Qn("URLSearchParams"),[t6,n6,r6,i6]=["ReadableStream","Request","Response","Headers"].map(Qn),a6=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Us(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),fo(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),o=a.length;let s;for(r=0;r<o;r++)s=a[r],t.call(null,e[s],s,e)}}function dv(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,i;for(;r-- >0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Ea=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,fv=e=>!zs(e)&&e!==Ea;function rh(){const{caseless:e}=fv(this)&&this||{},t={},n=(r,i)=>{const a=e&&dv(t,i)||i;pc(t[a])&&pc(r)?t[a]=rh(t[a],r):pc(r)?t[a]=rh({},r):fo(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&Us(arguments[r],n);return t}const o6=(e,t,n,{allOwnKeys:r}={})=>(Us(t,(i,a)=>{n&&yn(i)?e[a]=lv(i,n):e[a]=i},{allOwnKeys:r}),e),s6=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),l6=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},u6=(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!r||r(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=n!==!1&&nh(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},c6=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},d6=e=>{if(!e)return null;if(fo(e))return e;let t=e.length;if(!cv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},f6=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&nh(Uint8Array)),p6=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},h6=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},m6=Qn("HTMLFormElement"),g6=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),pv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),w6=Qn("RegExp"),hv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Us(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},y6=e=>{hv(e,(t,n)=>{if(yn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(yn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},v6=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return fo(e)?r(e):r(String(e).split(t)),n},b6=()=>{},x6=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,ih="abcdefghijklmnopqrstuvwxyz",mv="0123456789",gv={DIGIT:mv,ALPHA:ih,ALPHA_DIGIT:ih+ih.toUpperCase()+mv},E6=(e=16,t=gv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function T6(e){return!!(e&&yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const _6=e=>{const t=new Array(10),n=(r,i)=>{if(fc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const a=fo(r)?[]:{};return Us(r,(o,s)=>{const l=n(o,i+1);!zs(l)&&(a[s]=l)}),t[i]=void 0,a}}return r};return n(e,0)},S6=Qn("AsyncFunction"),k6=e=>e&&(fc(e)||yn(e))&&yn(e.then)&&yn(e.catch),wv=((e,t)=>e?setImmediate:t?((n,r)=>(Ea.addEventListener("message",({source:i,data:a})=>{i===Ea&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ea.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",yn(Ea.postMessage)),C6=typeof queueMicrotask<"u"?queueMicrotask.bind(Ea):typeof process<"u"&&process.nextTick||wv,z={isArray:fo,isArrayBuffer:uv,isBuffer:$I,isFormData:JI,isArrayBufferView:WI,isString:YI,isNumber:cv,isBoolean:qI,isObject:fc,isPlainObject:pc,isReadableStream:t6,isRequest:n6,isResponse:r6,isHeaders:i6,isUndefined:zs,isDate:GI,isFile:KI,isBlob:XI,isRegExp:w6,isFunction:yn,isStream:ZI,isURLSearchParams:e6,isTypedArray:f6,isFileList:QI,forEach:Us,merge:rh,extend:o6,trim:a6,stripBOM:s6,inherits:l6,toFlatObject:u6,kindOf:cc,kindOfTest:Qn,endsWith:c6,toArray:d6,forEachEntry:p6,matchAll:h6,isHTMLForm:m6,hasOwnProperty:pv,hasOwnProp:pv,reduceDescriptors:hv,freezeMethods:y6,toObjectSet:v6,toCamelCase:g6,noop:b6,toFiniteNumber:x6,findKey:dv,global:Ea,isContextDefined:fv,ALPHABET:gv,generateString:E6,isSpecCompliantForm:T6,toJSONObject:_6,isAsyncFn:S6,isThenable:k6,setImmediate:wv,asap:C6};function ge(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}z.inherits(ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:z.toJSONObject(this.config),code:this.code,status:this.status}}});const yv=ge.prototype,vv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{vv[e]={value:e}}),Object.defineProperties(ge,vv),Object.defineProperty(yv,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,i,a)=>{const o=Object.create(yv);return z.toFlatObject(e,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),ge.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};const A6=null;function ah(e){return z.isPlainObject(e)||z.isArray(e)}function bv(e){return z.endsWith(e,"[]")?e.slice(0,-2):e}function xv(e,t,n){return e?e.concat(t).map(function(i,a){return i=bv(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function N6(e){return z.isArray(e)&&!e.some(ah)}const R6=z.toFlatObject(z,{},null,function(t){return/^is[A-Z]/.test(t)});function hc(e,t,n){if(!z.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=z.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,b){return!z.isUndefined(b[g])});const r=n.metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&z.isSpecCompliantForm(t);if(!z.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(z.isDate(m))return m.toISOString();if(!l&&z.isBlob(m))throw new ge("Blob is not supported. Use a Buffer instead.");return z.isArrayBuffer(m)||z.isTypedArray(m)?l&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function c(m,g,b){let w=m;if(m&&!b&&typeof m=="object"){if(z.endsWith(g,"{}"))g=r?g:g.slice(0,-2),m=JSON.stringify(m);else if(z.isArray(m)&&N6(m)||(z.isFileList(m)||z.endsWith(g,"[]"))&&(w=z.toArray(m)))return g=bv(g),w.forEach(function(x,T){!(z.isUndefined(x)||x===null)&&t.append(o===!0?xv([g],T,a):o===null?g:g+"[]",u(x))}),!1}return ah(m)?!0:(t.append(xv(b,g,a),u(m)),!1)}const d=[],f=Object.assign(R6,{defaultVisitor:c,convertValue:u,isVisitable:ah});function p(m,g){if(!z.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(m),z.forEach(m,function(w,v){(!(z.isUndefined(w)||w===null)&&i.call(t,w,z.isString(v)?v.trim():v,g,f))===!0&&p(w,g?g.concat(v):[v])}),d.pop()}}if(!z.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Ev(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function oh(e,t){this._pairs=[],e&&hc(e,this,t)}const Tv=oh.prototype;Tv.append=function(t,n){this._pairs.push([t,n])},Tv.toString=function(t){const n=t?function(r){return t.call(this,r,Ev)}:Ev;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function P6(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function _v(e,t,n){if(!t)return e;const r=n&&n.encode||P6,i=n&&n.serialize;let a;if(i?a=i(t,n):a=z.isURLSearchParams(t)?t.toString():new oh(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Sv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){z.forEach(this.handlers,function(r){r!==null&&t(r)})}}const kv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},O6={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:oh,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},sh=typeof window<"u"&&typeof document<"u",lh=typeof navigator=="object"&&navigator||void 0,I6=sh&&(!lh||["ReactNative","NativeScript","NS"].indexOf(lh.product)<0),D6=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",L6=sh&&window.location.href||"http://localhost",an={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:sh,hasStandardBrowserEnv:I6,hasStandardBrowserWebWorkerEnv:D6,navigator:lh,origin:L6},Symbol.toStringTag,{value:"Module"})),...O6};function M6(e,t){return hc(e,new an.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return an.isNode&&z.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function F6(e){return z.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function B6(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}function Cv(e){function t(n,r,i,a){let o=n[a++];if(o==="__proto__")return!0;const s=Number.isFinite(+o),l=a>=n.length;return o=!o&&z.isArray(i)?i.length:o,l?(z.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!z.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&z.isArray(i[o])&&(i[o]=B6(i[o])),!s)}if(z.isFormData(e)&&z.isFunction(e.entries)){const n={};return z.forEachEntry(e,(r,i)=>{t(F6(r),i,n,0)}),n}return null}function j6(e,t,n){if(z.isString(e))try{return(t||JSON.parse)(e),z.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Hs={transitional:kv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=z.isObject(t);if(a&&z.isHTMLForm(t)&&(t=new FormData(t)),z.isFormData(t))return i?JSON.stringify(Cv(t)):t;if(z.isArrayBuffer(t)||z.isBuffer(t)||z.isStream(t)||z.isFile(t)||z.isBlob(t)||z.isReadableStream(t))return t;if(z.isArrayBufferView(t))return t.buffer;if(z.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return M6(t,this.formSerializer).toString();if((s=z.isFileList(t))||r.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return hc(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(n.setContentType("application/json",!1),j6(t)):t}],transformResponse:[function(t){const n=this.transitional||Hs.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(z.isResponse(t)||z.isReadableStream(t))return t;if(t&&z.isString(t)&&(r&&!this.responseType||i)){const o=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(s){if(o)throw s.name==="SyntaxError"?ge.from(s,ge.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:an.classes.FormData,Blob:an.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};z.forEach(["delete","get","head","post","put","patch"],e=>{Hs.headers[e]={}});const z6=z.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"]),U6=e=>{const t={};let n,r,i;return e&&e.split(`
18
18
  `).forEach(function(o){i=o.indexOf(":"),n=o.substring(0,i).trim().toLowerCase(),r=o.substring(i+1).trim(),!(!n||t[n]&&z6[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Av=Symbol("internals");function Vs(e){return e&&String(e).trim().toLowerCase()}function mc(e){return e===!1||e==null?e:z.isArray(e)?e.map(mc):String(e)}function H6(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const V6=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function uh(e,t,n,r,i){if(z.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!z.isString(t)){if(z.isString(r))return t.indexOf(r)!==-1;if(z.isRegExp(r))return r.test(t)}}function $6(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function W6(e,t){const n=z.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,a,o){return this[r].call(this,t,i,a,o)},configurable:!0})})}class on{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function a(s,l,u){const c=Vs(l);if(!c)throw new Error("header name must be a non-empty string");const d=z.findKey(i,c);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=mc(s))}const o=(s,l)=>z.forEach(s,(u,c)=>a(u,c,l));if(z.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(z.isString(t)&&(t=t.trim())&&!V6(t))o(U6(t),n);else if(z.isHeaders(t))for(const[s,l]of t.entries())a(l,s,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=Vs(t),t){const r=z.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return H6(i);if(z.isFunction(n))return n.call(this,i,r);if(z.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Vs(t),t){const r=z.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||uh(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(o){if(o=Vs(o),o){const s=z.findKey(r,o);s&&(!n||uh(r,r[s],s,n))&&(delete r[s],i=!0)}}return z.isArray(t)?t.forEach(a):a(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const a=n[r];(!t||uh(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return z.forEach(this,(i,a)=>{const o=z.findKey(r,a);if(o){n[o]=mc(i),delete n[a];return}const s=t?$6(a):String(a).trim();s!==a&&delete n[a],n[s]=mc(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return z.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&z.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
19
19
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[Av]=this[Av]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=Vs(o);r[s]||(W6(i,o),r[s]=!0)}return z.isArray(t)?t.forEach(a):a(t),this}}on.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),z.reduceDescriptors(on.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),z.freezeMethods(on);function ch(e,t){const n=this||Hs,r=t||n,i=on.from(r.headers);let a=r.data;return z.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Nv(e){return!!(e&&e.__CANCEL__)}function po(e,t,n){ge.call(this,e??"canceled",ge.ERR_CANCELED,t,n),this.name="CanceledError"}z.inherits(po,ge,{__CANCEL__:!0});function Rv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ge("Request failed with status code "+n.status,[ge.ERR_BAD_REQUEST,ge.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Y6(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function q6(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[a];o||(o=u),n[i]=l,r[i]=u;let d=a,f=0;for(;d!==i;)f+=n[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(f*1e3/p):void 0}}function G6(e,t){let n=0,r=1e3/t,i,a;const o=(u,c=Date.now())=>{n=c,i=null,a&&(clearTimeout(a),a=null),e.apply(null,u)};return[(...u)=>{const c=Date.now(),d=c-n;d>=r?o(u,c):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},r-d)))},()=>i&&o(i)]}const gc=(e,t,n=3)=>{let r=0;const i=q6(50,250);return G6(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-r,u=i(l),c=o<=s;r=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&c?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},n)},Pv=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Ov=e=>(...t)=>z.asap(()=>e(...t)),K6=an.hasStandardBrowserEnv?function(){const t=an.navigator&&/(msie|trident)/i.test(an.navigator.userAgent),n=document.createElement("a");let r;function i(a){let o=a;return t&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const s=z.isString(o)?i(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}(),X6=an.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];z.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),z.isString(r)&&o.push("path="+r),z.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Q6(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Z6(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Iv(e,t){return e&&!Q6(t)?Z6(e,t):t}const Dv=e=>e instanceof on?{...e}:e;function Ta(e,t){t=t||{};const n={};function r(u,c,d){return z.isPlainObject(u)&&z.isPlainObject(c)?z.merge.call({caseless:d},u,c):z.isPlainObject(c)?z.merge({},c):z.isArray(c)?c.slice():c}function i(u,c,d){if(z.isUndefined(c)){if(!z.isUndefined(u))return r(void 0,u,d)}else return r(u,c,d)}function a(u,c){if(!z.isUndefined(c))return r(void 0,c)}function o(u,c){if(z.isUndefined(c)){if(!z.isUndefined(u))return r(void 0,u)}else return r(void 0,c)}function s(u,c,d){if(d in t)return r(u,c);if(d in e)return r(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,c)=>i(Dv(u),Dv(c),!0)};return z.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);z.isUndefined(f)&&d!==s||(n[c]=f)}),n}const Lv=e=>{const t=Ta({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=on.from(o),t.url=_v(Iv(t.baseURL,t.url),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(z.isFormData(n)){if(an.hasStandardBrowserEnv||an.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...c]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...c].join("; "))}}if(an.hasStandardBrowserEnv&&(r&&z.isFunction(r)&&(r=r(t)),r||r!==!1&&K6(t.url))){const u=i&&a&&X6.read(a);u&&o.set(i,u)}return t},J6=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=Lv(e);let a=i.data;const o=on.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,c,d,f,p,m;function g(){p&&p(),m&&m(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let b=new XMLHttpRequest;b.open(i.method.toUpperCase(),i.url,!0),b.timeout=i.timeout;function w(){if(!b)return;const x=on.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),_={data:!s||s==="text"||s==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:x,config:e,request:b};Rv(function(P){n(P),g()},function(P){r(P),g()},_),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(r(new ge("Request aborted",ge.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new ge("Network Error",ge.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let T=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const _=i.transitional||kv;i.timeoutErrorMessage&&(T=i.timeoutErrorMessage),r(new ge(T,_.clarifyTimeoutError?ge.ETIMEDOUT:ge.ECONNABORTED,e,b)),b=null},a===void 0&&o.setContentType(null),"setRequestHeader"in b&&z.forEach(o.toJSON(),function(T,_){b.setRequestHeader(_,T)}),z.isUndefined(i.withCredentials)||(b.withCredentials=!!i.withCredentials),s&&s!=="json"&&(b.responseType=i.responseType),u&&([f,m]=gc(u,!0),b.addEventListener("progress",f)),l&&b.upload&&([d,p]=gc(l),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(c=x=>{b&&(r(!x||x.type?new po(null,e,b):x),b.abort(),b=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const v=Y6(i.url);if(v&&an.protocols.indexOf(v)===-1){r(new ge("Unsupported protocol "+v+":",ge.ERR_BAD_REQUEST,e));return}b.send(a||null)})},e5=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const a=function(u){if(!i){i=!0,s();const c=u instanceof Error?u:this.reason;r.abort(c instanceof ge?c:new po(c instanceof Error?c.message:c))}};let o=t&&setTimeout(()=>{o=null,a(new ge(`timeout ${t} of ms exceeded`,ge.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=r;return l.unsubscribe=()=>z.asap(s),l}},t5=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,i;for(;r<n;)i=r+t,yield e.slice(r,i),r=i},n5=async function*(e,t){for await(const n of r5(e))yield*t5(n,t)},r5=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Mv=(e,t,n,r)=>{const i=n5(e,t);let a=0,o,s=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){s(),l.close();return}let d=c.byteLength;if(n){let f=a+=d;n(f)}l.enqueue(new Uint8Array(c))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},wc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Fv=wc&&typeof ReadableStream=="function",i5=wc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Bv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},a5=Fv&&Bv(()=>{let e=!1;const t=new Request(an.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),jv=64*1024,dh=Fv&&Bv(()=>z.isReadableStream(new Response("").body)),yc={stream:dh&&(e=>e.body)};wc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!yc[t]&&(yc[t]=z.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ge(`Response type '${t}' is not supported`,ge.ERR_NOT_SUPPORT,r)})})})(new Response);const o5=async e=>{if(e==null)return 0;if(z.isBlob(e))return e.size;if(z.isSpecCompliantForm(e))return(await new Request(an.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(z.isArrayBufferView(e)||z.isArrayBuffer(e))return e.byteLength;if(z.isURLSearchParams(e)&&(e=e+""),z.isString(e))return(await i5(e)).byteLength},s5=async(e,t)=>{const n=z.toFiniteNumber(e.getContentLength());return n??o5(t)},fh={http:A6,xhr:J6,fetch:wc&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=Lv(e);u=u?(u+"").toLowerCase():"text";let p=e5([i,a&&a.toAbortSignal()],o),m;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let b;try{if(l&&a5&&n!=="get"&&n!=="head"&&(b=await s5(c,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),S;if(z.isFormData(r)&&(S=_.headers.get("content-type"))&&c.setContentType(S),_.body){const[P,O]=Pv(b,gc(Ov(l)));r=Mv(_.body,jv,P,O)}}z.isString(d)||(d=d?"include":"omit");const w="credentials"in Request.prototype;m=new Request(t,{...f,signal:p,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:w?d:void 0});let v=await fetch(m);const x=dh&&(u==="stream"||u==="response");if(dh&&(s||x&&g)){const _={};["status","statusText","headers"].forEach(U=>{_[U]=v[U]});const S=z.toFiniteNumber(v.headers.get("content-length")),[P,O]=s&&Pv(S,gc(Ov(s),!0))||[];v=new Response(Mv(v.body,jv,P,()=>{O&&O(),g&&g()}),_)}u=u||"text";let T=await yc[z.findKey(yc,u)||"text"](v,e);return!x&&g&&g(),await new Promise((_,S)=>{Rv(_,S,{data:T,headers:on.from(v.headers),status:v.status,statusText:v.statusText,config:e,request:m})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new ge("Network Error",ge.ERR_NETWORK,e,m),{cause:w.cause||w}):ge.from(w,w&&w.code,e,m)}})};z.forEach(fh,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const zv=e=>`- ${e}`,l5=e=>z.isFunction(e)||e===null||e===!1,Uv={getAdapter:e=>{e=z.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let a=0;a<t;a++){n=e[a];let o;if(r=n,!l5(n)&&(r=fh[(o=String(n)).toLowerCase()],r===void 0))throw new ge(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+a]=r}if(!r){const a=Object.entries(i).map(([s,l])=>`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=t?a.length>1?`since :
20
20
  `+a.map(zv).join(`