From fa9604e2f20cb63ff8412aacfc05967880a463e3 Mon Sep 17 00:00:00 2001 From: anish-work Date: Thu, 5 Sep 2024 17:33:13 +0530 Subject: [PATCH] build: 2.1.2 --- dist/lib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/lib.js b/dist/lib.js index db967e3..6fced51 100644 --- a/dist/lib.js +++ b/dist/lib.js @@ -43,7 +43,7 @@ Error generating stack: `+u.message+` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...o){const s=new this(i);return o.forEach(p=>s.set(p)),s}static accessor(i){const s=(this[Gp]=this[Gp]={accessors:{}}).accessors,p=this.prototype;function c(m){const g=jr(m);s[g]||(Qf(p,m),s[g]=!0)}return L.isArray(i)?i.forEach(c):c(i),this}}me.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.reduceDescriptors(me.prototype,({value:n},i)=>{let o=i[0].toUpperCase()+i.slice(1);return{get:()=>n,set(s){this[o]=s}}}),L.freezeMethods(me);function Ra(n,i){const o=this||Ar,s=i||o,p=me.from(s.headers);let c=s.data;return L.forEach(n,function(g){c=g.call(o,c,p.normalize(),i?i.status:void 0)}),p.normalize(),c}function Wp(n){return!!(n&&n.__CANCEL__)}function Jn(n,i,o){lt.call(this,n??"canceled",lt.ERR_CANCELED,i,o),this.name="CanceledError"}L.inherits(Jn,lt,{__CANCEL__:!0});function qp(n,i,o){const s=o.config.validateStatus;!o.status||!s||s(o.status)?n(o):i(new lt("Request failed with status code "+o.status,[lt.ERR_BAD_REQUEST,lt.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function Kf(n){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return i&&i[1]||""}function Jf(n,i){n=n||10;const o=new Array(n),s=new Array(n);let p=0,c=0,m;return i=i!==void 0?i:1e3,function(h){const x=Date.now(),y=s[c];m||(m=x),o[p]=h,s[p]=x;let _=c,R=0;for(;_!==p;)R+=o[_++],_=_%n;if(p=(p+1)%n,p===c&&(c=(c+1)%n),x-m{o=y,p=null,c&&(clearTimeout(c),c=null),n.apply(null,x)};return[(...x)=>{const y=Date.now(),_=y-o;_>=s?m(x,y):(p=x,c||(c=setTimeout(()=>{c=null,m(p)},s-_)))},()=>p&&m(p)]}const Oi=(n,i,o=3)=>{let s=0;const p=Jf(50,250);return t0(c=>{const m=c.loaded,g=c.lengthComputable?c.total:void 0,h=m-s,x=p(h),y=m<=g;s=m;const _={loaded:m,total:g,progress:g?m/g:void 0,bytes:h,rate:x||void 0,estimated:x&&g&&y?(g-m)/x:void 0,event:c,lengthComputable:g!=null,[i?"download":"upload"]:!0};n(_)},o)},Zp=(n,i)=>{const o=n!=null;return[s=>i[0]({lengthComputable:o,total:n,loaded:s}),i[1]]},Yp=n=>(...i)=>L.asap(()=>n(...i)),e0=Ne.hasStandardBrowserEnv?function(){const i=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");let s;function p(c){let m=c;return i&&(o.setAttribute("href",m),m=o.href),o.setAttribute("href",m),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:o.pathname.charAt(0)==="/"?o.pathname:"/"+o.pathname}}return s=p(window.location.href),function(m){const g=L.isString(m)?p(m):m;return g.protocol===s.protocol&&g.host===s.host}}():function(){return function(){return!0}}(),n0=Ne.hasStandardBrowserEnv?{write(n,i,o,s,p,c){const m=[n+"="+encodeURIComponent(i)];L.isNumber(o)&&m.push("expires="+new Date(o).toGMTString()),L.isString(s)&&m.push("path="+s),L.isString(p)&&m.push("domain="+p),c===!0&&m.push("secure"),document.cookie=m.join("; ")},read(n){const i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function r0(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function i0(n,i){return i?n.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):n}function Xp(n,i){return n&&!r0(i)?i0(n,i):i}const Qp=n=>n instanceof me?{...n}:n;function jn(n,i){i=i||{};const o={};function s(x,y,_){return L.isPlainObject(x)&&L.isPlainObject(y)?L.merge.call({caseless:_},x,y):L.isPlainObject(y)?L.merge({},y):L.isArray(y)?y.slice():y}function p(x,y,_){if(L.isUndefined(y)){if(!L.isUndefined(x))return s(void 0,x,_)}else return s(x,y,_)}function c(x,y){if(!L.isUndefined(y))return s(void 0,y)}function m(x,y){if(L.isUndefined(y)){if(!L.isUndefined(x))return s(void 0,x)}else return s(void 0,y)}function g(x,y,_){if(_ in i)return s(x,y);if(_ in n)return s(void 0,x)}const h={url:c,method:c,data:c,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:g,headers:(x,y)=>p(Qp(x),Qp(y),!0)};return L.forEach(Object.keys(Object.assign({},n,i)),function(y){const _=h[y]||p,R=_(n[y],i[y],y);L.isUndefined(R)&&_!==g||(o[y]=R)}),o}const Kp=n=>{const i=jn({},n);let{data:o,withXSRFToken:s,xsrfHeaderName:p,xsrfCookieName:c,headers:m,auth:g}=i;i.headers=m=me.from(m),i.url=Bp(Xp(i.baseURL,i.url),n.params,n.paramsSerializer),g&&m.set("Authorization","Basic "+btoa((g.username||"")+":"+(g.password?unescape(encodeURIComponent(g.password)):"")));let h;if(L.isFormData(o)){if(Ne.hasStandardBrowserEnv||Ne.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if((h=m.getContentType())!==!1){const[x,...y]=h?h.split(";").map(_=>_.trim()).filter(Boolean):[];m.setContentType([x||"multipart/form-data",...y].join("; "))}}if(Ne.hasStandardBrowserEnv&&(s&&L.isFunction(s)&&(s=s(i)),s||s!==!1&&e0(i.url))){const x=p&&c&&n0.read(c);x&&m.set(p,x)}return i},o0=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(o,s){const p=Kp(n);let c=p.data;const m=me.from(p.headers).normalize();let{responseType:g,onUploadProgress:h,onDownloadProgress:x}=p,y,_,R,F,w;function b(){F&&F(),w&&w(),p.cancelToken&&p.cancelToken.unsubscribe(y),p.signal&&p.signal.removeEventListener("abort",y)}let S=new XMLHttpRequest;S.open(p.method.toUpperCase(),p.url,!0),S.timeout=p.timeout;function P(){if(!S)return;const z=me.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),Z={data:!g||g==="text"||g==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:z,config:n,request:S};qp(function(et){o(et),b()},function(et){s(et),b()},Z),S=null}"onloadend"in S?S.onloadend=P:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(P)},S.onabort=function(){S&&(s(new lt("Request aborted",lt.ECONNABORTED,n,S)),S=null)},S.onerror=function(){s(new lt("Network Error",lt.ERR_NETWORK,n,S)),S=null},S.ontimeout=function(){let H=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const Z=p.transitional||Hp;p.timeoutErrorMessage&&(H=p.timeoutErrorMessage),s(new lt(H,Z.clarifyTimeoutError?lt.ETIMEDOUT:lt.ECONNABORTED,n,S)),S=null},c===void 0&&m.setContentType(null),"setRequestHeader"in S&&L.forEach(m.toJSON(),function(H,Z){S.setRequestHeader(Z,H)}),L.isUndefined(p.withCredentials)||(S.withCredentials=!!p.withCredentials),g&&g!=="json"&&(S.responseType=p.responseType),x&&([R,w]=Oi(x,!0),S.addEventListener("progress",R)),h&&S.upload&&([_,F]=Oi(h),S.upload.addEventListener("progress",_),S.upload.addEventListener("loadend",F)),(p.cancelToken||p.signal)&&(y=z=>{S&&(s(!z||z.type?new Jn(null,n,S):z),S.abort(),S=null)},p.cancelToken&&p.cancelToken.subscribe(y),p.signal&&(p.signal.aborted?y():p.signal.addEventListener("abort",y)));const N=Kf(p.url);if(N&&Ne.protocols.indexOf(N)===-1){s(new lt("Unsupported protocol "+N+":",lt.ERR_BAD_REQUEST,n));return}S.send(c||null)})},a0=(n,i)=>{let o=new AbortController,s;const p=function(h){if(!s){s=!0,m();const x=h instanceof Error?h:this.reason;o.abort(x instanceof lt?x:new Jn(x instanceof Error?x.message:x))}};let c=i&&setTimeout(()=>{p(new lt(`timeout ${i} of ms exceeded`,lt.ETIMEDOUT))},i);const m=()=>{n&&(c&&clearTimeout(c),c=null,n.forEach(h=>{h&&(h.removeEventListener?h.removeEventListener("abort",p):h.unsubscribe(p))}),n=null)};n.forEach(h=>h&&h.addEventListener&&h.addEventListener("abort",p));const{signal:g}=o;return g.unsubscribe=m,[g,()=>{c&&clearTimeout(c),c=null}]},s0=function*(n,i){let o=n.byteLength;if(!i||o{const c=l0(n,i,p);let m=0,g,h=x=>{g||(g=!0,s&&s(x))};return new ReadableStream({async pull(x){try{const{done:y,value:_}=await c.next();if(y){h(),x.close();return}let R=_.byteLength;if(o){let F=m+=R;o(F)}x.enqueue(new Uint8Array(_))}catch(y){throw h(y),y}},cancel(x){return h(x),c.return()}},{highWaterMark:2})},Ni=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",tm=Ni&&typeof ReadableStream=="function",Aa=Ni&&(typeof TextEncoder=="function"?(n=>i=>n.encode(i))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),em=(n,...i)=>{try{return!!n(...i)}catch{return!1}},p0=tm&&em(()=>{let n=!1;const i=new Request(Ne.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!i}),nm=64*1024,ja=tm&&em(()=>L.isReadableStream(new Response("").body)),Li={stream:ja&&(n=>n.body)};Ni&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(i=>{!Li[i]&&(Li[i]=L.isFunction(n[i])?o=>o[i]():(o,s)=>{throw new lt(`Response type '${i}' is not supported`,lt.ERR_NOT_SUPPORT,s)})})})(new Response);const m0=async n=>{if(n==null)return 0;if(L.isBlob(n))return n.size;if(L.isSpecCompliantForm(n))return(await new Request(n).arrayBuffer()).byteLength;if(L.isArrayBufferView(n)||L.isArrayBuffer(n))return n.byteLength;if(L.isURLSearchParams(n)&&(n=n+""),L.isString(n))return(await Aa(n)).byteLength},u0=async(n,i)=>{const o=L.toFiniteNumber(n.getContentLength());return o??m0(i)},za={http:Lf,xhr:o0,fetch:Ni&&(async n=>{let{url:i,method:o,data:s,signal:p,cancelToken:c,timeout:m,onDownloadProgress:g,onUploadProgress:h,responseType:x,headers:y,withCredentials:_="same-origin",fetchOptions:R}=Kp(n);x=x?(x+"").toLowerCase():"text";let[F,w]=p||c||m?a0([p,c],m):[],b,S;const P=()=>{!b&&setTimeout(()=>{F&&F.unsubscribe()}),b=!0};let N;try{if(h&&p0&&o!=="get"&&o!=="head"&&(N=await u0(y,s))!==0){let tt=new Request(i,{method:"POST",body:s,duplex:"half"}),et;if(L.isFormData(s)&&(et=tt.headers.get("content-type"))&&y.setContentType(et),tt.body){const[mt,K]=Zp(N,Oi(Yp(h)));s=Jp(tt.body,nm,mt,K,Aa)}}L.isString(_)||(_=_?"include":"omit"),S=new Request(i,{...R,signal:F,method:o.toUpperCase(),headers:y.normalize().toJSON(),body:s,duplex:"half",credentials:_});let z=await fetch(S);const H=ja&&(x==="stream"||x==="response");if(ja&&(g||H)){const tt={};["status","statusText","headers"].forEach(xt=>{tt[xt]=z[xt]});const et=L.toFiniteNumber(z.headers.get("content-length")),[mt,K]=g&&Zp(et,Oi(Yp(g),!0))||[];z=new Response(Jp(z.body,nm,mt,()=>{K&&K(),H&&P()},Aa),tt)}x=x||"text";let Z=await Li[L.findKey(Li,x)||"text"](z,n);return!H&&P(),w&&w(),await new Promise((tt,et)=>{qp(tt,et,{data:Z,headers:me.from(z.headers),status:z.status,statusText:z.statusText,config:n,request:S})})}catch(z){throw P(),z&&z.name==="TypeError"&&/fetch/i.test(z.message)?Object.assign(new lt("Network Error",lt.ERR_NETWORK,n,S),{cause:z.cause||z}):lt.from(z,z&&z.code,n,S)}})};L.forEach(za,(n,i)=>{if(n){try{Object.defineProperty(n,"name",{value:i})}catch{}Object.defineProperty(n,"adapterName",{value:i})}});const rm=n=>`- ${n}`,c0=n=>L.isFunction(n)||n===null||n===!1,im={getAdapter:n=>{n=L.isArray(n)?n:[n];const{length:i}=n;let o,s;const p={};for(let c=0;c`adapter ${g} `+(h===!1?"is not supported by the environment":"is not available in the build"));let m=i?c.length>1?`since : `+c.map(rm).join(` `):" "+rm(c[0]):"as no adapter specified";throw new lt("There is no suitable adapter to dispatch the request "+m,"ERR_NOT_SUPPORT")}return s},adapters:za};function Oa(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Jn(null,n)}function om(n){return Oa(n),n.headers=me.from(n.headers),n.data=Ra.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),im.getAdapter(n.adapter||Ar.adapter)(n).then(function(s){return Oa(n),s.data=Ra.call(n,n.transformResponse,s),s.headers=me.from(s.headers),s},function(s){return Wp(s)||(Oa(n),s&&s.response&&(s.response.data=Ra.call(n,n.transformResponse,s.response),s.response.headers=me.from(s.response.headers))),Promise.reject(s)})}const am="1.7.3",Na={};["object","boolean","number","function","string","symbol"].forEach((n,i)=>{Na[n]=function(s){return typeof s===n||"a"+(i<1?"n ":" ")+n}});const sm={};Na.transitional=function(i,o,s){function p(c,m){return"[Axios v"+am+"] Transitional option '"+c+"'"+m+(s?". "+s:"")}return(c,m,g)=>{if(i===!1)throw new lt(p(m," has been removed"+(o?" in "+o:"")),lt.ERR_DEPRECATED);return o&&!sm[m]&&(sm[m]=!0,console.warn(p(m," has been deprecated since v"+o+" and will be removed in the near future"))),i?i(c,m,g):!0}};function d0(n,i,o){if(typeof n!="object")throw new lt("options must be an object",lt.ERR_BAD_OPTION_VALUE);const s=Object.keys(n);let p=s.length;for(;p-- >0;){const c=s[p],m=i[c];if(m){const g=n[c],h=g===void 0||m(g,c,n);if(h!==!0)throw new lt("option "+c+" must be "+h,lt.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new lt("Unknown option "+c,lt.ERR_BAD_OPTION)}}const La={assertOptions:d0,validators:Na},sn=La.validators;class zn{constructor(i){this.defaults=i,this.interceptors={request:new $p,response:new $p}}async request(i,o){try{return await this._request(i,o)}catch(s){if(s instanceof Error){let p;Error.captureStackTrace?Error.captureStackTrace(p={}):p=new Error;const c=p.stack?p.stack.replace(/^.+\n/,""):"";try{s.stack?c&&!String(s.stack).endsWith(c.replace(/^.+\n.+\n/,""))&&(s.stack+=` -`+c):s.stack=c}catch{}}throw s}}_request(i,o){typeof i=="string"?(o=o||{},o.url=i):o=i||{},o=jn(this.defaults,o);const{transitional:s,paramsSerializer:p,headers:c}=o;s!==void 0&&La.assertOptions(s,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),p!=null&&(L.isFunction(p)?o.paramsSerializer={serialize:p}:La.assertOptions(p,{encode:sn.function,serialize:sn.function},!0)),o.method=(o.method||this.defaults.method||"get").toLowerCase();let m=c&&L.merge(c.common,c[o.method]);c&&L.forEach(["delete","get","head","post","put","patch","common"],w=>{delete c[w]}),o.headers=me.concat(m,c);const g=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(o)===!1||(h=h&&b.synchronous,g.unshift(b.fulfilled,b.rejected))});const x=[];this.interceptors.response.forEach(function(b){x.push(b.fulfilled,b.rejected)});let y,_=0,R;if(!h){const w=[om.bind(this),void 0];for(w.unshift.apply(w,g),w.push.apply(w,x),R=w.length,y=Promise.resolve(o);_{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](p);s._listeners=null}),this.promise.then=p=>{let c;const m=new Promise(g=>{s.subscribe(g),c=g}).then(p);return m.cancel=function(){s.unsubscribe(c)},m},i(function(c,m,g){s.reason||(s.reason=new Jn(c,m,g),o(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const o=this._listeners.indexOf(i);o!==-1&&this._listeners.splice(o,1)}static source(){let i;return{token:new Pa(function(p){i=p}),cancel:i}}}function g0(n){return function(o){return n.apply(null,o)}}function f0(n){return L.isObject(n)&&n.isAxiosError===!0}const Ia={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ia).forEach(([n,i])=>{Ia[i]=n});function lm(n){const i=new zn(n),o=Ep(zn.prototype.request,i);return L.extend(o,zn.prototype,i,{allOwnKeys:!0}),L.extend(o,i,null,{allOwnKeys:!0}),o.create=function(p){return lm(jn(n,p))},o}const At=lm(Ar);At.Axios=zn,At.CanceledError=Jn,At.CancelToken=Pa,At.isCancel=Wp,At.VERSION=am,At.toFormData=ji,At.AxiosError=lt,At.Cancel=At.CanceledError,At.all=function(i){return Promise.all(i)},At.spread=g0,At.isAxiosError=f0,At.mergeConfig=jn,At.AxiosHeaders=me,At.formToJSON=n=>Vp(L.isHTMLForm(n)?new FormData(n):n),At.getAdapter=im.getAdapter,At.HttpStatusCode=Ia,At.default=At;var h0={REACT_APP_GOOEY_SERVER:"http://127.0.0.1:8080",REACT_APP_BOT_ID:"5pV",NVM_INC:"/Users/anish/.nvm/versions/node/v18.20.2/include/node",TERM_PROGRAM:"vscode",NODE:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",INIT_CWD:"/Users/anish/code/gooey-web-widget",NVM_CD_FLAGS:"-q",PYENV_ROOT:"/Users/anish/.pyenv",npm_package_devDependencies_typescript:"^5.2.2",npm_package_dependencies_axios:"^1.6.5",npm_config_version_git_tag:"true",SHELL:"/bin/zsh",TERM:"xterm-256color",npm_package_devDependencies_vite:"^5.0.8",npm_package_dependencies_prism_react_renderer:"^2.3.1",TMPDIR:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",npm_package_devDependencies_clsx:"^2.1.0",npm_package_scripts_lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",npm_config_init_license:"MIT",TERM_PROGRAM_VERSION:"1.92.2",npm_package_devDependencies__vitejs_plugin_react:"^4.2.1",npm_package_scripts_dev:"vite",MallocNanoZone:"0",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",ZDOTDIR:"/Users/anish",npm_package_dependencies_uuid:"^9.0.1",npm_package_private:"true",npm_config_registry:"https://registry.yarnpkg.com",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.5",npm_package_dependencies_react_dom:"^18.2.0",npm_package_readmeFilename:"README.md",npm_package_dependencies_html_react_parser:"^5.1.10",USER:"anish",NVM_DIR:"/Users/anish/.nvm",npm_package_description:"A clean, self-hostable web widget for Gooey.AI Copilots, with streaming support with every major LLM, speech-reco, and Text-to-Speech covering 1000+ languages, photo uploads, feedback, and analytics.",npm_package_license:"Apache-2.0",npm_package_devDependencies__types_react:"^18.2.43",COMMAND_MODE:"unix2003",PUPPETEER_EXECUTABLE_PATH:"/opt/homebrew/bin/chromium",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.UNe8OYfcF2/Listeners",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_package_devDependencies_eslint:"^8.55.0",npm_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/yarn/bin/yarn.js",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^6.14.0",npm_package_devDependencies_vite_plugin_require_transform:"^1.0.21",npm_package_dependencies_marked:"^12.0.2",npm_package_devDependencies__types_react_dom:"^18.2.17",npm_package_devDependencies__typescript_eslint_parser:"^6.14.0",PATH:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/yarn--1725536924145-0.45758145987797816:/Users/anish/code/gooey-web-widget/node_modules/.bin:/Users/anish/.config/yarn/link/node_modules/.bin:/Users/anish/.yarn/bin:/Users/anish/.nvm/versions/node/v18.20.2/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/bin/node_modules/npm/bin/node-gyp-bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.pyenv/shims:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',_:"/Users/anish/code/gooey-web-widget/node_modules/.bin/vite",__CFBundleIdentifier:"com.microsoft.VSCode",USER_ZDOTDIR:"/Users/anish",PWD:"/Users/anish/code/gooey-web-widget",npm_package_devDependencies_eslint_plugin_react_hooks:"^4.6.0",npm_package_devDependencies__originjs_vite_plugin_commonjs:"^1.0.3",npm_package_scripts_preview:"vite preview",npm_config_nodeLinker:"node-modules",npm_lifecycle_event:"build",LANG:"en_US.UTF-8",npm_package_name:"gooey-chat",npm_package_devDependencies_sass:"^1.69.7",npm_package_scripts_build:"tsc && vite build",npm_config_version_commit_hooks:"true",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",npm_config_bin_links:"true",npm_package_devDependencies_vite_plugin_dts:"^3.7.0",XPC_SERVICE_NAME:"0",npm_package_version:"2.1.0",VSCODE_INJECTION:"1",HOME:"/Users/anish",SHLVL:"2",PYENV_SHELL:"zsh",npm_package_type:"module",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_save_prefix:"^",npm_config_strict_ssl:"true",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version_git_message:"v%s",LOGNAME:"anish",YARN_WRAP_OUTPUT:"false",npm_lifecycle_script:"tsc && vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/vscode-git-23f4d5e666.sock",npm_package_dependencies_react:"^18.2.0",NVM_BIN:"/Users/anish/.nvm/versions/node/v18.20.2/bin",npm_package_devDependencies__types_uuid:"^9.0.7",npm_config_version_git_sign:"",npm_config_ignore_scripts:"",npm_config_user_agent:"yarn/1.22.22 npm/? node/v18.20.2 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",npm_package_devDependencies__types_node:"^20.11.1",npm_config_init_version:"1.0.0",npm_config_ignore_optional:"",COLORTERM:"truecolor",npm_node_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",npm_config_version_tag_prefix:"v",NODE_ENV:"production"};const x0=`${h0.REACT_APP_GOOEY_SERVER}/v3/integrations/stream/`,y0=()=>({"Content-Type":"application/json"}),On={CONVERSATION_START:"conversation_start",FINAL_RESPONSE:"final_response",RUN_START:"run_start",RUNNING:"running",COMPLETED:"completed",MESSAGE_PART:"message_part"},pm=async(n,i,o="")=>{const s=y0(),p={citation_style:"number",use_url_shortener:!1,...n};return(await At.post(o||x0,JSON.stringify(p),{headers:s,responseType:"stream",cancelToken:i.token})).headers.get("Location")},w0=(n,i)=>{const o=new EventSource(n);window.GooeyEventSource=o,o.onmessage=s=>{const p=JSON.parse(s.data);p.type===On.FINAL_RESPONSE?(i(p),o.close()):i(p)}};var b0={REACT_APP_GOOEY_SERVER:"http://127.0.0.1:8080",REACT_APP_BOT_ID:"5pV",NVM_INC:"/Users/anish/.nvm/versions/node/v18.20.2/include/node",TERM_PROGRAM:"vscode",NODE:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",INIT_CWD:"/Users/anish/code/gooey-web-widget",NVM_CD_FLAGS:"-q",PYENV_ROOT:"/Users/anish/.pyenv",npm_package_devDependencies_typescript:"^5.2.2",npm_package_dependencies_axios:"^1.6.5",npm_config_version_git_tag:"true",SHELL:"/bin/zsh",TERM:"xterm-256color",npm_package_devDependencies_vite:"^5.0.8",npm_package_dependencies_prism_react_renderer:"^2.3.1",TMPDIR:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",npm_package_devDependencies_clsx:"^2.1.0",npm_package_scripts_lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",npm_config_init_license:"MIT",TERM_PROGRAM_VERSION:"1.92.2",npm_package_devDependencies__vitejs_plugin_react:"^4.2.1",npm_package_scripts_dev:"vite",MallocNanoZone:"0",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",ZDOTDIR:"/Users/anish",npm_package_dependencies_uuid:"^9.0.1",npm_package_private:"true",npm_config_registry:"https://registry.yarnpkg.com",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.5",npm_package_dependencies_react_dom:"^18.2.0",npm_package_readmeFilename:"README.md",npm_package_dependencies_html_react_parser:"^5.1.10",USER:"anish",NVM_DIR:"/Users/anish/.nvm",npm_package_description:"A clean, self-hostable web widget for Gooey.AI Copilots, with streaming support with every major LLM, speech-reco, and Text-to-Speech covering 1000+ languages, photo uploads, feedback, and analytics.",npm_package_license:"Apache-2.0",npm_package_devDependencies__types_react:"^18.2.43",COMMAND_MODE:"unix2003",PUPPETEER_EXECUTABLE_PATH:"/opt/homebrew/bin/chromium",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.UNe8OYfcF2/Listeners",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_package_devDependencies_eslint:"^8.55.0",npm_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/yarn/bin/yarn.js",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^6.14.0",npm_package_devDependencies_vite_plugin_require_transform:"^1.0.21",npm_package_dependencies_marked:"^12.0.2",npm_package_devDependencies__types_react_dom:"^18.2.17",npm_package_devDependencies__typescript_eslint_parser:"^6.14.0",PATH:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/yarn--1725536924145-0.45758145987797816:/Users/anish/code/gooey-web-widget/node_modules/.bin:/Users/anish/.config/yarn/link/node_modules/.bin:/Users/anish/.yarn/bin:/Users/anish/.nvm/versions/node/v18.20.2/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/bin/node_modules/npm/bin/node-gyp-bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.pyenv/shims:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',_:"/Users/anish/code/gooey-web-widget/node_modules/.bin/vite",__CFBundleIdentifier:"com.microsoft.VSCode",USER_ZDOTDIR:"/Users/anish",PWD:"/Users/anish/code/gooey-web-widget",npm_package_devDependencies_eslint_plugin_react_hooks:"^4.6.0",npm_package_devDependencies__originjs_vite_plugin_commonjs:"^1.0.3",npm_package_scripts_preview:"vite preview",npm_config_nodeLinker:"node-modules",npm_lifecycle_event:"build",LANG:"en_US.UTF-8",npm_package_name:"gooey-chat",npm_package_devDependencies_sass:"^1.69.7",npm_package_scripts_build:"tsc && vite build",npm_config_version_commit_hooks:"true",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",npm_config_bin_links:"true",npm_package_devDependencies_vite_plugin_dts:"^3.7.0",XPC_SERVICE_NAME:"0",npm_package_version:"2.1.0",VSCODE_INJECTION:"1",HOME:"/Users/anish",SHLVL:"2",PYENV_SHELL:"zsh",npm_package_type:"module",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_save_prefix:"^",npm_config_strict_ssl:"true",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version_git_message:"v%s",LOGNAME:"anish",YARN_WRAP_OUTPUT:"false",npm_lifecycle_script:"tsc && vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/vscode-git-23f4d5e666.sock",npm_package_dependencies_react:"^18.2.0",NVM_BIN:"/Users/anish/.nvm/versions/node/v18.20.2/bin",npm_package_devDependencies__types_uuid:"^9.0.7",npm_config_version_git_sign:"",npm_config_ignore_scripts:"",npm_config_user_agent:"yarn/1.22.22 npm/? node/v18.20.2 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",npm_package_devDependencies__types_node:"^20.11.1",npm_config_init_version:"1.0.0",npm_config_ignore_optional:"",COLORTERM:"truecolor",npm_node_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",npm_config_version_tag_prefix:"v",NODE_ENV:"production"};const v0=`${b0.REACT_APP_GOOEY_SERVER}/__/file-upload/`,mm=async n=>{var s;const i=new FormData;i.append("file",n);const o=await At.post(v0,i,{headers:{"Content-Type":"multipart/form-data"}});return(s=o==null?void 0:o.data)==null?void 0:s.url},um="user_id",_0=n=>{if(!(window.localStorage||null))return console.error("Local Storage not available");localStorage.getItem("user_id")||localStorage.setItem(um,n)},k0=n=>{var i,o;return(o=(i=n==null?void 0:n.messages)==null?void 0:i[0])==null?void 0:o.input_prompt},cm=n=>new Promise((i,o)=>{const s=indexedDB.open(n,1);s.onupgradeneeded=()=>{s.result.createObjectStore("conversations",{keyPath:"id",autoIncrement:!0})},s.onsuccess=()=>{i(s.result)},s.onerror=()=>{o(s.error)}}),S0=(n,i)=>new Promise((o,s)=>{const m=n.transaction(["conversations"],"readonly").objectStore("conversations").get(i);m.onsuccess=()=>{o(m.result)},m.onerror=()=>{s(m.error)}}),dm=(n,i,o)=>new Promise((s,p)=>{const g=n.transaction(["conversations"],"readonly").objectStore("conversations").getAll();g.onsuccess=()=>{const h=g.result.filter(x=>x.user_id===i&&x.bot_id===o).map(x=>{const y=Object.assign({},x);return y.title=k0(x),delete y.messages,y.getMessages=async()=>(await S0(n,x.id)).messages||[],y});s(h)},g.onerror=()=>{p(g.error)}}),E0=(n,i)=>new Promise((o,s)=>{const m=n.transaction(["conversations"],"readwrite").objectStore("conversations").put(i);m.onsuccess=()=>{o()},m.onerror=()=>{s(m.error)}}),gm="GOOEY_COPILOT_CONVERSATIONS_DB",C0=(n,i)=>{const[o,s]=Q.useState([]);return Q.useEffect(()=>{(async()=>{const m=await cm(gm),g=await dm(m,n,i);s(g.sort((h,x)=>new Date(x.timestamp).getTime()-new Date(h.timestamp).getTime()))})()},[i,n]),{conversations:o,handleAddConversation:async c=>{var h;if(!c||!((h=c.messages)!=null&&h.length))return;const m=await cm(gm);await E0(m,c);const g=await dm(m,n,i);s(g)}}},fm=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:i,width:i,children:d.jsx("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 231c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71V376c0 13.3-10.7 24-24 24s-24-10.7-24-24V193.9l-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 119c9.4-9.4 24.6-9.4 33.9 0L385 231z"})})})},T0=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:i,width:i,children:["// --!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.",d.jsx("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160H320c17.7 0 32 14.3 32 32V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32z"})]})})},hm=n=>{const i=n.size||24;return d.jsx(Dt,{children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:i,height:i,fill:"currentColor",...n,children:d.jsx("path",{d:"M240 96V256c0 26.5-21.5 48-48 48s-48-21.5-48-48V96c0-26.5 21.5-48 48-48s48 21.5 48 48zM96 96V256c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96S96 43 96 96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V216z"})})})},R0={audio:!0},A0=n=>{const{onCancel:i,onSend:o}=n,[s,p]=Q.useState(0),[c,m]=Q.useState(!1),[g,h]=Q.useState(!1),[x,y]=Q.useState([]),_=Q.useRef(null);Q.useEffect(()=>{let z;return c&&(z=setInterval(()=>p(s+1),10)),()=>clearInterval(z)},[c,s]);const R=z=>{const H=new MediaRecorder(z);_.current=H,H.start(),H.onstop=function(){z==null||z.getTracks().forEach(Z=>Z==null?void 0:Z.stop())},H.ondataavailable=function(Z){y(tt=>[...tt,Z.data])},m(!0)},F=function(z){console.log("The following error occured: "+z)},w=()=>{_.current&&(_.current.stop(),m(!1))};Q.useEffect(()=>{var z,H,Z,tt,et,mt;if(navigator.mediaDevices.getUserMedia=((z=navigator==null?void 0:navigator.mediaDevices)==null?void 0:z.getUserMedia)||((H=navigator==null?void 0:navigator.mediaDevices)==null?void 0:H.webkitGetUserMedia)||((Z=navigator==null?void 0:navigator.mediaDevices)==null?void 0:Z.mozGetUserMedia)||((tt=navigator==null?void 0:navigator.mediaDevices)==null?void 0:tt.msGetUserMedia),!((et=navigator==null?void 0:navigator.mediaDevices)!=null&&et.getUserMedia)){console.error("The mediaDevices.getUserMedia() method is not supported.");return}(mt=navigator==null?void 0:navigator.mediaDevices)==null||mt.getUserMedia(R0).then(R,F)},[]),Q.useEffect(()=>{if(!g||!x.length)return;const z=new Blob(x,{type:"audio/mp3;codecs=mpeg"});y([]),o(z),h(!1)},[x,o,g]);const b=()=>{w(),i()},S=()=>{w(),h(!0)},P=Math.floor(s%36e4/6e3),N=Math.floor(s%6e3/100);return d.jsxs("div",{className:"gpl-8 gpr-8 d-flex align-center gpb-25",children:[d.jsx(le,{variant:"text",className:"bg-light gp-8",style:{borderRadius:"100px",height:"44px"},onClick:b,children:d.jsx(Ei,{size:"24"})}),d.jsxs("div",{className:"gml-24 d-flex b-1 gp-2 w-100 pos-relative justify-between align-center",style:{borderRadius:"40px",backgroundColor:"#fae1e1",height:"44px"},children:[d.jsx("div",{}),d.jsxs("div",{className:"d-flex align-center",children:[d.jsx(hm,{size:"16",className:"anim-blink-self text-gooeyDanger",style:{}}),d.jsxs("p",{className:"gpl-4 text-gooeyDanger font_14_400",children:[P.toString().padStart(2,"0"),":",N.toString().padStart(2,"0")]})]}),d.jsx(le,{onClick:S,variant:"text-alt",style:{height:"44px"},children:d.jsx(fm,{size:24})})]})]})},j0=":export{primary:hsl(169,55%,82%);secondary:hsl(12,100%,97%);border-color:#eee;gooeyDanger:#dc3545}.gooeyChat-chat-input{width:100%;bottom:0;background:transparent}.gooeyChat-chat-input textarea{width:100%;outline:none;max-height:200px;height:44px;resize:none;position:relative}.gooeyChat-chat-input textarea:focus{outline:1px solid #f0f0f0}.input-left-buttons{position:absolute;left:4px;top:7px}.input-right-buttons{position:absolute;right:4px;top:3px}.file-preview-box img{height:80px;max-width:100px;object-fit:cover}.uploading-box{filter:brightness(.2)}",z0=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsx("svg",{height:i,width:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:d.jsx("path",{d:"M32 128C32 57.3 89.3 0 160 0s128 57.3 128 128V320c0 44.2-35.8 80-80 80s-80-35.8-80-80V160c0-17.7 14.3-32 32-32s32 14.3 32 32V320c0 8.8 7.2 16 16 16s16-7.2 16-16V128c0-35.3-28.7-64-64-64s-64 28.7-64 64V336c0 61.9 50.1 112 112 112s112-50.1 112-112V160c0-17.7 14.3-32 32-32s32 14.3 32 32V336c0 97.2-78.8 176-176 176s-176-78.8-176-176V128z"})})})},O0=n=>{const i=n.size||16;return d.jsx("div",{className:"circular-loader",children:d.jsx("svg",{className:"circular",viewBox:"25 25 50 50",height:i,width:i,children:d.jsx("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})},N0=({files:n})=>n?d.jsx("div",{className:"d-flex",style:{gap:"12px",flexWrap:"wrap"},children:n.map((i,o)=>{const{isUploading:s,name:p,data:c,removeFile:m}=i,g=URL.createObjectURL(c),h=i.type.split("/")[0];return d.jsx("div",{className:"d-flex",children:h==="image"?d.jsxs("div",{className:Pt("file-preview-box br-large pos-relative"),children:[s&&d.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:d.jsx(O0,{size:32})}),d.jsx("div",{style:{position:"absolute",top:"6px",right:"-16px",transform:"translate(-50%, -50%)",zIndex:1},children:d.jsx(Qn,{className:"bg-white gp-4 b-1",onClick:m,children:d.jsx(Ei,{size:12})})}),d.jsx("div",{className:Pt(s&&"uploading-box","overflow-hidden file-preview-box"),children:d.jsx("a",{href:g,target:"_blank",children:d.jsx("img",{src:g,alt:`preview-${p}`,className:"br-large b-1"})})})]}):d.jsx("div",{children:d.jsx("p",{children:i.name})})},o)})}):null;on(j0);const Fa="gooeyChat-input",xm=44,L0="image/*",P0=n=>new Promise((i,o)=>{const s=new FileReader;s.onload=p=>{const c=p.target.result,m=new Blob([new Uint8Array(c)],{type:n.type});i(m)},s.onerror=o,s.readAsArrayBuffer(n)}),I0=()=>{const{config:n}=pe(),{initializeQuery:i,isSending:o,cancelApiCall:s,isReceiving:p}=an(),[c,m]=Q.useState(""),[g,h]=Q.useState(!1),[x,y]=Q.useState(null),_=Q.useRef(null),R=()=>{const K=_.current;K.style.height=xm+"px"},F=K=>{const{value:xt}=K.target;m(xt),xt||R()},w=K=>{if(K.keyCode===13&&!K.shiftKey){if(o||p)return;K.preventDefault(),S()}else K.keyCode===13&&K.shiftKey&&b()},b=()=>{const K=_.current;K.scrollHeight>xm&&(K==null||K.setAttribute("style","height:"+K.scrollHeight+"px !important"))},S=()=>{if(!c.trim()&&!(x!=null&&x.length)||et)return null;const K={input_prompt:c.trim()};x!=null&&x.length&&(K.input_images=x.map(xt=>xt.gooeyUrl),y([])),i(K),m(""),R()},P=()=>{s()},N=()=>{h(!0)},z=K=>{i({input_audio:K}),h(!1)},H=K=>{const xt=Array.from(K.target.files);!xt||!xt.length||y(xt.map((jt,Et)=>(P0(jt).then(It=>{const ft=new File([It],jt.name);mm(ft).then(zt=>{y(bt=>bt[Et]?(bt[Et].isUploading=!1,bt[Et].gooeyUrl=zt,[...bt]):bt)})}),{name:jt.name,type:jt.type.split("/")[0],data:jt,gooeyUrl:"",isUploading:!0,removeFile:()=>{y(It=>(It.splice(Et,1),[...It]))}})))},Z=()=>{const K=document.createElement("input");K.type="file",K.accept=L0,K.onchange=H,K.click()};if(!n)return null;const tt=o||p,et=!tt&&!o&&c.trim().length===0&&!(x!=null&&x.length)||(x==null?void 0:x.some(K=>K.isUploading)),mt=Q.useMemo(()=>n==null?void 0:n.enablePhotoUpload,[n==null?void 0:n.enablePhotoUpload]);return d.jsxs(Xn.Fragment,{children:[x&&x.length>0&&d.jsx("div",{className:"gp-12 b-1 br-large gmb-12 gm-12",children:d.jsx(N0,{files:x})}),d.jsxs("div",{className:Pt("gooeyChat-chat-input gpr-8 gpl-8",!n.branding.showPoweredByGooey&&"gpb-8"),children:[g?d.jsx(A0,{onSend:z,onCancel:()=>h(!1)}):d.jsxs("div",{className:"pos-relative",children:[d.jsx("textarea",{value:c,ref:_,id:Fa,onChange:F,onKeyDown:w,className:Pt("br-large b-1 font_16_500 bg-white gpt-10 gpb-10 gpr-40 flex-1 gm-0",mt?"gpl-32":"gpl-12"),placeholder:`Message ${n.branding.name||""}`}),mt&&d.jsx("div",{className:"input-left-buttons",children:d.jsx(le,{onClick:Z,variant:"text-alt",className:"gp-4",children:d.jsx(z0,{size:18})})}),d.jsxs("div",{className:"input-right-buttons",children:[!(x!=null&&x.length)&&!tt&&(n==null?void 0:n.enableAudioMessage)&&!c&&d.jsx(le,{onClick:N,variant:"text-alt",children:d.jsx(hm,{size:18})}),(!!c||!(n!=null&&n.enableAudioMessage)||tt||!!(x!=null&&x.length))&&d.jsx(le,{disabled:et,variant:"text-alt",className:"gp-4",onClick:tt?P:S,children:tt?d.jsx(T0,{size:24}):d.jsx(fm,{size:24})})]})]}),!!n.branding.showPoweredByGooey&&!g&&d.jsxs("p",{className:"font_10_500 gpt-4 gpb-6 text-darkGrey text-center gm-0",style:{fontSize:"8px"},children:["Powered by"," ",d.jsx("a",{href:"https://gooey.ai/copilot/",target:"_ablank",className:"text-darkGrey text-underline",children:"Gooey.AI"})]})]})]})},F0="number",M0=n=>({...n,id:hp(),role:"user"}),ym=Q.createContext({}),D0=n=>{var $,nt,V;const i=localStorage.getItem(um)||"",o=($=pe())==null?void 0:$.config,s=(nt=pe())==null?void 0:nt.layoutController,{conversations:p,handleAddConversation:c}=C0(i,o==null?void 0:o.integration_id),[m,g]=Q.useState(new Map),[h,x]=Q.useState(!1),[y,_]=Q.useState(!1),[R,F]=Q.useState(!0),[w,b]=Q.useState(!0),S=Q.useRef(At.CancelToken.source()),P=Q.useRef(null),N=Q.useRef(null),z=Q.useRef(null),H=k=>{z.current={...z.current,...k}},Z=k=>{b(!1);const O=Array.from(m.values()).pop(),W=O==null?void 0:O.conversation_id;x(!0);const rt=M0(k);xt({...k,conversation_id:W,citation_style:F0}),tt(rt)},tt=k=>{g(O=>new Map(O.set(k.id,k)))},et=Q.useCallback((k=0)=>{N.current&&N.current.scroll({top:k,behavior:"smooth"})},[N]),mt=Q.useCallback(()=>{setTimeout(()=>{var k;et((k=N==null?void 0:N.current)==null?void 0:k.scrollHeight)},10)},[et]),K=Q.useCallback(k=>{g(O=>{if((k==null?void 0:k.type)===On.CONVERSATION_START){x(!1),_(!0),P.current=k.bot_message_id;const W=new Map(O);return W.set(k.bot_message_id,{id:P.current,...k}),_0(k==null?void 0:k.user_id),W}if((k==null?void 0:k.type)===On.FINAL_RESPONSE&&(k==null?void 0:k.status)==="completed"){const W=new Map(O),rt=Array.from(O.keys()).pop(),it=O.get(rt),{output:pt,...gt}=k;W.set(rt,{...it,conversation_id:it==null?void 0:it.conversation_id,id:P.current,...pt,...gt}),_(!1);const ht={id:it==null?void 0:it.conversation_id,user_id:it==null?void 0:it.user_id,title:k==null?void 0:k.title,timestamp:k==null?void 0:k.created_at,bot_id:o==null?void 0:o.integration_id};return H(ht),c(Object.assign({},{...ht,messages:Array.from(W.values())})),W}if((k==null?void 0:k.type)===On.MESSAGE_PART){const W=new Map(O),rt=Array.from(O.keys()).pop(),it=O.get(rt),pt=((it==null?void 0:it.text)||"")+(k.text||"");return W.set(rt,{...it,...k,id:P.current,text:pt}),W}return O}),mt()},[o==null?void 0:o.integration_id,c,mt]),xt=async k=>{try{let O="";if(k!=null&&k.input_audio){const rt=new File([k.input_audio],`gooey-widget-recording-${hp()}.webm`);O=await mm(rt),k.input_audio=O}k={...o==null?void 0:o.payload,integration_id:o==null?void 0:o.integration_id,user_id:i,...k};const W=await pm(k,S.current,o==null?void 0:o.apiUrl);w0(W,K)}catch(O){console.error("Api Failed!",O),x(!1)}},jt=k=>{const O=new Map;k.forEach(W=>{O.set(W.id,{...W})}),g(O)},Et=()=>{!y&&!h?c(Object.assign({},z.current)):(ft(),c(Object.assign({},z.current))),(y||h)&&ft(),s!=null&&s.isMobile&&(s!=null&&s.isSidebarOpen)&&(s==null||s.toggleSidebar());const k=gooeyShadowRoot==null?void 0:gooeyShadowRoot.getElementById(Fa);k==null||k.focus(),_(!1),x(!1),It()},It=()=>{g(new Map),z.current={}},ft=()=>{window!=null&&window.GooeyEventSource?GooeyEventSource.close():S==null||S.current.cancel("Operation canceled by the user."),!y&&!h&&(S.current=At.CancelToken.source());const k=new Map(m),O=Array.from(m.keys());h&&(k.delete(O.pop()),g(k)),y&&(k.delete(O.pop()),k.delete(O.pop()),g(k)),H({messages:Array.from(k.values())}),S.current=At.CancelToken.source(),_(!1),x(!1)},zt=(k,O)=>{pm({button_pressed:{button_id:k,context_msg_id:O},integration_id:o==null?void 0:o.integration_id},S.current),g(W=>{const rt=new Map(W),it=W.get(O),pt=it.buttons.map(gt=>{if(gt.id===k)return{...gt,isPressed:!0}});return rt.set(O,{...it,buttons:pt}),rt})},bt=Q.useCallback(async k=>{var W;if(!k||!k.getMessages||((W=z.current)==null?void 0:W.id)===k.id)return F(!1);b(!0),F(!0);const O=await k.getMessages();return jt(O),H(k),F(!1),O},[]);Q.useEffect(()=>{b(!0),!(s!=null&&s.showNewConversationButton)&&p.length?bt(p[0]):F(!1),setTimeout(()=>{b(!1)},3e3)},[o,p,s==null?void 0:s.showNewConversationButton,bt]);const _t={sendPrompt:xt,messages:m,isSending:h,initializeQuery:Z,handleNewConversation:Et,cancelApiCall:ft,scrollMessageContainer:et,scrollContainerRef:N,isReceiving:y,handleFeedbackClick:zt,conversations:p,setActiveConversation:bt,currentConversationId:((V=z.current)==null?void 0:V.id)||null,isMessagesLoading:R,preventAutoplay:w};return d.jsx(ym.Provider,{value:_t,children:n.children})},wm='@charset "UTF-8";:export{primary:hsl(169,55%,82%);secondary:hsl(12,100%,97%);border-color:#eee;gooeyDanger:#dc3545}.gooey-incomingMsg{width:100%;word-wrap:normal}.gooey-incomingMsg audio{width:100%;height:40px}.gooey-incomingMsg video{width:360px;height:360px;border-radius:12px}.sources-listContainer{display:flex;min-height:72px;max-width:calc(100% + 16px);overflow:hidden}.sources-listContainer:hover{overflow-x:auto}.sources-card{background-color:#f0f0f0;border-radius:12px;cursor:pointer;min-width:160px;max-width:160px;height:64px;padding:8px;border:1px solid transparent}.sources-card:hover{border:1px solid #6c757d}.sources-card-disabled:hover{border:1px solid transparent}.sources-card p{display:-webkit-box;-webkit-line-clamp:2;word-break:break-all;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes wave-lines{0%{background-position:-468px 0}to{background-position:468px 0}}.sources-skeleton .line{height:12px;margin-bottom:6px;border-radius:2px;background:#82828233;background:-webkit-gradient(linear,left top,right top,color-stop(8%,rgba(130,130,130,.2)),color-stop(18%,rgba(130,130,130,.3)),color-stop(33%,rgba(130,130,130,.2)));background:linear-gradient(to right,#82828233 8%,#8282824d 18%,#82828233 33%);background-size:800px 100px;animation:wave-lines 1s infinite ease-out}.gooey-placeholderMsg-container{display:grid;width:100%;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));grid-auto-flow:row;gap:12px 12px}.markdown{max-width:none;font-size:16px!important}.markdown h1{font-weight:600}.markdown h1:first-child{margin-top:0}.markdown p{margin-bottom:12px}.markdown h2{font-weight:600;margin-bottom:1rem;margin-top:2rem}.markdown h2:first-child{margin-top:0}.markdown h3{font-weight:600;margin-bottom:.5rem;margin-top:1rem}.markdown h3:first-child{margin-top:0}.markdown h4{font-weight:600;margin-bottom:.5rem;margin-top:1rem}.markdown h4:first-child{margin-top:0}.markdown h5{font-weight:600}.markdown li{margin-bottom:12px}.markdown h5:first-child{margin-top:0}.markdown blockquote{--tw-border-opacity: 1;border-color:#9b9b9b;border-left-width:2px;line-height:1.5rem;margin:0;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.markdown blockquote>p{margin:0}.markdown blockquote>p:after,.markdown blockquote>p:before{display:none}.response-streaming>:not(ol):not(ul):not(pre):last-child:after,.response-streaming>pre:last-child code:after{content:"●";-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite;font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline}@supports (selector(:has(*))){.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child[*|\\:not-has\\(]:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ul:last-child>li:last-child:not(:has(*>li)):after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ol:last-child>li:last-child[*|\\:not-has\\(]:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ol:last-child>li:last-child:not(:has(*>li)):after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}}@supports not (selector(:has(*))){.response-streaming>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}}@-webkit-keyframes pulseSize{0%,to{opacity:1}50%{opacity:0}}@keyframes pulseSize{0%,to{opacity:1}50%{opacity:0}}';function Ma(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Nn=Ma();function bm(n){Nn=n}const vm=/[&<>"']/,U0=new RegExp(vm.source,"g"),_m=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,B0=new RegExp(_m.source,"g"),$0={"&":"&","<":"<",">":">",'"':""","'":"'"},km=n=>$0[n];function we(n,i){if(i){if(vm.test(n))return n.replace(U0,km)}else if(_m.test(n))return n.replace(B0,km);return n}const H0=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function V0(n){return n.replace(H0,(i,o)=>(o=o.toLowerCase(),o==="colon"?":":o.charAt(0)==="#"?o.charAt(1)==="x"?String.fromCharCode(parseInt(o.substring(2),16)):String.fromCharCode(+o.substring(1)):""))}const G0=/(^|[^\[])\^/g;function St(n,i){let o=typeof n=="string"?n:n.source;i=i||"";const s={replace:(p,c)=>{let m=typeof c=="string"?c:c.source;return m=m.replace(G0,"$1"),o=o.replace(p,m),s},getRegex:()=>new RegExp(o,i)};return s}function Sm(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const zr={exec:()=>null};function Em(n,i){const o=n.replace(/\|/g,(c,m,g)=>{let h=!1,x=m;for(;--x>=0&&g[x]==="\\";)h=!h;return h?"|":" |"}),s=o.split(/ \|/);let p=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),i)if(s.length>i)s.splice(i);else for(;s.length{delete c[w]}),o.headers=me.concat(m,c);const g=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(o)===!1||(h=h&&b.synchronous,g.unshift(b.fulfilled,b.rejected))});const x=[];this.interceptors.response.forEach(function(b){x.push(b.fulfilled,b.rejected)});let y,_=0,R;if(!h){const w=[om.bind(this),void 0];for(w.unshift.apply(w,g),w.push.apply(w,x),R=w.length,y=Promise.resolve(o);_{if(!s._listeners)return;let c=s._listeners.length;for(;c-- >0;)s._listeners[c](p);s._listeners=null}),this.promise.then=p=>{let c;const m=new Promise(g=>{s.subscribe(g),c=g}).then(p);return m.cancel=function(){s.unsubscribe(c)},m},i(function(c,m,g){s.reason||(s.reason=new Jn(c,m,g),o(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const o=this._listeners.indexOf(i);o!==-1&&this._listeners.splice(o,1)}static source(){let i;return{token:new Pa(function(p){i=p}),cancel:i}}}function g0(n){return function(o){return n.apply(null,o)}}function f0(n){return L.isObject(n)&&n.isAxiosError===!0}const Ia={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ia).forEach(([n,i])=>{Ia[i]=n});function lm(n){const i=new zn(n),o=Ep(zn.prototype.request,i);return L.extend(o,zn.prototype,i,{allOwnKeys:!0}),L.extend(o,i,null,{allOwnKeys:!0}),o.create=function(p){return lm(jn(n,p))},o}const At=lm(Ar);At.Axios=zn,At.CanceledError=Jn,At.CancelToken=Pa,At.isCancel=Wp,At.VERSION=am,At.toFormData=ji,At.AxiosError=lt,At.Cancel=At.CanceledError,At.all=function(i){return Promise.all(i)},At.spread=g0,At.isAxiosError=f0,At.mergeConfig=jn,At.AxiosHeaders=me,At.formToJSON=n=>Vp(L.isHTMLForm(n)?new FormData(n):n),At.getAdapter=im.getAdapter,At.HttpStatusCode=Ia,At.default=At;var h0={REACT_APP_GOOEY_SERVER:"https://api.gooey.ai",REACT_APP_BOT_ID:"5pV",NVM_INC:"/Users/anish/.nvm/versions/node/v18.20.2/include/node",TERM_PROGRAM:"vscode",NODE:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",INIT_CWD:"/Users/anish/code/gooey-web-widget",NVM_CD_FLAGS:"-q",PYENV_ROOT:"/Users/anish/.pyenv",npm_package_devDependencies_typescript:"^5.2.2",npm_package_dependencies_axios:"^1.6.5",npm_config_version_git_tag:"true",SHELL:"/bin/zsh",TERM:"xterm-256color",npm_package_devDependencies_vite:"^5.0.8",npm_package_dependencies_prism_react_renderer:"^2.3.1",TMPDIR:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",npm_package_devDependencies_clsx:"^2.1.0",npm_package_scripts_lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",npm_config_init_license:"MIT",TERM_PROGRAM_VERSION:"1.92.2",npm_package_devDependencies__vitejs_plugin_react:"^4.2.1",npm_package_scripts_dev:"vite",MallocNanoZone:"0",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",ZDOTDIR:"/Users/anish",npm_package_dependencies_uuid:"^9.0.1",npm_package_private:"true",npm_config_registry:"https://registry.yarnpkg.com",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.5",npm_package_dependencies_react_dom:"^18.2.0",npm_package_readmeFilename:"README.md",npm_package_dependencies_html_react_parser:"^5.1.10",USER:"anish",NVM_DIR:"/Users/anish/.nvm",npm_package_description:"A clean, self-hostable web widget for Gooey.AI Copilots, with streaming support with every major LLM, speech-reco, and Text-to-Speech covering 1000+ languages, photo uploads, feedback, and analytics.",npm_package_license:"Apache-2.0",npm_package_devDependencies__types_react:"^18.2.43",COMMAND_MODE:"unix2003",PUPPETEER_EXECUTABLE_PATH:"/opt/homebrew/bin/chromium",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.UNe8OYfcF2/Listeners",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_package_devDependencies_eslint:"^8.55.0",npm_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/yarn/bin/yarn.js",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^6.14.0",npm_package_devDependencies_vite_plugin_require_transform:"^1.0.21",npm_package_dependencies_marked:"^12.0.2",npm_package_devDependencies__types_react_dom:"^18.2.17",npm_package_devDependencies__typescript_eslint_parser:"^6.14.0",PATH:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/yarn--1725537777703-0.3496553142228733:/Users/anish/code/gooey-web-widget/node_modules/.bin:/Users/anish/.config/yarn/link/node_modules/.bin:/Users/anish/.yarn/bin:/Users/anish/.nvm/versions/node/v18.20.2/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/bin/node_modules/npm/bin/node-gyp-bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.pyenv/shims:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',_:"/Users/anish/code/gooey-web-widget/node_modules/.bin/vite",__CFBundleIdentifier:"com.microsoft.VSCode",USER_ZDOTDIR:"/Users/anish",PWD:"/Users/anish/code/gooey-web-widget",npm_package_devDependencies_eslint_plugin_react_hooks:"^4.6.0",npm_package_devDependencies__originjs_vite_plugin_commonjs:"^1.0.3",npm_package_scripts_preview:"vite preview",npm_config_nodeLinker:"node-modules",npm_lifecycle_event:"build",LANG:"en_US.UTF-8",npm_package_name:"gooey-chat",npm_package_devDependencies_sass:"^1.69.7",npm_package_scripts_build:"tsc && vite build",npm_config_version_commit_hooks:"true",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",npm_config_bin_links:"true",npm_package_devDependencies_vite_plugin_dts:"^3.7.0",XPC_SERVICE_NAME:"0",npm_package_version:"2.1.0",VSCODE_INJECTION:"1",HOME:"/Users/anish",SHLVL:"2",PYENV_SHELL:"zsh",npm_package_type:"module",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_save_prefix:"^",npm_config_strict_ssl:"true",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version_git_message:"v%s",LOGNAME:"anish",YARN_WRAP_OUTPUT:"false",npm_lifecycle_script:"tsc && vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/vscode-git-23f4d5e666.sock",npm_package_dependencies_react:"^18.2.0",NVM_BIN:"/Users/anish/.nvm/versions/node/v18.20.2/bin",npm_package_devDependencies__types_uuid:"^9.0.7",npm_config_version_git_sign:"",npm_config_ignore_scripts:"",npm_config_user_agent:"yarn/1.22.22 npm/? node/v18.20.2 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",npm_package_devDependencies__types_node:"^20.11.1",npm_config_init_version:"1.0.0",npm_config_ignore_optional:"",COLORTERM:"truecolor",npm_node_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",npm_config_version_tag_prefix:"v",NODE_ENV:"production"};const x0=`${h0.REACT_APP_GOOEY_SERVER}/v3/integrations/stream/`,y0=()=>({"Content-Type":"application/json"}),On={CONVERSATION_START:"conversation_start",FINAL_RESPONSE:"final_response",RUN_START:"run_start",RUNNING:"running",COMPLETED:"completed",MESSAGE_PART:"message_part"},pm=async(n,i,o="")=>{const s=y0(),p={citation_style:"number",use_url_shortener:!1,...n};return(await At.post(o||x0,JSON.stringify(p),{headers:s,responseType:"stream",cancelToken:i.token})).headers.get("Location")},w0=(n,i)=>{const o=new EventSource(n);window.GooeyEventSource=o,o.onmessage=s=>{const p=JSON.parse(s.data);p.type===On.FINAL_RESPONSE?(i(p),o.close()):i(p)}};var b0={REACT_APP_GOOEY_SERVER:"https://api.gooey.ai",REACT_APP_BOT_ID:"5pV",NVM_INC:"/Users/anish/.nvm/versions/node/v18.20.2/include/node",TERM_PROGRAM:"vscode",NODE:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",INIT_CWD:"/Users/anish/code/gooey-web-widget",NVM_CD_FLAGS:"-q",PYENV_ROOT:"/Users/anish/.pyenv",npm_package_devDependencies_typescript:"^5.2.2",npm_package_dependencies_axios:"^1.6.5",npm_config_version_git_tag:"true",SHELL:"/bin/zsh",TERM:"xterm-256color",npm_package_devDependencies_vite:"^5.0.8",npm_package_dependencies_prism_react_renderer:"^2.3.1",TMPDIR:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/",HOMEBREW_REPOSITORY:"/opt/homebrew",npm_package_devDependencies_clsx:"^2.1.0",npm_package_scripts_lint:"eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",npm_config_init_license:"MIT",TERM_PROGRAM_VERSION:"1.92.2",npm_package_devDependencies__vitejs_plugin_react:"^4.2.1",npm_package_scripts_dev:"vite",MallocNanoZone:"0",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",ZDOTDIR:"/Users/anish",npm_package_dependencies_uuid:"^9.0.1",npm_package_private:"true",npm_config_registry:"https://registry.yarnpkg.com",npm_package_devDependencies_eslint_plugin_react_refresh:"^0.4.5",npm_package_dependencies_react_dom:"^18.2.0",npm_package_readmeFilename:"README.md",npm_package_dependencies_html_react_parser:"^5.1.10",USER:"anish",NVM_DIR:"/Users/anish/.nvm",npm_package_description:"A clean, self-hostable web widget for Gooey.AI Copilots, with streaming support with every major LLM, speech-reco, and Text-to-Speech covering 1000+ languages, photo uploads, feedback, and analytics.",npm_package_license:"Apache-2.0",npm_package_devDependencies__types_react:"^18.2.43",COMMAND_MODE:"unix2003",PUPPETEER_EXECUTABLE_PATH:"/opt/homebrew/bin/chromium",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.UNe8OYfcF2/Listeners",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_package_devDependencies_eslint:"^8.55.0",npm_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/yarn/bin/yarn.js",npm_package_devDependencies__typescript_eslint_eslint_plugin:"^6.14.0",npm_package_devDependencies_vite_plugin_require_transform:"^1.0.21",npm_package_dependencies_marked:"^12.0.2",npm_package_devDependencies__types_react_dom:"^18.2.17",npm_package_devDependencies__typescript_eslint_parser:"^6.14.0",PATH:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/yarn--1725537777703-0.3496553142228733:/Users/anish/code/gooey-web-widget/node_modules/.bin:/Users/anish/.config/yarn/link/node_modules/.bin:/Users/anish/.yarn/bin:/Users/anish/.nvm/versions/node/v18.20.2/libexec/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/lib/node_modules/npm/bin/node-gyp-bin:/Users/anish/.nvm/versions/node/v18.20.2/bin/node_modules/npm/bin/node-gyp-bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.pyenv/shims:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/Users/anish/google-cloud-sdk/bin:/Users/anish/.local/bin:/Users/anish/.nvm/versions/node/v18.20.2/bin:/opt/homebrew/bin:/opt/homebrew/sbin",npm_config_argv:'{"remain":[],"cooked":["run","build"],"original":["build"]}',_:"/Users/anish/code/gooey-web-widget/node_modules/.bin/vite",__CFBundleIdentifier:"com.microsoft.VSCode",USER_ZDOTDIR:"/Users/anish",PWD:"/Users/anish/code/gooey-web-widget",npm_package_devDependencies_eslint_plugin_react_hooks:"^4.6.0",npm_package_devDependencies__originjs_vite_plugin_commonjs:"^1.0.3",npm_package_scripts_preview:"vite preview",npm_config_nodeLinker:"node-modules",npm_lifecycle_event:"build",LANG:"en_US.UTF-8",npm_package_name:"gooey-chat",npm_package_devDependencies_sass:"^1.69.7",npm_package_scripts_build:"tsc && vite build",npm_config_version_commit_hooks:"true",XPC_FLAGS:"0x0",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",npm_config_bin_links:"true",npm_package_devDependencies_vite_plugin_dts:"^3.7.0",XPC_SERVICE_NAME:"0",npm_package_version:"2.1.0",VSCODE_INJECTION:"1",HOME:"/Users/anish",SHLVL:"2",PYENV_SHELL:"zsh",npm_package_type:"module",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_save_prefix:"^",npm_config_strict_ssl:"true",HOMEBREW_PREFIX:"/opt/homebrew",npm_config_version_git_message:"v%s",LOGNAME:"anish",YARN_WRAP_OUTPUT:"false",npm_lifecycle_script:"tsc && vite build",VSCODE_GIT_IPC_HANDLE:"/var/folders/hd/8h7yzv6937506rv5mqd6gbzr0000gn/T/vscode-git-23f4d5e666.sock",npm_package_dependencies_react:"^18.2.0",NVM_BIN:"/Users/anish/.nvm/versions/node/v18.20.2/bin",npm_package_devDependencies__types_uuid:"^9.0.7",npm_config_version_git_sign:"",npm_config_ignore_scripts:"",npm_config_user_agent:"yarn/1.22.22 npm/? node/v18.20.2 darwin arm64",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",npm_package_devDependencies__types_node:"^20.11.1",npm_config_init_version:"1.0.0",npm_config_ignore_optional:"",COLORTERM:"truecolor",npm_node_execpath:"/Users/anish/.nvm/versions/node/v18.20.2/bin/node",npm_config_version_tag_prefix:"v",NODE_ENV:"production"};const v0=`${b0.REACT_APP_GOOEY_SERVER}/__/file-upload/`,mm=async n=>{var s;const i=new FormData;i.append("file",n);const o=await At.post(v0,i,{headers:{"Content-Type":"multipart/form-data"}});return(s=o==null?void 0:o.data)==null?void 0:s.url},um="user_id",_0=n=>{if(!(window.localStorage||null))return console.error("Local Storage not available");localStorage.getItem("user_id")||localStorage.setItem(um,n)},k0=n=>{var i,o;return(o=(i=n==null?void 0:n.messages)==null?void 0:i[0])==null?void 0:o.input_prompt},cm=n=>new Promise((i,o)=>{const s=indexedDB.open(n,1);s.onupgradeneeded=()=>{s.result.createObjectStore("conversations",{keyPath:"id",autoIncrement:!0})},s.onsuccess=()=>{i(s.result)},s.onerror=()=>{o(s.error)}}),S0=(n,i)=>new Promise((o,s)=>{const m=n.transaction(["conversations"],"readonly").objectStore("conversations").get(i);m.onsuccess=()=>{o(m.result)},m.onerror=()=>{s(m.error)}}),dm=(n,i,o)=>new Promise((s,p)=>{const g=n.transaction(["conversations"],"readonly").objectStore("conversations").getAll();g.onsuccess=()=>{const h=g.result.filter(x=>x.user_id===i&&x.bot_id===o).map(x=>{const y=Object.assign({},x);return y.title=k0(x),delete y.messages,y.getMessages=async()=>(await S0(n,x.id)).messages||[],y});s(h)},g.onerror=()=>{p(g.error)}}),E0=(n,i)=>new Promise((o,s)=>{const m=n.transaction(["conversations"],"readwrite").objectStore("conversations").put(i);m.onsuccess=()=>{o()},m.onerror=()=>{s(m.error)}}),gm="GOOEY_COPILOT_CONVERSATIONS_DB",C0=(n,i)=>{const[o,s]=Q.useState([]);return Q.useEffect(()=>{(async()=>{const m=await cm(gm),g=await dm(m,n,i);s(g.sort((h,x)=>new Date(x.timestamp).getTime()-new Date(h.timestamp).getTime()))})()},[i,n]),{conversations:o,handleAddConversation:async c=>{var h;if(!c||!((h=c.messages)!=null&&h.length))return;const m=await cm(gm);await E0(m,c);const g=await dm(m,n,i);s(g)}}},fm=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:i,width:i,children:d.jsx("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM385 231c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-71-71V376c0 13.3-10.7 24-24 24s-24-10.7-24-24V193.9l-71 71c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9L239 119c9.4-9.4 24.6-9.4 33.9 0L385 231z"})})})},T0=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:i,width:i,children:["// --!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.",d.jsx("path",{d:"M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM192 160H320c17.7 0 32 14.3 32 32V320c0 17.7-14.3 32-32 32H192c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32z"})]})})},hm=n=>{const i=n.size||24;return d.jsx(Dt,{children:d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",width:i,height:i,fill:"currentColor",...n,children:d.jsx("path",{d:"M240 96V256c0 26.5-21.5 48-48 48s-48-21.5-48-48V96c0-26.5 21.5-48 48-48s48 21.5 48 48zM96 96V256c0 53 43 96 96 96s96-43 96-96V96c0-53-43-96-96-96S96 43 96 96zM64 216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 89.1 66.2 162.7 152 174.4V464H120c-13.3 0-24 10.7-24 24s10.7 24 24 24h72 72c13.3 0 24-10.7 24-24s-10.7-24-24-24H216V430.4c85.8-11.7 152-85.3 152-174.4V216c0-13.3-10.7-24-24-24s-24 10.7-24 24v40c0 70.7-57.3 128-128 128s-128-57.3-128-128V216z"})})})},R0={audio:!0},A0=n=>{const{onCancel:i,onSend:o}=n,[s,p]=Q.useState(0),[c,m]=Q.useState(!1),[g,h]=Q.useState(!1),[x,y]=Q.useState([]),_=Q.useRef(null);Q.useEffect(()=>{let z;return c&&(z=setInterval(()=>p(s+1),10)),()=>clearInterval(z)},[c,s]);const R=z=>{const H=new MediaRecorder(z);_.current=H,H.start(),H.onstop=function(){z==null||z.getTracks().forEach(Z=>Z==null?void 0:Z.stop())},H.ondataavailable=function(Z){y(tt=>[...tt,Z.data])},m(!0)},F=function(z){console.log("The following error occured: "+z)},w=()=>{_.current&&(_.current.stop(),m(!1))};Q.useEffect(()=>{var z,H,Z,tt,et,mt;if(navigator.mediaDevices.getUserMedia=((z=navigator==null?void 0:navigator.mediaDevices)==null?void 0:z.getUserMedia)||((H=navigator==null?void 0:navigator.mediaDevices)==null?void 0:H.webkitGetUserMedia)||((Z=navigator==null?void 0:navigator.mediaDevices)==null?void 0:Z.mozGetUserMedia)||((tt=navigator==null?void 0:navigator.mediaDevices)==null?void 0:tt.msGetUserMedia),!((et=navigator==null?void 0:navigator.mediaDevices)!=null&&et.getUserMedia)){console.error("The mediaDevices.getUserMedia() method is not supported.");return}(mt=navigator==null?void 0:navigator.mediaDevices)==null||mt.getUserMedia(R0).then(R,F)},[]),Q.useEffect(()=>{if(!g||!x.length)return;const z=new Blob(x,{type:"audio/mp3;codecs=mpeg"});y([]),o(z),h(!1)},[x,o,g]);const b=()=>{w(),i()},S=()=>{w(),h(!0)},P=Math.floor(s%36e4/6e3),N=Math.floor(s%6e3/100);return d.jsxs("div",{className:"gpl-8 gpr-8 d-flex align-center gpb-25",children:[d.jsx(le,{variant:"text",className:"bg-light gp-8",style:{borderRadius:"100px",height:"44px"},onClick:b,children:d.jsx(Ei,{size:"24"})}),d.jsxs("div",{className:"gml-24 d-flex b-1 gp-2 w-100 pos-relative justify-between align-center",style:{borderRadius:"40px",backgroundColor:"#fae1e1",height:"44px"},children:[d.jsx("div",{}),d.jsxs("div",{className:"d-flex align-center",children:[d.jsx(hm,{size:"16",className:"anim-blink-self text-gooeyDanger",style:{}}),d.jsxs("p",{className:"gpl-4 text-gooeyDanger font_14_400",children:[P.toString().padStart(2,"0"),":",N.toString().padStart(2,"0")]})]}),d.jsx(le,{onClick:S,variant:"text-alt",style:{height:"44px"},children:d.jsx(fm,{size:24})})]})]})},j0=":export{primary:hsl(169,55%,82%);secondary:hsl(12,100%,97%);border-color:#eee;gooeyDanger:#dc3545}.gooeyChat-chat-input{width:100%;bottom:0;background:transparent}.gooeyChat-chat-input textarea{width:100%;outline:none;max-height:200px;height:44px;resize:none;position:relative}.gooeyChat-chat-input textarea:focus{outline:1px solid #f0f0f0}.input-left-buttons{position:absolute;left:4px;top:7px}.input-right-buttons{position:absolute;right:4px;top:3px}.file-preview-box img{height:80px;max-width:100px;object-fit:cover}.uploading-box{filter:brightness(.2)}",z0=n=>{const i=n.size||16;return d.jsx(Dt,{children:d.jsx("svg",{height:i,width:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 384 512",children:d.jsx("path",{d:"M32 128C32 57.3 89.3 0 160 0s128 57.3 128 128V320c0 44.2-35.8 80-80 80s-80-35.8-80-80V160c0-17.7 14.3-32 32-32s32 14.3 32 32V320c0 8.8 7.2 16 16 16s16-7.2 16-16V128c0-35.3-28.7-64-64-64s-64 28.7-64 64V336c0 61.9 50.1 112 112 112s112-50.1 112-112V160c0-17.7 14.3-32 32-32s32 14.3 32 32V336c0 97.2-78.8 176-176 176s-176-78.8-176-176V128z"})})})},O0=n=>{const i=n.size||16;return d.jsx("div",{className:"circular-loader",children:d.jsx("svg",{className:"circular",viewBox:"25 25 50 50",height:i,width:i,children:d.jsx("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"2","stroke-miterlimit":"10"})})})},N0=({files:n})=>n?d.jsx("div",{className:"d-flex",style:{gap:"12px",flexWrap:"wrap"},children:n.map((i,o)=>{const{isUploading:s,name:p,data:c,removeFile:m}=i,g=URL.createObjectURL(c),h=i.type.split("/")[0];return d.jsx("div",{className:"d-flex",children:h==="image"?d.jsxs("div",{className:Pt("file-preview-box br-large pos-relative"),children:[s&&d.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1},children:d.jsx(O0,{size:32})}),d.jsx("div",{style:{position:"absolute",top:"6px",right:"-16px",transform:"translate(-50%, -50%)",zIndex:1},children:d.jsx(Qn,{className:"bg-white gp-4 b-1",onClick:m,children:d.jsx(Ei,{size:12})})}),d.jsx("div",{className:Pt(s&&"uploading-box","overflow-hidden file-preview-box"),children:d.jsx("a",{href:g,target:"_blank",children:d.jsx("img",{src:g,alt:`preview-${p}`,className:"br-large b-1"})})})]}):d.jsx("div",{children:d.jsx("p",{children:i.name})})},o)})}):null;on(j0);const Fa="gooeyChat-input",xm=44,L0="image/*",P0=n=>new Promise((i,o)=>{const s=new FileReader;s.onload=p=>{const c=p.target.result,m=new Blob([new Uint8Array(c)],{type:n.type});i(m)},s.onerror=o,s.readAsArrayBuffer(n)}),I0=()=>{const{config:n}=pe(),{initializeQuery:i,isSending:o,cancelApiCall:s,isReceiving:p}=an(),[c,m]=Q.useState(""),[g,h]=Q.useState(!1),[x,y]=Q.useState(null),_=Q.useRef(null),R=()=>{const K=_.current;K.style.height=xm+"px"},F=K=>{const{value:xt}=K.target;m(xt),xt||R()},w=K=>{if(K.keyCode===13&&!K.shiftKey){if(o||p)return;K.preventDefault(),S()}else K.keyCode===13&&K.shiftKey&&b()},b=()=>{const K=_.current;K.scrollHeight>xm&&(K==null||K.setAttribute("style","height:"+K.scrollHeight+"px !important"))},S=()=>{if(!c.trim()&&!(x!=null&&x.length)||et)return null;const K={input_prompt:c.trim()};x!=null&&x.length&&(K.input_images=x.map(xt=>xt.gooeyUrl),y([])),i(K),m(""),R()},P=()=>{s()},N=()=>{h(!0)},z=K=>{i({input_audio:K}),h(!1)},H=K=>{const xt=Array.from(K.target.files);!xt||!xt.length||y(xt.map((jt,Et)=>(P0(jt).then(It=>{const ft=new File([It],jt.name);mm(ft).then(zt=>{y(bt=>bt[Et]?(bt[Et].isUploading=!1,bt[Et].gooeyUrl=zt,[...bt]):bt)})}),{name:jt.name,type:jt.type.split("/")[0],data:jt,gooeyUrl:"",isUploading:!0,removeFile:()=>{y(It=>(It.splice(Et,1),[...It]))}})))},Z=()=>{const K=document.createElement("input");K.type="file",K.accept=L0,K.onchange=H,K.click()};if(!n)return null;const tt=o||p,et=!tt&&!o&&c.trim().length===0&&!(x!=null&&x.length)||(x==null?void 0:x.some(K=>K.isUploading)),mt=Q.useMemo(()=>n==null?void 0:n.enablePhotoUpload,[n==null?void 0:n.enablePhotoUpload]);return d.jsxs(Xn.Fragment,{children:[x&&x.length>0&&d.jsx("div",{className:"gp-12 b-1 br-large gmb-12 gm-12",children:d.jsx(N0,{files:x})}),d.jsxs("div",{className:Pt("gooeyChat-chat-input gpr-8 gpl-8",!n.branding.showPoweredByGooey&&"gpb-8"),children:[g?d.jsx(A0,{onSend:z,onCancel:()=>h(!1)}):d.jsxs("div",{className:"pos-relative",children:[d.jsx("textarea",{value:c,ref:_,id:Fa,onChange:F,onKeyDown:w,className:Pt("br-large b-1 font_16_500 bg-white gpt-10 gpb-10 gpr-40 flex-1 gm-0",mt?"gpl-32":"gpl-12"),placeholder:`Message ${n.branding.name||""}`}),mt&&d.jsx("div",{className:"input-left-buttons",children:d.jsx(le,{onClick:Z,variant:"text-alt",className:"gp-4",children:d.jsx(z0,{size:18})})}),d.jsxs("div",{className:"input-right-buttons",children:[!(x!=null&&x.length)&&!tt&&(n==null?void 0:n.enableAudioMessage)&&!c&&d.jsx(le,{onClick:N,variant:"text-alt",children:d.jsx(hm,{size:18})}),(!!c||!(n!=null&&n.enableAudioMessage)||tt||!!(x!=null&&x.length))&&d.jsx(le,{disabled:et,variant:"text-alt",className:"gp-4",onClick:tt?P:S,children:tt?d.jsx(T0,{size:24}):d.jsx(fm,{size:24})})]})]}),!!n.branding.showPoweredByGooey&&!g&&d.jsxs("p",{className:"font_10_500 gpt-4 gpb-6 text-darkGrey text-center gm-0",style:{fontSize:"8px"},children:["Powered by"," ",d.jsx("a",{href:"https://gooey.ai/copilot/",target:"_ablank",className:"text-darkGrey text-underline",children:"Gooey.AI"})]})]})]})},F0="number",M0=n=>({...n,id:hp(),role:"user"}),ym=Q.createContext({}),D0=n=>{var $,nt,V;const i=localStorage.getItem(um)||"",o=($=pe())==null?void 0:$.config,s=(nt=pe())==null?void 0:nt.layoutController,{conversations:p,handleAddConversation:c}=C0(i,o==null?void 0:o.integration_id),[m,g]=Q.useState(new Map),[h,x]=Q.useState(!1),[y,_]=Q.useState(!1),[R,F]=Q.useState(!0),[w,b]=Q.useState(!0),S=Q.useRef(At.CancelToken.source()),P=Q.useRef(null),N=Q.useRef(null),z=Q.useRef(null),H=k=>{z.current={...z.current,...k}},Z=k=>{b(!1);const O=Array.from(m.values()).pop(),W=O==null?void 0:O.conversation_id;x(!0);const rt=M0(k);xt({...k,conversation_id:W,citation_style:F0}),tt(rt)},tt=k=>{g(O=>new Map(O.set(k.id,k)))},et=Q.useCallback((k=0)=>{N.current&&N.current.scroll({top:k,behavior:"smooth"})},[N]),mt=Q.useCallback(()=>{setTimeout(()=>{var k;et((k=N==null?void 0:N.current)==null?void 0:k.scrollHeight)},10)},[et]),K=Q.useCallback(k=>{g(O=>{if((k==null?void 0:k.type)===On.CONVERSATION_START){x(!1),_(!0),P.current=k.bot_message_id;const W=new Map(O);return W.set(k.bot_message_id,{id:P.current,...k}),_0(k==null?void 0:k.user_id),W}if((k==null?void 0:k.type)===On.FINAL_RESPONSE&&(k==null?void 0:k.status)==="completed"){const W=new Map(O),rt=Array.from(O.keys()).pop(),it=O.get(rt),{output:pt,...gt}=k;W.set(rt,{...it,conversation_id:it==null?void 0:it.conversation_id,id:P.current,...pt,...gt}),_(!1);const ht={id:it==null?void 0:it.conversation_id,user_id:it==null?void 0:it.user_id,title:k==null?void 0:k.title,timestamp:k==null?void 0:k.created_at,bot_id:o==null?void 0:o.integration_id};return H(ht),c(Object.assign({},{...ht,messages:Array.from(W.values())})),W}if((k==null?void 0:k.type)===On.MESSAGE_PART){const W=new Map(O),rt=Array.from(O.keys()).pop(),it=O.get(rt),pt=((it==null?void 0:it.text)||"")+(k.text||"");return W.set(rt,{...it,...k,id:P.current,text:pt}),W}return O}),mt()},[o==null?void 0:o.integration_id,c,mt]),xt=async k=>{try{let O="";if(k!=null&&k.input_audio){const rt=new File([k.input_audio],`gooey-widget-recording-${hp()}.webm`);O=await mm(rt),k.input_audio=O}k={...o==null?void 0:o.payload,integration_id:o==null?void 0:o.integration_id,user_id:i,...k};const W=await pm(k,S.current,o==null?void 0:o.apiUrl);w0(W,K)}catch(O){console.error("Api Failed!",O),x(!1)}},jt=k=>{const O=new Map;k.forEach(W=>{O.set(W.id,{...W})}),g(O)},Et=()=>{!y&&!h?c(Object.assign({},z.current)):(ft(),c(Object.assign({},z.current))),(y||h)&&ft(),s!=null&&s.isMobile&&(s!=null&&s.isSidebarOpen)&&(s==null||s.toggleSidebar());const k=gooeyShadowRoot==null?void 0:gooeyShadowRoot.getElementById(Fa);k==null||k.focus(),_(!1),x(!1),It()},It=()=>{g(new Map),z.current={}},ft=()=>{window!=null&&window.GooeyEventSource?GooeyEventSource.close():S==null||S.current.cancel("Operation canceled by the user."),!y&&!h&&(S.current=At.CancelToken.source());const k=new Map(m),O=Array.from(m.keys());h&&(k.delete(O.pop()),g(k)),y&&(k.delete(O.pop()),k.delete(O.pop()),g(k)),H({messages:Array.from(k.values())}),S.current=At.CancelToken.source(),_(!1),x(!1)},zt=(k,O)=>{pm({button_pressed:{button_id:k,context_msg_id:O},integration_id:o==null?void 0:o.integration_id},S.current),g(W=>{const rt=new Map(W),it=W.get(O),pt=it.buttons.map(gt=>{if(gt.id===k)return{...gt,isPressed:!0}});return rt.set(O,{...it,buttons:pt}),rt})},bt=Q.useCallback(async k=>{var W;if(!k||!k.getMessages||((W=z.current)==null?void 0:W.id)===k.id)return F(!1);b(!0),F(!0);const O=await k.getMessages();return jt(O),H(k),F(!1),O},[]);Q.useEffect(()=>{b(!0),!(s!=null&&s.showNewConversationButton)&&p.length?bt(p[0]):F(!1),setTimeout(()=>{b(!1)},3e3)},[o,p,s==null?void 0:s.showNewConversationButton,bt]);const _t={sendPrompt:xt,messages:m,isSending:h,initializeQuery:Z,handleNewConversation:Et,cancelApiCall:ft,scrollMessageContainer:et,scrollContainerRef:N,isReceiving:y,handleFeedbackClick:zt,conversations:p,setActiveConversation:bt,currentConversationId:((V=z.current)==null?void 0:V.id)||null,isMessagesLoading:R,preventAutoplay:w};return d.jsx(ym.Provider,{value:_t,children:n.children})},wm='@charset "UTF-8";:export{primary:hsl(169,55%,82%);secondary:hsl(12,100%,97%);border-color:#eee;gooeyDanger:#dc3545}.gooey-incomingMsg{width:100%;word-wrap:normal}.gooey-incomingMsg audio{width:100%;height:40px}.gooey-incomingMsg video{width:360px;height:360px;border-radius:12px}.sources-listContainer{display:flex;min-height:72px;max-width:calc(100% + 16px);overflow:hidden}.sources-listContainer:hover{overflow-x:auto}.sources-card{background-color:#f0f0f0;border-radius:12px;cursor:pointer;min-width:160px;max-width:160px;height:64px;padding:8px;border:1px solid transparent}.sources-card:hover{border:1px solid #6c757d}.sources-card-disabled:hover{border:1px solid transparent}.sources-card p{display:-webkit-box;-webkit-line-clamp:2;word-break:break-all;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}@keyframes wave-lines{0%{background-position:-468px 0}to{background-position:468px 0}}.sources-skeleton .line{height:12px;margin-bottom:6px;border-radius:2px;background:#82828233;background:-webkit-gradient(linear,left top,right top,color-stop(8%,rgba(130,130,130,.2)),color-stop(18%,rgba(130,130,130,.3)),color-stop(33%,rgba(130,130,130,.2)));background:linear-gradient(to right,#82828233 8%,#8282824d 18%,#82828233 33%);background-size:800px 100px;animation:wave-lines 1s infinite ease-out}.gooey-placeholderMsg-container{display:grid;width:100%;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));grid-auto-flow:row;gap:12px 12px}.markdown{max-width:none;font-size:16px!important}.markdown h1{font-weight:600}.markdown h1:first-child{margin-top:0}.markdown p{margin-bottom:12px}.markdown h2{font-weight:600;margin-bottom:1rem;margin-top:2rem}.markdown h2:first-child{margin-top:0}.markdown h3{font-weight:600;margin-bottom:.5rem;margin-top:1rem}.markdown h3:first-child{margin-top:0}.markdown h4{font-weight:600;margin-bottom:.5rem;margin-top:1rem}.markdown h4:first-child{margin-top:0}.markdown h5{font-weight:600}.markdown li{margin-bottom:12px}.markdown h5:first-child{margin-top:0}.markdown blockquote{--tw-border-opacity: 1;border-color:#9b9b9b;border-left-width:2px;line-height:1.5rem;margin:0;padding-bottom:.5rem;padding-left:1rem;padding-top:.5rem}.markdown blockquote>p{margin:0}.markdown blockquote>p:after,.markdown blockquote>p:before{display:none}.response-streaming>:not(ol):not(ul):not(pre):last-child:after,.response-streaming>pre:last-child code:after{content:"●";-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite;font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline}@supports (selector(:has(*))){.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ol:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ol:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child>ul:last-child>li:last-child>ul:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child[*|\\:not-has\\(]:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ul:last-child>li:last-child:not(:has(*>li)):after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ol:last-child>li:last-child[*|\\:not-has\\(]:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}.response-streaming>ol:last-child>li:last-child:not(:has(*>li)):after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}}@supports not (selector(:has(*))){.response-streaming>ol:last-child>li:last-child:after,.response-streaming>ul:last-child>li:last-child:after{content:"●";font-family:Circle,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif;line-height:normal;margin-left:.25rem;vertical-align:baseline;-webkit-font-smoothing:subpixel-antialiased;-webkit-animation:pulseSize .5s ease-in-out infinite;animation:pulseSize .5s ease-in-out infinite}}@-webkit-keyframes pulseSize{0%,to{opacity:1}50%{opacity:0}}@keyframes pulseSize{0%,to{opacity:1}50%{opacity:0}}';function Ma(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let Nn=Ma();function bm(n){Nn=n}const vm=/[&<>"']/,U0=new RegExp(vm.source,"g"),_m=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,B0=new RegExp(_m.source,"g"),$0={"&":"&","<":"<",">":">",'"':""","'":"'"},km=n=>$0[n];function we(n,i){if(i){if(vm.test(n))return n.replace(U0,km)}else if(_m.test(n))return n.replace(B0,km);return n}const H0=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function V0(n){return n.replace(H0,(i,o)=>(o=o.toLowerCase(),o==="colon"?":":o.charAt(0)==="#"?o.charAt(1)==="x"?String.fromCharCode(parseInt(o.substring(2),16)):String.fromCharCode(+o.substring(1)):""))}const G0=/(^|[^\[])\^/g;function St(n,i){let o=typeof n=="string"?n:n.source;i=i||"";const s={replace:(p,c)=>{let m=typeof c=="string"?c:c.source;return m=m.replace(G0,"$1"),o=o.replace(p,m),s},getRegex:()=>new RegExp(o,i)};return s}function Sm(n){try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const zr={exec:()=>null};function Em(n,i){const o=n.replace(/\|/g,(c,m,g)=>{let h=!1,x=m;for(;--x>=0&&g[x]==="\\";)h=!h;return h?"|":" |"}),s=o.split(/ \|/);let p=0;if(s[0].trim()||s.shift(),s.length>0&&!s[s.length-1].trim()&&s.pop(),i)if(s.length>i)s.splice(i);else for(;s.length{const c=p.match(/^\s+/);if(c===null)return p;const[m]=c;return m.length>=s.length?p.slice(s.length):p}).join(` `)}class Ii{constructor(i){Tt(this,"options");Tt(this,"rules");Tt(this,"lexer");this.options=i||Nn}space(i){const o=this.rules.block.newline.exec(i);if(o&&o[0].length>0)return{type:"space",raw:o[0]}}code(i){const o=this.rules.block.code.exec(i);if(o){const s=o[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:o[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Pi(s,` `)}}}fences(i){const o=this.rules.block.fences.exec(i);if(o){const s=o[0],p=q0(s,o[3]||"");return{type:"code",raw:s,lang:o[2]?o[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):o[2],text:p}}}heading(i){const o=this.rules.block.heading.exec(i);if(o){let s=o[2].trim();if(/#$/.test(s)){const p=Pi(s,"#");(this.options.pedantic||!p||/ $/.test(p))&&(s=p.trim())}return{type:"heading",raw:o[0],depth:o[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(i){const o=this.rules.block.hr.exec(i);if(o)return{type:"hr",raw:o[0]}}blockquote(i){const o=this.rules.block.blockquote.exec(i);if(o){let s=o[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`