@opencx/widget 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CtriTKQi.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-CsKiFO8A.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 o, f as t, a as u, b as d, n as y, e as n, d as r, i, m as f, u as D, o as c } from "./index-Cdz5xDDT.js";
1
+ import { W as o, f as t, a as u, b as d, n as y, e as n, d as r, i, m as f, u as D, o as c } from "./index-DsIbhmIO.js";
2
2
  const a = [
3
3
  "monday",
4
4
  "tuesday",
@@ -14,7 +14,7 @@ var cae=Object.defineProperty;var dae=(xi,Hr,Xn)=>Hr in xi?cae(xi,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 OI=y,II=Symbol.for("react.element"),DI=Symbol.for("react.fragment"),LI=Object.prototype.hasOwnProperty,MI=OI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FI={key:!0,ref:!0,__self:!0,__source:!0};function av(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)LI.call(t,r)&&!FI.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:II,type:e,key:a,ref:o,props:i,_owner:MI.current}}oc.Fragment=DI,oc.jsx=av,oc.jsxs=av,Yy.exports=oc;var E=Yy.exports;const BI="@opencx/widget",Zp="2.4.1",jI={name:BI,private:!1,version:Zp,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.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.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"}},zI=typeof window>"u",ov={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function UI(e){return zI?ov:e==="local"?localStorage:e==="session"?sessionStorage:ov}function Jp(e,t,n="session"){const r=y.useMemo(()=>UI(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 sv(e,t){return function(){return e.apply(t,arguments)}}const{toString:HI}=Object.prototype,{getPrototypeOf:eh}=Object,cc=(e=>t=>{const n=HI.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:uo}=Array,js=dc("undefined");function VI(e){return e!==null&&!js(e)&&e.constructor!==null&&!js(e.constructor)&&yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const lv=Qn("ArrayBuffer");function $I(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&lv(e.buffer),t}const WI=dc("string"),yn=dc("function"),uv=dc("number"),fc=e=>e!==null&&typeof e=="object",YI=e=>e===!0||e===!1,pc=e=>{if(cc(e)!=="object")return!1;const t=eh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},qI=Qn("Date"),GI=Qn("File"),KI=Qn("Blob"),XI=Qn("FileList"),QI=e=>fc(e)&&yn(e.pipe),ZI=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]"))},JI=Qn("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Qn),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zs(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),uo(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 cv(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 xa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,dv=e=>!js(e)&&e!==xa;function th(){const{caseless:e}=dv(this)&&this||{},t={},n=(r,i)=>{const a=e&&cv(t,i)||i;pc(t[a])&&pc(r)?t[a]=th(t[a],r):pc(r)?t[a]=th({},r):uo(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&zs(arguments[r],n);return t}const a5=(e,t,n,{allOwnKeys:r}={})=>(zs(t,(i,a)=>{n&&yn(i)?e[a]=sv(i,n):e[a]=i},{allOwnKeys:r}),e),o5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),s5=(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)},l5=(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&&eh(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},u5=(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},c5=e=>{if(!e)return null;if(uo(e))return e;let t=e.length;if(!uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},d5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eh(Uint8Array)),f5=(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])}},p5=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},h5=Qn("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),fv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),g5=Qn("RegExp"),pv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};zs(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},w5=e=>{pv(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+"'")})}})},y5=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return uo(e)?r(e):r(String(e).split(t)),n},v5=()=>{},b5=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,nh="abcdefghijklmnopqrstuvwxyz",hv="0123456789",mv={DIGIT:hv,ALPHA:nh,ALPHA_DIGIT:nh+nh.toUpperCase()+hv},x5=(e=16,t=mv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function E5(e){return!!(e&&yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const T5=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=uo(r)?[]:{};return zs(r,(o,s)=>{const l=n(o,i+1);!js(l)&&(a[s]=l)}),t[i]=void 0,a}}return r};return n(e,0)},_5=Qn("AsyncFunction"),S5=e=>e&&(fc(e)||yn(e))&&yn(e.then)&&yn(e.catch),gv=((e,t)=>e?setImmediate:t?((n,r)=>(xa.addEventListener("message",({source:i,data:a})=>{i===xa&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),xa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",yn(xa.postMessage)),k5=typeof queueMicrotask<"u"?queueMicrotask.bind(xa):typeof process<"u"&&process.nextTick||gv,j={isArray:uo,isArrayBuffer:lv,isBuffer:VI,isFormData:ZI,isArrayBufferView:$I,isString:WI,isNumber:uv,isBoolean:YI,isObject:fc,isPlainObject:pc,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:js,isDate:qI,isFile:GI,isBlob:KI,isRegExp:g5,isFunction:yn,isStream:QI,isURLSearchParams:JI,isTypedArray:d5,isFileList:XI,forEach:zs,merge:th,extend:a5,trim:i5,stripBOM:o5,inherits:s5,toFlatObject:l5,kindOf:cc,kindOfTest:Qn,endsWith:u5,toArray:c5,forEachEntry:f5,matchAll:p5,isHTMLForm:h5,hasOwnProperty:fv,hasOwnProp:fv,reduceDescriptors:pv,freezeMethods:w5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:b5,findKey:cv,global:xa,isContextDefined:dv,ALPHABET:mv,generateString:x5,isSpecCompliantForm:E5,toJSONObject:T5,isAsyncFn:_5,isThenable:S5,setImmediate:gv,asap:k5};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)}j.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:j.toJSONObject(this.config),code:this.code,status:this.status}}});const wv=ge.prototype,yv={};["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=>{yv[e]={value:e}}),Object.defineProperties(ge,yv),Object.defineProperty(wv,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,i,a)=>{const o=Object.create(wv);return j.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 C5=null;function rh(e){return j.isPlainObject(e)||j.isArray(e)}function vv(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function bv(e,t,n){return e?e.concat(t).map(function(i,a){return i=vv(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function A5(e){return j.isArray(e)&&!e.some(rh)}const R5=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function hc(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,b){return!j.isUndefined(b[g])});const r=n.metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(j.isDate(m))return m.toISOString();if(!l&&j.isBlob(m))throw new ge("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(m)||j.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(j.endsWith(g,"{}"))g=r?g:g.slice(0,-2),m=JSON.stringify(m);else if(j.isArray(m)&&A5(m)||(j.isFileList(m)||j.endsWith(g,"[]"))&&(w=j.toArray(m)))return g=vv(g),w.forEach(function(x,T){!(j.isUndefined(x)||x===null)&&t.append(o===!0?bv([g],T,a):o===null?g:g+"[]",u(x))}),!1}return rh(m)?!0:(t.append(bv(b,g,a),u(m)),!1)}const d=[],f=Object.assign(R5,{defaultVisitor:c,convertValue:u,isVisitable:rh});function p(m,g){if(!j.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(m),j.forEach(m,function(w,v){(!(j.isUndefined(w)||w===null)&&i.call(t,w,j.isString(v)?v.trim():v,g,f))===!0&&p(w,g?g.concat(v):[v])}),d.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return p(e),t}function xv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ih(e,t){this._pairs=[],e&&hc(e,this,t)}const Ev=ih.prototype;Ev.append=function(t,n){this._pairs.push([t,n])},Ev.toString=function(t){const n=t?function(r){return t.call(this,r,xv)}:xv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function N5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tv(e,t,n){if(!t)return e;const r=n&&n.encode||N5,i=n&&n.serialize;let a;if(i?a=i(t,n):a=j.isURLSearchParams(t)?t.toString():new ih(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class _v{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){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Sv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},P5={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ih,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ah=typeof window<"u"&&typeof document<"u",oh=typeof navigator=="object"&&navigator||void 0,O5=ah&&(!oh||["ReactNative","NativeScript","NS"].indexOf(oh.product)<0),I5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",D5=ah&&window.location.href||"http://localhost",an={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ah,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:I5,navigator:oh,origin:D5},Symbol.toStringTag,{value:"Module"})),...P5};function L5(e,t){return hc(e,new an.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return an.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function M5(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function F5(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 kv(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&&j.isArray(i)?i.length:o,l?(j.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!j.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&j.isArray(i[o])&&(i[o]=F5(i[o])),!s)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,i)=>{t(M5(r),i,n,0)}),n}return null}function B5(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Us={transitional:Sv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=j.isObject(t);if(a&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return i?JSON.stringify(kv(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.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 L5(t,this.formSerializer).toString();if((s=j.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),B5(t)):t}],transformResponse:[function(t){const n=this.transitional||Us.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.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}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Us.headers[e]={}});const j5=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),z5=e=>{const t={};let n,r,i;return e&&e.split(`
17
+ */var OI=y,II=Symbol.for("react.element"),DI=Symbol.for("react.fragment"),LI=Object.prototype.hasOwnProperty,MI=OI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,FI={key:!0,ref:!0,__self:!0,__source:!0};function av(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)LI.call(t,r)&&!FI.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:II,type:e,key:a,ref:o,props:i,_owner:MI.current}}oc.Fragment=DI,oc.jsx=av,oc.jsxs=av,Yy.exports=oc;var E=Yy.exports;const BI="@opencx/widget",Zp="2.4.2",jI={name:BI,private:!1,version:Zp,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.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.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"}},zI=typeof window>"u",ov={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function UI(e){return zI?ov:e==="local"?localStorage:e==="session"?sessionStorage:ov}function Jp(e,t,n="session"){const r=y.useMemo(()=>UI(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 sv(e,t){return function(){return e.apply(t,arguments)}}const{toString:HI}=Object.prototype,{getPrototypeOf:eh}=Object,cc=(e=>t=>{const n=HI.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:uo}=Array,js=dc("undefined");function VI(e){return e!==null&&!js(e)&&e.constructor!==null&&!js(e.constructor)&&yn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const lv=Qn("ArrayBuffer");function $I(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&lv(e.buffer),t}const WI=dc("string"),yn=dc("function"),uv=dc("number"),fc=e=>e!==null&&typeof e=="object",YI=e=>e===!0||e===!1,pc=e=>{if(cc(e)!=="object")return!1;const t=eh(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},qI=Qn("Date"),GI=Qn("File"),KI=Qn("Blob"),XI=Qn("FileList"),QI=e=>fc(e)&&yn(e.pipe),ZI=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]"))},JI=Qn("URLSearchParams"),[e5,t5,n5,r5]=["ReadableStream","Request","Response","Headers"].map(Qn),i5=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zs(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),uo(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 cv(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 xa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,dv=e=>!js(e)&&e!==xa;function th(){const{caseless:e}=dv(this)&&this||{},t={},n=(r,i)=>{const a=e&&cv(t,i)||i;pc(t[a])&&pc(r)?t[a]=th(t[a],r):pc(r)?t[a]=th({},r):uo(r)?t[a]=r.slice():t[a]=r};for(let r=0,i=arguments.length;r<i;r++)arguments[r]&&zs(arguments[r],n);return t}const a5=(e,t,n,{allOwnKeys:r}={})=>(zs(t,(i,a)=>{n&&yn(i)?e[a]=sv(i,n):e[a]=i},{allOwnKeys:r}),e),o5=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),s5=(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)},l5=(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&&eh(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},u5=(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},c5=e=>{if(!e)return null;if(uo(e))return e;let t=e.length;if(!uv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},d5=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&eh(Uint8Array)),f5=(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])}},p5=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},h5=Qn("HTMLFormElement"),m5=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),fv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),g5=Qn("RegExp"),pv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};zs(n,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(r[a]=o||i)}),Object.defineProperties(e,r)},w5=e=>{pv(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+"'")})}})},y5=(e,t)=>{const n={},r=i=>{i.forEach(a=>{n[a]=!0})};return uo(e)?r(e):r(String(e).split(t)),n},v5=()=>{},b5=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,nh="abcdefghijklmnopqrstuvwxyz",hv="0123456789",mv={DIGIT:hv,ALPHA:nh,ALPHA_DIGIT:nh+nh.toUpperCase()+hv},x5=(e=16,t=mv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function E5(e){return!!(e&&yn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const T5=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=uo(r)?[]:{};return zs(r,(o,s)=>{const l=n(o,i+1);!js(l)&&(a[s]=l)}),t[i]=void 0,a}}return r};return n(e,0)},_5=Qn("AsyncFunction"),S5=e=>e&&(fc(e)||yn(e))&&yn(e.then)&&yn(e.catch),gv=((e,t)=>e?setImmediate:t?((n,r)=>(xa.addEventListener("message",({source:i,data:a})=>{i===xa&&a===n&&r.length&&r.shift()()},!1),i=>{r.push(i),xa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",yn(xa.postMessage)),k5=typeof queueMicrotask<"u"?queueMicrotask.bind(xa):typeof process<"u"&&process.nextTick||gv,j={isArray:uo,isArrayBuffer:lv,isBuffer:VI,isFormData:ZI,isArrayBufferView:$I,isString:WI,isNumber:uv,isBoolean:YI,isObject:fc,isPlainObject:pc,isReadableStream:e5,isRequest:t5,isResponse:n5,isHeaders:r5,isUndefined:js,isDate:qI,isFile:GI,isBlob:KI,isRegExp:g5,isFunction:yn,isStream:QI,isURLSearchParams:JI,isTypedArray:d5,isFileList:XI,forEach:zs,merge:th,extend:a5,trim:i5,stripBOM:o5,inherits:s5,toFlatObject:l5,kindOf:cc,kindOfTest:Qn,endsWith:u5,toArray:c5,forEachEntry:f5,matchAll:p5,isHTMLForm:h5,hasOwnProperty:fv,hasOwnProp:fv,reduceDescriptors:pv,freezeMethods:w5,toObjectSet:y5,toCamelCase:m5,noop:v5,toFiniteNumber:b5,findKey:cv,global:xa,isContextDefined:dv,ALPHABET:mv,generateString:x5,isSpecCompliantForm:E5,toJSONObject:T5,isAsyncFn:_5,isThenable:S5,setImmediate:gv,asap:k5};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)}j.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:j.toJSONObject(this.config),code:this.code,status:this.status}}});const wv=ge.prototype,yv={};["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=>{yv[e]={value:e}}),Object.defineProperties(ge,yv),Object.defineProperty(wv,"isAxiosError",{value:!0}),ge.from=(e,t,n,r,i,a)=>{const o=Object.create(wv);return j.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 C5=null;function rh(e){return j.isPlainObject(e)||j.isArray(e)}function vv(e){return j.endsWith(e,"[]")?e.slice(0,-2):e}function bv(e,t,n){return e?e.concat(t).map(function(i,a){return i=vv(i),!n&&a?"["+i+"]":i}).join(n?".":""):t}function A5(e){return j.isArray(e)&&!e.some(rh)}const R5=j.toFlatObject(j,{},null,function(t){return/^is[A-Z]/.test(t)});function hc(e,t,n){if(!j.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=j.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,b){return!j.isUndefined(b[g])});const r=n.metaTokens,i=n.visitor||c,a=n.dots,o=n.indexes,l=(n.Blob||typeof Blob<"u"&&Blob)&&j.isSpecCompliantForm(t);if(!j.isFunction(i))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(j.isDate(m))return m.toISOString();if(!l&&j.isBlob(m))throw new ge("Blob is not supported. Use a Buffer instead.");return j.isArrayBuffer(m)||j.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(j.endsWith(g,"{}"))g=r?g:g.slice(0,-2),m=JSON.stringify(m);else if(j.isArray(m)&&A5(m)||(j.isFileList(m)||j.endsWith(g,"[]"))&&(w=j.toArray(m)))return g=vv(g),w.forEach(function(x,T){!(j.isUndefined(x)||x===null)&&t.append(o===!0?bv([g],T,a):o===null?g:g+"[]",u(x))}),!1}return rh(m)?!0:(t.append(bv(b,g,a),u(m)),!1)}const d=[],f=Object.assign(R5,{defaultVisitor:c,convertValue:u,isVisitable:rh});function p(m,g){if(!j.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+g.join("."));d.push(m),j.forEach(m,function(w,v){(!(j.isUndefined(w)||w===null)&&i.call(t,w,j.isString(v)?v.trim():v,g,f))===!0&&p(w,g?g.concat(v):[v])}),d.pop()}}if(!j.isObject(e))throw new TypeError("data must be an object");return p(e),t}function xv(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function ih(e,t){this._pairs=[],e&&hc(e,this,t)}const Ev=ih.prototype;Ev.append=function(t,n){this._pairs.push([t,n])},Ev.toString=function(t){const n=t?function(r){return t.call(this,r,xv)}:xv;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function N5(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Tv(e,t,n){if(!t)return e;const r=n&&n.encode||N5,i=n&&n.serialize;let a;if(i?a=i(t,n):a=j.isURLSearchParams(t)?t.toString():new ih(t,n).toString(r),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class _v{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){j.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Sv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},P5={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ih,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},ah=typeof window<"u"&&typeof document<"u",oh=typeof navigator=="object"&&navigator||void 0,O5=ah&&(!oh||["ReactNative","NativeScript","NS"].indexOf(oh.product)<0),I5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",D5=ah&&window.location.href||"http://localhost",an={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:ah,hasStandardBrowserEnv:O5,hasStandardBrowserWebWorkerEnv:I5,navigator:oh,origin:D5},Symbol.toStringTag,{value:"Module"})),...P5};function L5(e,t){return hc(e,new an.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,a){return an.isNode&&j.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function M5(e){return j.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function F5(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 kv(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&&j.isArray(i)?i.length:o,l?(j.hasOwnProp(i,o)?i[o]=[i[o],r]:i[o]=r,!s):((!i[o]||!j.isObject(i[o]))&&(i[o]=[]),t(n,r,i[o],a)&&j.isArray(i[o])&&(i[o]=F5(i[o])),!s)}if(j.isFormData(e)&&j.isFunction(e.entries)){const n={};return j.forEachEntry(e,(r,i)=>{t(M5(r),i,n,0)}),n}return null}function B5(e,t,n){if(j.isString(e))try{return(t||JSON.parse)(e),j.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const Us={transitional:Sv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,a=j.isObject(t);if(a&&j.isHTMLForm(t)&&(t=new FormData(t)),j.isFormData(t))return i?JSON.stringify(kv(t)):t;if(j.isArrayBuffer(t)||j.isBuffer(t)||j.isStream(t)||j.isFile(t)||j.isBlob(t)||j.isReadableStream(t))return t;if(j.isArrayBufferView(t))return t.buffer;if(j.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 L5(t,this.formSerializer).toString();if((s=j.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),B5(t)):t}],transformResponse:[function(t){const n=this.transitional||Us.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(j.isResponse(t)||j.isReadableStream(t))return t;if(t&&j.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}}};j.forEach(["delete","get","head","post","put","patch"],e=>{Us.headers[e]={}});const j5=j.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),z5=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]&&j5[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Cv=Symbol("internals");function Hs(e){return e&&String(e).trim().toLowerCase()}function mc(e){return e===!1||e==null?e:j.isArray(e)?e.map(mc):String(e)}function U5(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 H5=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sh(e,t,n,r,i){if(j.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!j.isString(t)){if(j.isString(r))return t.indexOf(r)!==-1;if(j.isRegExp(r))return r.test(t)}}function V5(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $5(e,t){const n=j.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=Hs(l);if(!c)throw new Error("header name must be a non-empty string");const d=j.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)=>j.forEach(s,(u,c)=>a(u,c,l));if(j.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(j.isString(t)&&(t=t.trim())&&!H5(t))o(z5(t),n);else if(j.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=Hs(t),t){const r=j.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return U5(i);if(j.isFunction(n))return n.call(this,i,r);if(j.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Hs(t),t){const r=j.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||sh(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function a(o){if(o=Hs(o),o){const s=j.findKey(r,o);s&&(!n||sh(r,r[s],s,n))&&(delete r[s],i=!0)}}return j.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||sh(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const n=this,r={};return j.forEach(this,(i,a)=>{const o=j.findKey(r,a);if(o){n[o]=mc(i),delete n[a];return}const s=t?V5(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 j.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&j.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[Cv]=this[Cv]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=Hs(o);r[s]||($5(i,o),r[s]=!0)}return j.isArray(t)?t.forEach(a):a(t),this}}on.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),j.reduceDescriptors(on.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),j.freezeMethods(on);function lh(e,t){const n=this||Us,r=t||n,i=on.from(r.headers);let a=r.data;return j.forEach(e,function(s){a=s.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function Av(e){return!!(e&&e.__CANCEL__)}function co(e,t,n){ge.call(this,e??"canceled",ge.ERR_CANCELED,t,n),this.name="CanceledError"}j.inherits(co,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 W5(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Y5(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 q5(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=Y5(50,250);return q5(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)},Nv=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pv=e=>(...t)=>j.asap(()=>e(...t)),G5=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=j.isString(o)?i(o):o;return s.protocol===r.protocol&&s.host===r.host}}():function(){return function(){return!0}}(),K5=an.hasStandardBrowserEnv?{write(e,t,n,r,i,a){const o=[e+"="+encodeURIComponent(t)];j.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),j.isString(r)&&o.push("path="+r),j.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 X5(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Q5(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Ov(e,t){return e&&!X5(t)?Q5(e,t):t}const Iv=e=>e instanceof on?{...e}:e;function Ea(e,t){t=t||{};const n={};function r(u,c,d){return j.isPlainObject(u)&&j.isPlainObject(c)?j.merge.call({caseless:d},u,c):j.isPlainObject(c)?j.merge({},c):j.isArray(c)?c.slice():c}function i(u,c,d){if(j.isUndefined(c)){if(!j.isUndefined(u))return r(void 0,u,d)}else return r(u,c,d)}function a(u,c){if(!j.isUndefined(c))return r(void 0,c)}function o(u,c){if(j.isUndefined(c)){if(!j.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(Iv(u),Iv(c),!0)};return j.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=l[c]||i,f=d(e[c],t[c],c);j.isUndefined(f)&&d!==s||(n[c]=f)}),n}const Dv=e=>{const t=Ea({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;t.headers=o=on.from(o),t.url=Tv(Ov(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(j.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&&j.isFunction(r)&&(r=r(t)),r||r!==!1&&G5(t.url))){const u=i&&a&&K5.read(a);u&&o.set(i,u)}return t},Z5=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=Dv(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||Sv;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&&j.forEach(o.toJSON(),function(T,_){b.setRequestHeader(_,T)}),j.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 co(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=W5(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)})},J5=(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 co(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=()=>j.asap(s),l}},e6=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},t6=async function*(e,t){for await(const n of n6(e))yield*e6(n,t)},n6=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()}},Lv=(e,t,n,r)=>{const i=t6(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",Mv=wc&&typeof ReadableStream=="function",r6=wc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Fv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},i6=Mv&&Fv(()=>{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}),Bv=64*1024,uh=Mv&&Fv(()=>j.isReadableStream(new Response("").body)),yc={stream:uh&&(e=>e.body)};wc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!yc[t]&&(yc[t]=j.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 a6=async e=>{if(e==null)return 0;if(j.isBlob(e))return e.size;if(j.isSpecCompliantForm(e))return(await new Request(an.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(j.isArrayBufferView(e)||j.isArrayBuffer(e))return e.byteLength;if(j.isURLSearchParams(e)&&(e=e+""),j.isString(e))return(await r6(e)).byteLength},o6=async(e,t)=>{const n=j.toFiniteNumber(e.getContentLength());return n??a6(t)},ch={http:C5,xhr:Z5,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}=Dv(e);u=u?(u+"").toLowerCase():"text";let p=J5([i,a&&a.toAbortSignal()],o),m;const g=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let b;try{if(l&&i6&&n!=="get"&&n!=="head"&&(b=await o6(c,r))!==0){let _=new Request(t,{method:"POST",body:r,duplex:"half"}),S;if(j.isFormData(r)&&(S=_.headers.get("content-type"))&&c.setContentType(S),_.body){const[P,O]=Nv(b,gc(Pv(l)));r=Lv(_.body,Bv,P,O)}}j.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=uh&&(u==="stream"||u==="response");if(uh&&(s||x&&g)){const _={};["status","statusText","headers"].forEach(z=>{_[z]=v[z]});const S=j.toFiniteNumber(v.headers.get("content-length")),[P,O]=s&&Nv(S,gc(Pv(s),!0))||[];v=new Response(Lv(v.body,Bv,P,()=>{O&&O(),g&&g()}),_)}u=u||"text";let T=await yc[j.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)}})};j.forEach(ch,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const jv=e=>`- ${e}`,s6=e=>j.isFunction(e)||e===null||e===!1,zv={getAdapter:e=>{e=j.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,!s6(n)&&(r=ch[(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(jv).join(`
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget",
3
3
  "private": false,
4
- "version": "2.4.1",
4
+ "version": "2.4.2",
5
5
  "type": "module",
6
6
  "publishConfig": {
7
7
  "access": "public"