robodialog 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/widget.js CHANGED
@@ -3,7 +3,7 @@ var Ep=Object.defineProperty;var Ap=(be,Fe,N)=>Fe in be?Ep(be,Fe,{enumerable:!0,
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[Bi]=this[Bi]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=ln(o);r[a]||(qc(s,o),r[a]=!0)}return y.isArray(e)?e.forEach(i):i(e),this}};De.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),y.reduceDescriptors(De.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}}),y.freezeMethods(De);function Wr(n,e){const t=this||an,r=e||t,s=De.from(r.headers);let i=r.data;return y.forEach(n,function(a){i=a.call(t,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function Hi(n){return!!(n&&n.__CANCEL__)}function Yt(n,e,t){L.call(this,n??"canceled",L.ERR_CANCELED,e,t),this.name="CanceledError"}y.inherits(Yt,L,{__CANCEL__:!0});function Wi(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new L("Request failed with status code "+t.status,[L.ERR_BAD_REQUEST,L.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Bc(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function Hc(n,e){n=n||10;const t=new Array(n),r=new Array(n);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[i];o||(o=c),t[s]=l,r[s]=c;let d=i,g=0;for(;d!==s;)g+=t[d++],d=d%n;if(s=(s+1)%n,s===i&&(i=(i+1)%n),c-o<e)return;const h=u&&c-u;return h?Math.round(g*1e3/h):void 0}}function Wc(n,e){let t=0,r=1e3/e,s,i;const o=(c,u=Date.now())=>{t=u,s=null,i&&(clearTimeout(i),i=null),n(...c)};return[(...c)=>{const u=Date.now(),d=u-t;d>=r?o(c,u):(s=c,i||(i=setTimeout(()=>{i=null,o(s)},r-d)))},()=>s&&o(s)]}const Dn=(n,e,t=3)=>{let r=0;const s=Hc(50,250);return Wc(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,l=o-r,c=s(l),u=o<=a;r=o;const d={loaded:o,total:a,progress:a?o/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-o)/c:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(d)},t)},Vi=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},Yi=n=>(...e)=>y.asap(()=>n(...e)),Vc=xe.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,xe.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(xe.origin),xe.navigator&&/(msie|trident)/i.test(xe.navigator.userAgent)):()=>!0,Yc=xe.hasStandardBrowserEnv?{write(n,e,t,r,s,i,o){if(typeof document>"u")return;const a=[`${n}=${encodeURIComponent(e)}`];y.isNumber(t)&&a.push(`expires=${new Date(t).toUTCString()}`),y.isString(r)&&a.push(`path=${r}`),y.isString(s)&&a.push(`domain=${s}`),i===!0&&a.push("secure"),y.isString(o)&&a.push(`SameSite=${o}`),document.cookie=a.join("; ")},read(n){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+n+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(n){this.write(n,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Xc(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function Jc(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function Xi(n,e,t){let r=!Xc(e);return n&&(r||t==!1)?Jc(n,e):e}const Ji=n=>n instanceof De?{...n}:n;function Rt(n,e){e=e||{};const t={};function r(c,u,d,g){return y.isPlainObject(c)&&y.isPlainObject(u)?y.merge.call({caseless:g},c,u):y.isPlainObject(u)?y.merge({},u):y.isArray(u)?u.slice():u}function s(c,u,d,g){if(y.isUndefined(u)){if(!y.isUndefined(c))return r(void 0,c,d,g)}else return r(c,u,d,g)}function i(c,u){if(!y.isUndefined(u))return r(void 0,u)}function o(c,u){if(y.isUndefined(u)){if(!y.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in n)return r(void 0,c)}const l={url:i,method:i,data:i,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:a,headers:(c,u,d)=>s(Ji(c),Ji(u),d,!0)};return y.forEach(Object.keys({...n,...e}),function(u){const d=l[u]||s,g=d(n[u],e[u],u);y.isUndefined(g)&&d!==a||(t[u]=g)}),t}const Zi=n=>{const e=Rt({},n);let{data:t,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=e;if(e.headers=o=De.from(o),e.url=ji(Xi(e.baseURL,e.url,e.allowAbsoluteUrls),n.params,n.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),y.isFormData(t)){if(xe.hasStandardBrowserEnv||xe.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(y.isFunction(t.getHeaders)){const l=t.getHeaders(),c=["content-type","content-length"];Object.entries(l).forEach(([u,d])=>{c.includes(u.toLowerCase())&&o.set(u,d)})}}if(xe.hasStandardBrowserEnv&&(r&&y.isFunction(r)&&(r=r(e)),r||r!==!1&&Vc(e.url))){const l=s&&i&&Yc.read(i);l&&o.set(s,l)}return e},Zc=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(t,r){const s=Zi(n);let i=s.data;const o=De.from(s.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=s,u,d,g,h,f;function m(){h&&h(),f&&f(),s.cancelToken&&s.cancelToken.unsubscribe(u),s.signal&&s.signal.removeEventListener("abort",u)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,!0),b.timeout=s.timeout;function v(){if(!b)return;const w=De.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:w,config:n,request:b};Wi(function(P){t(P),m()},function(P){r(P),m()},_),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(r(new L("Request aborted",L.ECONNABORTED,n,b)),b=null)},b.onerror=function(k){const _=k&&k.message?k.message:"Network Error",S=new L(_,L.ERR_NETWORK,n,b);S.event=k||null,r(S),b=null},b.ontimeout=function(){let k=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const _=s.transitional||zi;s.timeoutErrorMessage&&(k=s.timeoutErrorMessage),r(new L(k,_.clarifyTimeoutError?L.ETIMEDOUT:L.ECONNABORTED,n,b)),b=null},i===void 0&&o.setContentType(null),"setRequestHeader"in b&&y.forEach(o.toJSON(),function(k,_){b.setRequestHeader(_,k)}),y.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),a&&a!=="json"&&(b.responseType=s.responseType),c&&([g,f]=Dn(c,!0),b.addEventListener("progress",g)),l&&b.upload&&([d,h]=Dn(l),b.upload.addEventListener("progress",d),b.upload.addEventListener("loadend",h)),(s.cancelToken||s.signal)&&(u=w=>{b&&(r(!w||w.type?new Yt(null,n,b):w),b.abort(),b=null)},s.cancelToken&&s.cancelToken.subscribe(u),s.signal&&(s.signal.aborted?u():s.signal.addEventListener("abort",u)));const x=Bc(s.url);if(x&&xe.protocols.indexOf(x)===-1){r(new L("Unsupported protocol "+x+":",L.ERR_BAD_REQUEST,n));return}b.send(i||null)})},Gc=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let r=new AbortController,s;const i=function(c){if(!s){s=!0,a();const u=c instanceof Error?c:this.reason;r.abort(u instanceof L?u:new Yt(u instanceof Error?u.message:u))}};let o=e&&setTimeout(()=>{o=null,i(new L(`timeout ${e} of ms exceeded`,L.ETIMEDOUT))},e);const a=()=>{n&&(o&&clearTimeout(o),o=null,n.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),n=null)};n.forEach(c=>c.addEventListener("abort",i));const{signal:l}=r;return l.unsubscribe=()=>y.asap(a),l}},Kc=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let r=0,s;for(;r<t;)s=r+e,yield n.slice(r,s),r=s},Qc=async function*(n,e){for await(const t of eu(n))yield*Kc(t,e)},eu=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Gi=(n,e,t,r)=>{const s=Qc(n,e);let i=0,o,a=l=>{o||(o=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:c,value:u}=await s.next();if(c){a(),l.close();return}let d=u.byteLength;if(t){let g=i+=d;t(g)}l.enqueue(new Uint8Array(u))}catch(c){throw a(c),c}},cancel(l){return a(l),s.return()}},{highWaterMark:2})},Ki=64*1024,{isFunction:In}=y,tu=(({Request:n,Response:e})=>({Request:n,Response:e}))(y.global),{ReadableStream:Qi,TextEncoder:eo}=y.global,to=(n,...e)=>{try{return!!n(...e)}catch{return!1}},nu=n=>{n=y.merge.call({skipUndefined:!0},tu,n);const{fetch:e,Request:t,Response:r}=n,s=e?In(e):typeof fetch=="function",i=In(t),o=In(r);if(!s)return!1;const a=s&&In(Qi),l=s&&(typeof eo=="function"?(f=>m=>f.encode(m))(new eo):async f=>new Uint8Array(await new t(f).arrayBuffer())),c=i&&a&&to(()=>{let f=!1;const m=new t(xe.origin,{body:new Qi,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!m}),u=o&&a&&to(()=>y.isReadableStream(new r("").body)),d={stream:u&&(f=>f.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!d[f]&&(d[f]=(m,b)=>{let v=m&&m[f];if(v)return v.call(m);throw new L(`Response type '${f}' is not supported`,L.ERR_NOT_SUPPORT,b)})});const g=async f=>{if(f==null)return 0;if(y.isBlob(f))return f.size;if(y.isSpecCompliantForm(f))return(await new t(xe.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(y.isArrayBufferView(f)||y.isArrayBuffer(f))return f.byteLength;if(y.isURLSearchParams(f)&&(f=f+""),y.isString(f))return(await l(f)).byteLength},h=async(f,m)=>{const b=y.toFiniteNumber(f.getContentLength());return b??g(m)};return async f=>{let{url:m,method:b,data:v,signal:x,cancelToken:w,timeout:k,onDownloadProgress:_,onUploadProgress:S,responseType:P,headers:T,withCredentials:A="same-origin",fetchOptions:D}=Zi(f),E=e||fetch;P=P?(P+"").toLowerCase():"text";let j=Gc([x,w&&w.toAbortSignal()],k),Z=null;const se=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let Oe;try{if(S&&c&&b!=="get"&&b!=="head"&&(Oe=await h(T,v))!==0){let R=new t(m,{method:"POST",body:v,duplex:"half"}),$;if(y.isFormData(v)&&($=R.headers.get("content-type"))&&T.setContentType($),R.body){const[F,I]=Vi(Oe,Dn(Yi(S)));v=Gi(R.body,Ki,F,I)}}y.isString(A)||(A=A?"include":"omit");const G=i&&"credentials"in t.prototype,ye={...D,signal:j,method:b.toUpperCase(),headers:T.normalize().toJSON(),body:v,duplex:"half",credentials:G?A:void 0};Z=i&&new t(m,ye);let he=await(i?E(Z,D):E(m,ye));const Be=u&&(P==="stream"||P==="response");if(u&&(_||Be&&se)){const R={};["status","statusText","headers"].forEach(q=>{R[q]=he[q]});const $=y.toFiniteNumber(he.headers.get("content-length")),[F,I]=_&&Vi($,Dn(Yi(_),!0))||[];he=new r(Gi(he.body,Ki,F,()=>{I&&I(),se&&se()}),R)}P=P||"text";let C=await d[y.findKey(d,P)||"text"](he,f);return!Be&&se&&se(),await new Promise((R,$)=>{Wi(R,$,{data:C,headers:De.from(he.headers),status:he.status,statusText:he.statusText,config:f,request:Z})})}catch(G){throw se&&se(),G&&G.name==="TypeError"&&/Load failed|fetch/i.test(G.message)?Object.assign(new L("Network Error",L.ERR_NETWORK,f,Z),{cause:G.cause||G}):L.from(G,G&&G.code,f,Z)}}},ru=new Map,no=n=>{let e=n&&n.env||{};const{fetch:t,Request:r,Response:s}=e,i=[r,s,t];let o=i.length,a=o,l,c,u=ru;for(;a--;)l=i[a],c=u.get(l),c===void 0&&u.set(l,c=a?new Map:nu(e)),u=c;return c};no();const Vr={http:Sc,xhr:Zc,fetch:{get:no}};y.forEach(Vr,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const ro=n=>`- ${n}`,su=n=>y.isFunction(n)||n===null||n===!1;function iu(n,e){n=y.isArray(n)?n:[n];const{length:t}=n;let r,s;const i={};for(let o=0;o<t;o++){r=n[o];let a;if(s=r,!su(r)&&(s=Vr[(a=String(r)).toLowerCase()],s===void 0))throw new L(`Unknown adapter '${a}'`);if(s&&(y.isFunction(s)||(s=s.get(e))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since :
4
4
  `+o.map(ro).join(`
5
5
  `):" "+ro(o[0]):"as no adapter specified";throw new L("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s}const so={getAdapter:iu,adapters:Vr};function Yr(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Yt(null,n)}function io(n){return Yr(n),n.headers=De.from(n.headers),n.data=Wr.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),so.getAdapter(n.adapter||an.adapter,n)(n).then(function(r){return Yr(n),r.data=Wr.call(n,n.transformResponse,r),r.headers=De.from(r.headers),r},function(r){return Hi(r)||(Yr(n),r&&r.response&&(r.response.data=Wr.call(n,n.transformResponse,r.response),r.response.headers=De.from(r.response.headers))),Promise.reject(r)})}const oo="1.13.2",$n={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{$n[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const ao={};$n.transitional=function(e,t,r){function s(i,o){return"[Axios v"+oo+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new L(s(o," has been removed"+(t?" in "+t:"")),L.ERR_DEPRECATED);return t&&!ao[o]&&(ao[o]=!0,console.warn(s(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,o,a):!0}},$n.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function ou(n,e,t){if(typeof n!="object")throw new L("options must be an object",L.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const a=n[i],l=a===void 0||o(a,i,n);if(l!==!0)throw new L("option "+i+" must be "+l,L.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new L("Unknown option "+i,L.ERR_BAD_OPTION)}}const Nn={assertOptions:ou,validators:$n},tt=Nn.validators;let Ot=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ui,response:new Ui}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Rt(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&Nn.assertOptions(r,{silentJSONParsing:tt.transitional(tt.boolean),forcedJSONParsing:tt.transitional(tt.boolean),clarifyTimeoutError:tt.transitional(tt.boolean)},!1),s!=null&&(y.isFunction(s)?t.paramsSerializer={serialize:s}:Nn.assertOptions(s,{encode:tt.function,serialize:tt.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Nn.assertOptions(t,{baseUrl:tt.spelling("baseURL"),withXsrfToken:tt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&y.merge(i.common,i[t.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=De.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,g;if(!l){const f=[io.bind(this),void 0];for(f.unshift(...a),f.push(...c),g=f.length,u=Promise.resolve(t);d<g;)u=u.then(f[d++],f[d++]);return u}g=a.length;let h=t;for(;d<g;){const f=a[d++],m=a[d++];try{h=f(h)}catch(b){m.call(this,b);break}}try{u=io.call(this,h)}catch(f){return Promise.reject(f)}for(d=0,g=c.length;d<g;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Rt(this.defaults,e);const t=Xi(e.baseURL,e.url,e.allowAbsoluteUrls);return ji(t,e.params,e.paramsSerializer)}};y.forEach(["delete","get","head","options"],function(e){Ot.prototype[e]=function(t,r){return this.request(Rt(r||{},{method:e,url:t,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,a){return this.request(Rt(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Ot.prototype[e]=t(),Ot.prototype[e+"Form"]=t(!0)});let au=class Rl{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new Yt(i,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Rl(function(s){e=s}),cancel:e}}};function lu(n){return function(t){return n.apply(null,t)}}function cu(n){return y.isObject(n)&&n.isAxiosError===!0}const Xr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xr).forEach(([n,e])=>{Xr[e]=n});function lo(n){const e=new Ot(n),t=Ti(Ot.prototype.request,e);return y.extend(t,Ot.prototype,e,{allOwnKeys:!0}),y.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return lo(Rt(n,s))},t}const pe=lo(an);pe.Axios=Ot,pe.CanceledError=Yt,pe.CancelToken=au,pe.isCancel=Hi,pe.VERSION=oo,pe.toFormData=On,pe.AxiosError=L,pe.Cancel=pe.CanceledError,pe.all=function(e){return Promise.all(e)},pe.spread=lu,pe.isAxiosError=cu,pe.mergeConfig=Rt,pe.AxiosHeaders=De,pe.formToJSON=n=>qi(y.isHTMLForm(n)?new FormData(n):n),pe.getAdapter=so.getAdapter,pe.HttpStatusCode=Xr,pe.default=pe;const{Axios:Np,AxiosError:Mp,CanceledError:Fp,isCancel:Lp,CancelToken:jp,VERSION:Up,all:zp,Cancel:qp,isAxiosError:Bp,spread:Hp,toFormData:Wp,AxiosHeaders:Vp,HttpStatusCode:Yp,formToJSON:Xp,getAdapter:Jp,mergeConfig:Zp}=pe,uu=(()=>{var t,r;if(typeof window>"u")return"https://api.robodialog.com";const n=document.currentScript;if((t=n==null?void 0:n.src)!=null&&t.includes("localhost")||(r=n==null?void 0:n.src)!=null&&r.includes("127.0.0.1"))return"http://localhost:4500";const e=document.getElementsByTagName("script");for(let s=0;s<e.length;s++){const i=e[s].src;if((i.includes("localhost")||i.includes("127.0.0.1"))&&(i.includes("robodialog")||i.includes("widget")))return"http://localhost:4500"}return"https://api.robodialog.com"})(),du="wss://realtime.robodialog.com/connection/websocket",co=`${uu}/api/v1`,Ie=pe.create({baseURL:co,headers:{"Content-Type":"application/json"}});function uo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hu(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}function Pt(n){this._maxSize=n,this.clear()}Pt.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Pt.prototype.get=function(n){return this._values[n]},Pt.prototype.set=function(n,e){return this._size>=this._maxSize&&this.clear(),n in this._values||this._size++,this._values[n]=e};var fu=/[^.^\]^[]+|(?=\[\]|\.\.)/g,ho=/^\d+$/,pu=/^\d/,gu=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,mu=/^\s*(['"]?)(.*?)(\1)\s*$/,Jr=512,fo=new Pt(Jr),po=new Pt(Jr),go=new Pt(Jr),Dt={Cache:Pt,split:Gr,normalizePath:Zr,setter:function(n){var e=Zr(n);return po.get(n)||po.set(n,function(r,s){for(var i=0,o=e.length,a=r;i<o-1;){var l=e[i];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[e[i++]]}a[e[i]]=s})},getter:function(n,e){var t=Zr(n);return go.get(n)||go.set(n,function(s){for(var i=0,o=t.length;i<o;)if(s!=null||!e)s=s[t[i++]];else return;return s})},join:function(n){return n.reduce(function(e,t){return e+(Kr(t)||ho.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(n,e,t){bu(Array.isArray(n)?n:Gr(n),e,t)}};function Zr(n){return fo.get(n)||fo.set(n,Gr(n).map(function(e){return e.replace(mu,"$2")}))}function Gr(n){return n.match(fu)||[""]}function bu(n,e,t){var r=n.length,s,i,o,a;for(i=0;i<r;i++)s=n[i],s&&(yu(s)&&(s='"'+s+'"'),a=Kr(s),o=!a&&/^\d+$/.test(s),e.call(t,s,a,o,i,n))}function Kr(n){return typeof n=="string"&&n&&["'",'"'].indexOf(n.charAt(0))!==-1}function _u(n){return n.match(pu)&&!n.match(ho)}function vu(n){return gu.test(n)}function yu(n){return!Kr(n)&&(_u(n)||vu(n))}const xu=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Mn=n=>n.match(xu)||[],Fn=n=>n[0].toUpperCase()+n.slice(1),Qr=(n,e)=>Mn(n).join(e).toLowerCase(),mo=n=>Mn(n).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");var es={words:Mn,upperFirst:Fn,camelCase:mo,pascalCase:n=>Fn(mo(n)),snakeCase:n=>Qr(n,"_"),kebabCase:n=>Qr(n,"-"),sentenceCase:n=>Fn(Qr(n," ")),titleCase:n=>Mn(n).map(Fn).join(" ")},ts={exports:{}};ts.exports=function(n){return bo(wu(n),n)},ts.exports.array=bo;function bo(n,e){var t=n.length,r=new Array(t),s={},i=t,o=ku(e),a=Tu(n);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)s[i]||l(n[i],i,new Set);return r;function l(c,u,d){if(d.has(c)){var g;try{g=", node was:"+JSON.stringify(c)}catch{g=""}throw new Error("Cyclic dependency"+g)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!s[u]){s[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){d.add(c);do{var f=h[--u];l(f,a.get(f),d)}while(u);d.delete(c)}r[--t]=c}}}function wu(n){for(var e=new Set,t=0,r=n.length;t<r;t++){var s=n[t];e.add(s[0]),e.add(s[1])}return Array.from(e)}function ku(n){for(var e=new Map,t=0,r=n.length;t<r;t++){var s=n[t];e.has(s[0])||e.set(s[0],new Set),e.has(s[1])||e.set(s[1],new Set),e.get(s[0]).add(s[1])}return e}function Tu(n){for(var e=new Map,t=0,r=n.length;t<r;t++)e.set(n[t],t);return e}var Su=ts.exports;const Cu=uo(Su),Eu=Object.prototype.toString,Au=Error.prototype.toString,Ru=RegExp.prototype.toString,Ou=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Pu=/^Symbol\((.*)\)(.*)$/;function Du(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function _o(n,e=!1){if(n==null||n===!0||n===!1)return""+n;const t=typeof n;if(t==="number")return Du(n);if(t==="string")return e?`"${n}"`:n;if(t==="function")return"[Function "+(n.name||"anonymous")+"]";if(t==="symbol")return Ou.call(n).replace(Pu,"Symbol($1)");const r=Eu.call(n).slice(8,-1);return r==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):r==="Error"||n instanceof Error?"["+Au.call(n)+"]":r==="RegExp"?Ru.call(n):null}function ht(n,e){let t=_o(n,e);return t!==null?t:JSON.stringify(n,function(r,s){let i=_o(this[r],e);return i!==null?i:s},2)}function vo(n){return n==null?[]:[].concat(n)}let yo,xo,wo,Iu=/\$\{\s*(\w+)\s*\}/g;yo=Symbol.toStringTag;class ko{constructor(e,t,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[yo]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=s,this.errors=[],this.inner=[],vo(e).forEach(i=>{if(ve.isError(i)){this.errors.push(...i.errors);const o=i.inner.length?i.inner:[i];this.inner.push(...o)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}xo=Symbol.hasInstance,wo=Symbol.toStringTag;class ve extends Error{static formatError(e,t){const r=t.label||t.path||"this";return t=Object.assign({},t,{path:r,originalPath:t.path}),typeof e=="string"?e.replace(Iu,(s,i)=>ht(t[i])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,r,s,i){const o=new ko(e,t,r,s);if(i)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[wo]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ve)}static[xo](e){return ko[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let nt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:e,value:t,originalValue:r})=>{const s=r!=null&&r!==t?` (cast from the value \`${ht(r,!0)}\`).`:".";return e!=="mixed"?`${n} must be a \`${e}\` type, but the final value was: \`${ht(t,!0)}\``+s:`${n} must match the configured type. The validated value was: \`${ht(t,!0)}\``+s}},$e={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},yt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ns={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},rs={isValue:"${path} field must be ${value}"},Ln={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},jn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:nt,string:$e,number:yt,date:ns,object:Ln,array:jn,boolean:rs,tuple:{notType:n=>{const{path:e,value:t,spec:r}=n,s=r.types.length;if(Array.isArray(t)){if(t.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${ht(t,!0)}\``;if(t.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${ht(t,!0)}\``}return ve.formatError(nt.notType,n)}}});const Un=n=>n&&n.__isYupSchema__;class zn{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:i}=t,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new zn(e,(a,l)=>{var c;let u=o(...a)?s:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(i=>i.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(r,e,t);if(s===void 0||s===e)return e;if(!Un(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const qn={context:"$",value:"."};class It{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===qn.context,this.isValue=this.key[0]===qn.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?qn.context:this.isValue?qn.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Dt.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let s=this.isContext?r:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}It.prototype.__isYupRef=!0;const Ye=n=>n==null;function Xt(n){function e({value:t,path:r="",options:s,originalValue:i,schema:o},a,l){const{name:c,test:u,params:d,message:g,skipAbsent:h}=n;let{parent:f,context:m,abortEarly:b=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=s;const x={value:t,parent:f,context:m};function w(E={}){const j=To(Object.assign({value:t,originalValue:i,label:o.spec.label,path:E.path||r,spec:o.spec,disableStackTrace:E.disableStackTrace||v},d,E.params),x),Z=new ve(ve.formatError(E.message||g,j),t,j.path,E.type||c,j.disableStackTrace);return Z.params=j,Z}const k=b?a:l;let _={path:r,parent:f,type:c,from:s.from,createError:w,resolve(E){return So(E,x)},options:s,originalValue:i,schema:o};const S=E=>{ve.isError(E)?k(E):E?l(null):k(w())},P=E=>{ve.isError(E)?k(E):a(E)};if(h&&Ye(t))return S(!0);let A;try{var D;if(A=u.call(_,t,_),typeof((D=A)==null?void 0:D.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(A).then(S,P)}}catch(E){P(E);return}S(A)}return e.OPTIONS=n,e}function To(n,e){if(!n)return n;for(const t of Object.keys(n))n[t]=So(n[t],e);return n}function So(n,e){return It.isRef(n)?n.getValue(e.value,e.parent,e.context):n}function $u(n,e,t,r=t){let s,i,o;return e?(Dt.forEach(e,(a,l,c)=>{let u=l?a.slice(1,a.length-1):a;n=n.resolve({context:r,parent:s,value:t});let d=n.type==="tuple",g=c?parseInt(u,10):0;if(n.innerType||d){if(d&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&g>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);s=t,t=t&&t[g],n=d?n.spec.types[g]:n.innerType}if(!c){if(!n.fields||!n.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${n.type}")`);s=t,t=t&&t[u],n=n.fields[u]}i=u,o=l?"["+a+"]":"."+a}),{schema:n,parent:s,parentPath:i}):{parent:s,parentPath:e,schema:n}}class Bn extends Set{describe(){const e=[];for(const t of this.values())e.push(It.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new Bn(this.values())}merge(e,t){const r=this.clone();return e.forEach(s=>r.add(s)),t.forEach(s=>r.delete(s)),r}}function Jt(n,e=new Map){if(Un(n)||!n||typeof n!="object")return n;if(e.has(n))return e.get(n);let t;if(n instanceof Date)t=new Date(n.getTime()),e.set(n,t);else if(n instanceof RegExp)t=new RegExp(n),e.set(n,t);else if(Array.isArray(n)){t=new Array(n.length),e.set(n,t);for(let r=0;r<n.length;r++)t[r]=Jt(n[r],e)}else if(n instanceof Map){t=new Map,e.set(n,t);for(const[r,s]of n.entries())t.set(r,Jt(s,e))}else if(n instanceof Set){t=new Set,e.set(n,t);for(const r of n)t.add(Jt(r,e))}else if(n instanceof Object){t={},e.set(n,t);for(const[r,s]of Object.entries(n))t[r]=Jt(s,e)}else throw Error(`Unable to clone ${n}`);return t}function Nu(n){if(!(n!=null&&n.length))return;const e=[];let t="",r=!1,s=!1;for(let i=0;i<n.length;i++){const o=n[i];if(o==="["&&!s){t&&(e.push(...t.split(".").filter(Boolean)),t=""),r=!0;continue}if(o==="]"&&!s){t&&(/^\d+$/.test(t)?e.push(t):e.push(t.replace(/^"|"$/g,"")),t=""),r=!1;continue}if(o==='"'){s=!s;continue}if(o==="."&&!r&&!s){t&&(e.push(t),t="");continue}t+=o}return t&&e.push(...t.split(".").filter(Boolean)),e}function Mu(n,e){const t=e?`${e}.${n.path}`:n.path;return n.errors.map(r=>({message:r,path:Nu(t)}))}function Co(n,e){var t;if(!((t=n.inner)!=null&&t.length)&&n.errors.length)return Mu(n,e);const r=e?`${e}.${n.path}`:n.path;return n.inner.flatMap(s=>Co(s,r))}class Le{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Bn,this._blacklist=new Bn,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(nt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Jt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const s=Object.assign({},t.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(i=>{e.tests.forEach(o=>{i.test(o.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((s,i)=>i.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,s,i;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({},t,{value:e})),s=t.assert==="ignore-optionality",i=r._cast(e,t);if(t.assert!==!1&&!r.isType(i)){if(s&&Ye(i))return i;let o=ht(e),a=ht(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
6
+ `+i):r.stack=i}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Rt(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:i}=t;r!==void 0&&Nn.assertOptions(r,{silentJSONParsing:tt.transitional(tt.boolean),forcedJSONParsing:tt.transitional(tt.boolean),clarifyTimeoutError:tt.transitional(tt.boolean)},!1),s!=null&&(y.isFunction(s)?t.paramsSerializer={serialize:s}:Nn.assertOptions(s,{encode:tt.function,serialize:tt.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Nn.assertOptions(t,{baseUrl:tt.spelling("baseURL"),withXsrfToken:tt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=i&&y.merge(i.common,i[t.method]);i&&y.forEach(["delete","get","head","post","put","patch","common"],f=>{delete i[f]}),t.headers=De.concat(o,i);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,g;if(!l){const f=[io.bind(this),void 0];for(f.unshift(...a),f.push(...c),g=f.length,u=Promise.resolve(t);d<g;)u=u.then(f[d++],f[d++]);return u}g=a.length;let h=t;for(;d<g;){const f=a[d++],m=a[d++];try{h=f(h)}catch(b){m.call(this,b);break}}try{u=io.call(this,h)}catch(f){return Promise.reject(f)}for(d=0,g=c.length;d<g;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=Rt(this.defaults,e);const t=Xi(e.baseURL,e.url,e.allowAbsoluteUrls);return ji(t,e.params,e.paramsSerializer)}};y.forEach(["delete","get","head","options"],function(e){Ot.prototype[e]=function(t,r){return this.request(Rt(r||{},{method:e,url:t,data:(r||{}).data}))}}),y.forEach(["post","put","patch"],function(e){function t(r){return function(i,o,a){return this.request(Rt(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Ot.prototype[e]=t(),Ot.prototype[e+"Form"]=t(!0)});let au=class Rl{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(i){t=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new Yt(i,o,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Rl(function(s){e=s}),cancel:e}}};function lu(n){return function(t){return n.apply(null,t)}}function cu(n){return y.isObject(n)&&n.isAxiosError===!0}const Xr={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Xr).forEach(([n,e])=>{Xr[e]=n});function lo(n){const e=new Ot(n),t=Ti(Ot.prototype.request,e);return y.extend(t,Ot.prototype,e,{allOwnKeys:!0}),y.extend(t,e,null,{allOwnKeys:!0}),t.create=function(s){return lo(Rt(n,s))},t}const pe=lo(an);pe.Axios=Ot,pe.CanceledError=Yt,pe.CancelToken=au,pe.isCancel=Hi,pe.VERSION=oo,pe.toFormData=On,pe.AxiosError=L,pe.Cancel=pe.CanceledError,pe.all=function(e){return Promise.all(e)},pe.spread=lu,pe.isAxiosError=cu,pe.mergeConfig=Rt,pe.AxiosHeaders=De,pe.formToJSON=n=>qi(y.isHTMLForm(n)?new FormData(n):n),pe.getAdapter=so.getAdapter,pe.HttpStatusCode=Xr,pe.default=pe;const{Axios:Np,AxiosError:Mp,CanceledError:Fp,isCancel:Lp,CancelToken:jp,VERSION:Up,all:zp,Cancel:qp,isAxiosError:Bp,spread:Hp,toFormData:Wp,AxiosHeaders:Vp,HttpStatusCode:Yp,formToJSON:Xp,getAdapter:Jp,mergeConfig:Zp}=pe,uu="https://api.robodialog.com",du="wss://realtime.robodialog.com/connection/websocket",co=uu+"/api/v1",Ie=pe.create({baseURL:co,headers:{"Content-Type":"application/json"}});function uo(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function hu(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var s=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:function(){return n[r]}})}),t}function Pt(n){this._maxSize=n,this.clear()}Pt.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Pt.prototype.get=function(n){return this._values[n]},Pt.prototype.set=function(n,e){return this._size>=this._maxSize&&this.clear(),n in this._values||this._size++,this._values[n]=e};var fu=/[^.^\]^[]+|(?=\[\]|\.\.)/g,ho=/^\d+$/,pu=/^\d/,gu=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,mu=/^\s*(['"]?)(.*?)(\1)\s*$/,Jr=512,fo=new Pt(Jr),po=new Pt(Jr),go=new Pt(Jr),Dt={Cache:Pt,split:Gr,normalizePath:Zr,setter:function(n){var e=Zr(n);return po.get(n)||po.set(n,function(r,s){for(var i=0,o=e.length,a=r;i<o-1;){var l=e[i];if(l==="__proto__"||l==="constructor"||l==="prototype")return r;a=a[e[i++]]}a[e[i]]=s})},getter:function(n,e){var t=Zr(n);return go.get(n)||go.set(n,function(s){for(var i=0,o=t.length;i<o;)if(s!=null||!e)s=s[t[i++]];else return;return s})},join:function(n){return n.reduce(function(e,t){return e+(Kr(t)||ho.test(t)?"["+t+"]":(e?".":"")+t)},"")},forEach:function(n,e,t){bu(Array.isArray(n)?n:Gr(n),e,t)}};function Zr(n){return fo.get(n)||fo.set(n,Gr(n).map(function(e){return e.replace(mu,"$2")}))}function Gr(n){return n.match(fu)||[""]}function bu(n,e,t){var r=n.length,s,i,o,a;for(i=0;i<r;i++)s=n[i],s&&(yu(s)&&(s='"'+s+'"'),a=Kr(s),o=!a&&/^\d+$/.test(s),e.call(t,s,a,o,i,n))}function Kr(n){return typeof n=="string"&&n&&["'",'"'].indexOf(n.charAt(0))!==-1}function _u(n){return n.match(pu)&&!n.match(ho)}function vu(n){return gu.test(n)}function yu(n){return!Kr(n)&&(_u(n)||vu(n))}const xu=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,Mn=n=>n.match(xu)||[],Fn=n=>n[0].toUpperCase()+n.slice(1),Qr=(n,e)=>Mn(n).join(e).toLowerCase(),mo=n=>Mn(n).reduce((e,t)=>`${e}${e?t[0].toUpperCase()+t.slice(1).toLowerCase():t.toLowerCase()}`,"");var es={words:Mn,upperFirst:Fn,camelCase:mo,pascalCase:n=>Fn(mo(n)),snakeCase:n=>Qr(n,"_"),kebabCase:n=>Qr(n,"-"),sentenceCase:n=>Fn(Qr(n," ")),titleCase:n=>Mn(n).map(Fn).join(" ")},ts={exports:{}};ts.exports=function(n){return bo(wu(n),n)},ts.exports.array=bo;function bo(n,e){var t=n.length,r=new Array(t),s={},i=t,o=ku(e),a=Tu(n);for(e.forEach(function(c){if(!a.has(c[0])||!a.has(c[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)s[i]||l(n[i],i,new Set);return r;function l(c,u,d){if(d.has(c)){var g;try{g=", node was:"+JSON.stringify(c)}catch{g=""}throw new Error("Cyclic dependency"+g)}if(!a.has(c))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(c));if(!s[u]){s[u]=!0;var h=o.get(c)||new Set;if(h=Array.from(h),u=h.length){d.add(c);do{var f=h[--u];l(f,a.get(f),d)}while(u);d.delete(c)}r[--t]=c}}}function wu(n){for(var e=new Set,t=0,r=n.length;t<r;t++){var s=n[t];e.add(s[0]),e.add(s[1])}return Array.from(e)}function ku(n){for(var e=new Map,t=0,r=n.length;t<r;t++){var s=n[t];e.has(s[0])||e.set(s[0],new Set),e.has(s[1])||e.set(s[1],new Set),e.get(s[0]).add(s[1])}return e}function Tu(n){for(var e=new Map,t=0,r=n.length;t<r;t++)e.set(n[t],t);return e}var Su=ts.exports;const Cu=uo(Su),Eu=Object.prototype.toString,Au=Error.prototype.toString,Ru=RegExp.prototype.toString,Ou=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Pu=/^Symbol\((.*)\)(.*)$/;function Du(n){return n!=+n?"NaN":n===0&&1/n<0?"-0":""+n}function _o(n,e=!1){if(n==null||n===!0||n===!1)return""+n;const t=typeof n;if(t==="number")return Du(n);if(t==="string")return e?`"${n}"`:n;if(t==="function")return"[Function "+(n.name||"anonymous")+"]";if(t==="symbol")return Ou.call(n).replace(Pu,"Symbol($1)");const r=Eu.call(n).slice(8,-1);return r==="Date"?isNaN(n.getTime())?""+n:n.toISOString(n):r==="Error"||n instanceof Error?"["+Au.call(n)+"]":r==="RegExp"?Ru.call(n):null}function ht(n,e){let t=_o(n,e);return t!==null?t:JSON.stringify(n,function(r,s){let i=_o(this[r],e);return i!==null?i:s},2)}function vo(n){return n==null?[]:[].concat(n)}let yo,xo,wo,Iu=/\$\{\s*(\w+)\s*\}/g;yo=Symbol.toStringTag;class ko{constructor(e,t,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[yo]="Error",this.name="ValidationError",this.value=t,this.path=r,this.type=s,this.errors=[],this.inner=[],vo(e).forEach(i=>{if(ve.isError(i)){this.errors.push(...i.errors);const o=i.inner.length?i.inner:[i];this.inner.push(...o)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}xo=Symbol.hasInstance,wo=Symbol.toStringTag;class ve extends Error{static formatError(e,t){const r=t.label||t.path||"this";return t=Object.assign({},t,{path:r,originalPath:t.path}),typeof e=="string"?e.replace(Iu,(s,i)=>ht(t[i])):typeof e=="function"?e(t):e}static isError(e){return e&&e.name==="ValidationError"}constructor(e,t,r,s,i){const o=new ko(e,t,r,s);if(i)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[wo]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ve)}static[xo](e){return ko[Symbol.hasInstance](e)||super[Symbol.hasInstance](e)}}let nt={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:n,type:e,value:t,originalValue:r})=>{const s=r!=null&&r!==t?` (cast from the value \`${ht(r,!0)}\`).`:".";return e!=="mixed"?`${n} must be a \`${e}\` type, but the final value was: \`${ht(t,!0)}\``+s:`${n} must match the configured type. The validated value was: \`${ht(t,!0)}\``+s}},$e={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},yt={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},ns={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},rs={isValue:"${path} field must be ${value}"},Ln={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"},jn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"};Object.assign(Object.create(null),{mixed:nt,string:$e,number:yt,date:ns,object:Ln,array:jn,boolean:rs,tuple:{notType:n=>{const{path:e,value:t,spec:r}=n,s=r.types.length;if(Array.isArray(t)){if(t.length<s)return`${e} tuple value has too few items, expected a length of ${s} but got ${t.length} for value: \`${ht(t,!0)}\``;if(t.length>s)return`${e} tuple value has too many items, expected a length of ${s} but got ${t.length} for value: \`${ht(t,!0)}\``}return ve.formatError(nt.notType,n)}}});const Un=n=>n&&n.__isYupSchema__;class zn{static fromOptions(e,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:i}=t,o=typeof r=="function"?r:(...a)=>a.every(l=>l===r);return new zn(e,(a,l)=>{var c;let u=o(...a)?s:i;return(c=u==null?void 0:u(l))!=null?c:l})}constructor(e,t){this.fn=void 0,this.refs=e,this.refs=e,this.fn=t}resolve(e,t){let r=this.refs.map(i=>i.getValue(t==null?void 0:t.value,t==null?void 0:t.parent,t==null?void 0:t.context)),s=this.fn(r,e,t);if(s===void 0||s===e)return e;if(!Un(s))throw new TypeError("conditions must return a schema object");return s.resolve(t)}}const qn={context:"$",value:"."};class It{constructor(e,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof e!="string")throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),e==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===qn.context,this.isValue=this.key[0]===qn.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?qn.context:this.isValue?qn.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Dt.getter(this.path,!0),this.map=t.map}getValue(e,t,r){let s=this.isContext?r:this.isValue?e:t;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(e,t){return this.getValue(e,t==null?void 0:t.parent,t==null?void 0:t.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(e){return e&&e.__isYupRef}}It.prototype.__isYupRef=!0;const Ye=n=>n==null;function Xt(n){function e({value:t,path:r="",options:s,originalValue:i,schema:o},a,l){const{name:c,test:u,params:d,message:g,skipAbsent:h}=n;let{parent:f,context:m,abortEarly:b=o.spec.abortEarly,disableStackTrace:v=o.spec.disableStackTrace}=s;const x={value:t,parent:f,context:m};function w(E={}){const j=To(Object.assign({value:t,originalValue:i,label:o.spec.label,path:E.path||r,spec:o.spec,disableStackTrace:E.disableStackTrace||v},d,E.params),x),Z=new ve(ve.formatError(E.message||g,j),t,j.path,E.type||c,j.disableStackTrace);return Z.params=j,Z}const k=b?a:l;let _={path:r,parent:f,type:c,from:s.from,createError:w,resolve(E){return So(E,x)},options:s,originalValue:i,schema:o};const S=E=>{ve.isError(E)?k(E):E?l(null):k(w())},P=E=>{ve.isError(E)?k(E):a(E)};if(h&&Ye(t))return S(!0);let A;try{var D;if(A=u.call(_,t,_),typeof((D=A)==null?void 0:D.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${_.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(A).then(S,P)}}catch(E){P(E);return}S(A)}return e.OPTIONS=n,e}function To(n,e){if(!n)return n;for(const t of Object.keys(n))n[t]=So(n[t],e);return n}function So(n,e){return It.isRef(n)?n.getValue(e.value,e.parent,e.context):n}function $u(n,e,t,r=t){let s,i,o;return e?(Dt.forEach(e,(a,l,c)=>{let u=l?a.slice(1,a.length-1):a;n=n.resolve({context:r,parent:s,value:t});let d=n.type==="tuple",g=c?parseInt(u,10):0;if(n.innerType||d){if(d&&!c)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(t&&g>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${e}. because there is no value at that index. `);s=t,t=t&&t[g],n=d?n.spec.types[g]:n.innerType}if(!c){if(!n.fields||!n.fields[u])throw new Error(`The schema does not contain the path: ${e}. (failed at: ${o} which is a type: "${n.type}")`);s=t,t=t&&t[u],n=n.fields[u]}i=u,o=l?"["+a+"]":"."+a}),{schema:n,parent:s,parentPath:i}):{parent:s,parentPath:e,schema:n}}class Bn extends Set{describe(){const e=[];for(const t of this.values())e.push(It.isRef(t)?t.describe():t);return e}resolveAll(e){let t=[];for(const r of this.values())t.push(e(r));return t}clone(){return new Bn(this.values())}merge(e,t){const r=this.clone();return e.forEach(s=>r.add(s)),t.forEach(s=>r.delete(s)),r}}function Jt(n,e=new Map){if(Un(n)||!n||typeof n!="object")return n;if(e.has(n))return e.get(n);let t;if(n instanceof Date)t=new Date(n.getTime()),e.set(n,t);else if(n instanceof RegExp)t=new RegExp(n),e.set(n,t);else if(Array.isArray(n)){t=new Array(n.length),e.set(n,t);for(let r=0;r<n.length;r++)t[r]=Jt(n[r],e)}else if(n instanceof Map){t=new Map,e.set(n,t);for(const[r,s]of n.entries())t.set(r,Jt(s,e))}else if(n instanceof Set){t=new Set,e.set(n,t);for(const r of n)t.add(Jt(r,e))}else if(n instanceof Object){t={},e.set(n,t);for(const[r,s]of Object.entries(n))t[r]=Jt(s,e)}else throw Error(`Unable to clone ${n}`);return t}function Nu(n){if(!(n!=null&&n.length))return;const e=[];let t="",r=!1,s=!1;for(let i=0;i<n.length;i++){const o=n[i];if(o==="["&&!s){t&&(e.push(...t.split(".").filter(Boolean)),t=""),r=!0;continue}if(o==="]"&&!s){t&&(/^\d+$/.test(t)?e.push(t):e.push(t.replace(/^"|"$/g,"")),t=""),r=!1;continue}if(o==='"'){s=!s;continue}if(o==="."&&!r&&!s){t&&(e.push(t),t="");continue}t+=o}return t&&e.push(...t.split(".").filter(Boolean)),e}function Mu(n,e){const t=e?`${e}.${n.path}`:n.path;return n.errors.map(r=>({message:r,path:Nu(t)}))}function Co(n,e){var t;if(!((t=n.inner)!=null&&t.length)&&n.errors.length)return Mu(n,e);const r=e?`${e}.${n.path}`:n.path;return n.inner.flatMap(s=>Co(s,r))}class Le{constructor(e){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Bn,this._blacklist=new Bn,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(nt.notType)}),this.type=e.type,this._typeCheck=e.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},e==null?void 0:e.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(e){if(this._mutate)return e&&Object.assign(this.spec,e),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=Jt(Object.assign({},this.spec,e)),t}label(e){let t=this.clone();return t.spec.label=e,t}meta(...e){if(e.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},e[0]),t}withMutation(e){let t=this._mutate;this._mutate=!0;let r=e(this);return this._mutate=t,r}concat(e){if(!e||e===this)return this;if(e.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${e.type}`);let t=this,r=e.clone();const s=Object.assign({},t.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},t.internalTests,r.internalTests),r._whitelist=t._whitelist.merge(e._whitelist,e._blacklist),r._blacklist=t._blacklist.merge(e._blacklist,e._whitelist),r.tests=t.tests,r.exclusiveTests=t.exclusiveTests,r.withMutation(i=>{e.tests.forEach(o=>{i.test(o.OPTIONS)})}),r.transforms=[...t.transforms,...r.transforms],r}isType(e){return e==null?!!(this.spec.nullable&&e===null||this.spec.optional&&e===void 0):this._typeCheck(e)}resolve(e){let t=this;if(t.conditions.length){let r=t.conditions;t=t.clone(),t.conditions=[],t=r.reduce((s,i)=>i.resolve(s,e),t),t=t.resolve(e)}return t}resolveOptions(e){var t,r,s,i;return Object.assign({},e,{from:e.from||[],strict:(t=e.strict)!=null?t:this.spec.strict,abortEarly:(r=e.abortEarly)!=null?r:this.spec.abortEarly,recursive:(s=e.recursive)!=null?s:this.spec.recursive,disableStackTrace:(i=e.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(e,t={}){let r=this.resolve(Object.assign({},t,{value:e})),s=t.assert==="ignore-optionality",i=r._cast(e,t);if(t.assert!==!1&&!r.isType(i)){if(s&&Ye(i))return i;let o=ht(e),a=ht(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
7
7
 
8
8
  attempted value: ${o}
9
9
  `+(a!==o?`result of cast: ${a}`:""))}return i}_cast(e,t){let r=e===void 0?e:this.transforms.reduce((s,i)=>i.call(this,s,e,this,t),e);return r===void 0&&(r=this.getDefault(t)),r}_validate(e,t={},r,s){let{path:i,originalValue:o=e,strict:a=this.spec.strict}=t,l=e;a||(l=this._cast(l,Object.assign({assert:!1},t)));let c=[];for(let u of Object.values(this.internalTests))u&&c.push(u);this.runTests({path:i,value:l,originalValue:o,options:t,tests:c},r,u=>{if(u.length)return s(u,l);this.runTests({path:i,value:l,originalValue:o,options:t,tests:this.tests},r,s)})}runTests(e,t,r){let s=!1,{tests:i,value:o,originalValue:a,path:l,options:c}=e,u=m=>{s||(s=!0,t(m,o))},d=m=>{s||(s=!0,r(m,o))},g=i.length,h=[];if(!g)return d([]);let f={value:o,originalValue:a,path:l,options:c,schema:this};for(let m=0;m<i.length;m++){const b=i[m];b(f,u,function(x){x&&(Array.isArray(x)?h.push(...x):h.push(x)),--g<=0&&d(h)})}}asNestedTest({key:e,index:t,parent:r,parentPath:s,originalParent:i,options:o}){const a=e??t;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const l=typeof a=="number";let c=r[a];const u=Object.assign({},o,{strict:!0,parent:r,value:c,originalValue:i[a],key:void 0,[l?"index":"key"]:a,path:l||a.includes(".")?`${s||""}[${l?a:`"${a}"`}]`:(s?`${s}.`:"")+e});return(d,g,h)=>this.resolve(u)._validate(c,u,g,h)}validate(e,t){var r;let s=this.resolve(Object.assign({},t,{value:e})),i=(r=t==null?void 0:t.disableStackTrace)!=null?r:s.spec.disableStackTrace;return new Promise((o,a)=>s._validate(e,t,(l,c)=>{ve.isError(l)&&(l.value=c),a(l)},(l,c)=>{l.length?a(new ve(l,c,void 0,void 0,i)):o(c)}))}validateSync(e,t){var r;let s=this.resolve(Object.assign({},t,{value:e})),i,o=(r=t==null?void 0:t.disableStackTrace)!=null?r:s.spec.disableStackTrace;return s._validate(e,Object.assign({},t,{sync:!0}),(a,l)=>{throw ve.isError(a)&&(a.value=l),a},(a,l)=>{if(a.length)throw new ve(a,e,void 0,void 0,o);i=l}),i}isValid(e,t){return this.validate(e,t).then(()=>!0,r=>{if(ve.isError(r))return!1;throw r})}isValidSync(e,t){try{return this.validateSync(e,t),!0}catch(r){if(ve.isError(r))return!1;throw r}}_getDefault(e){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,e):Jt(t)}getDefault(e){return this.resolve(e||{})._getDefault(e)}default(e){return arguments.length===0?this._getDefault():this.clone({default:e})}strict(e=!0){return this.clone({strict:e})}nullability(e,t){const r=this.clone({nullable:e});return r.internalTests.nullable=Xt({message:t,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),r}optionality(e,t){const r=this.clone({optional:e});return r.internalTests.optionality=Xt({message:t,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(e=nt.defined){return this.optionality(!1,e)}nullable(){return this.nullability(!0)}nonNullable(e=nt.notNull){return this.nullability(!1,e)}required(e=nt.required){return this.clone().withMutation(t=>t.nonNullable(e).defined(e))}notRequired(){return this.clone().withMutation(e=>e.nullable().optional())}transform(e){let t=this.clone();return t.transforms.push(e),t}test(...e){let t;if(e.length===1?typeof e[0]=="function"?t={test:e[0]}:t=e[0]:e.length===2?t={name:e[0],test:e[1]}:t={name:e[0],message:e[1],test:e[2]},t.message===void 0&&(t.message=nt.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),s=Xt(t),i=t.exclusive||t.name&&r.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(r.exclusiveTests[t.name]=!!t.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===t.name&&(i||o.OPTIONS.test===s.OPTIONS.test))),r.tests.push(s),r}when(e,t){!Array.isArray(e)&&typeof e!="string"&&(t=e,e=".");let r=this.clone(),s=vo(e).map(i=>new It(i));return s.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof t=="function"?new zn(s,t):zn.fromOptions(s,t)),r}typeError(e){let t=this.clone();return t.internalTests.typeError=Xt({message:e,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(e,t=nt.oneOf){let r=this.clone();return e.forEach(s=>{r._whitelist.add(s),r._blacklist.delete(s)}),r.internalTests.whiteList=Xt({message:t,name:"oneOf",skipAbsent:!0,test(s){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(s)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),r}notOneOf(e,t=nt.notOneOf){let r=this.clone();return e.forEach(s=>{r._blacklist.add(s),r._whitelist.delete(s)}),r.internalTests.blacklist=Xt({message:t,name:"notOneOf",test(s){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(s)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),r}strip(e=!0){let t=this.clone();return t.spec.strip=e,t}describe(e){const t=(e?this.resolve(e):this).clone(),{label:r,meta:s,optional:i,nullable:o}=t.spec;return{meta:s,label:r,optional:i,nullable:o,default:t.getDefault(e),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((l,c,u)=>u.findIndex(d=>d.OPTIONS.name===l.OPTIONS.name)===c).map(l=>{const c=l.OPTIONS.params&&e?To(Object.assign({},l.OPTIONS.params),e):l.OPTIONS.params;return{name:l.OPTIONS.name,params:c}})}}get"~standard"(){const e=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await e.validate(r,{abortEarly:!1})}}catch(s){if(s instanceof ve)return{issues:Co(s)};throw s}}}}}Le.prototype.__isYupSchema__=!0;for(const n of["validate","validateSync"])Le.prototype[`${n}At`]=function(e,t,r={}){const{parent:s,parentPath:i,schema:o}=$u(this,e,t,r.context);return o[n](s&&s[i],Object.assign({},r,{parent:s,path:e}))};for(const n of["equals","is"])Le.prototype[n]=Le.prototype.oneOf;for(const n of["not","nope"])Le.prototype[n]=Le.prototype.notOneOf;function ss(){return new Eo}class Eo extends Le{constructor(){super({type:"boolean",check(e){return e instanceof Boolean&&(e=e.valueOf()),typeof e=="boolean"}}),this.withMutation(()=>{this.transform((e,t)=>{if(this.spec.coerce&&!this.isType(e)){if(/^(true|1)$/i.test(String(e)))return!0;if(/^(false|0)$/i.test(String(e)))return!1}return e})})}isTrue(e=rs.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"true"},test(t){return Ye(t)||t===!0}})}isFalse(e=rs.isValue){return this.test({message:e,name:"is-value",exclusive:!0,params:{value:"false"},test(t){return Ye(t)||t===!1}})}default(e){return super.default(e)}defined(e){return super.defined(e)}optional(){return super.optional()}required(e){return super.required(e)}notRequired(){return super.notRequired()}nullable(){return super.nullable()}nonNullable(e){return super.nonNullable(e)}strip(e){return super.strip(e)}}ss.prototype=Eo.prototype;const Fu=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Lu(n){const e=is(n);if(!e)return Date.parse?Date.parse(n):Number.NaN;if(e.z===void 0&&e.plusMinus===void 0)return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond).valueOf();let t=0;return e.z!=="Z"&&e.plusMinus!==void 0&&(t=e.hourOffset*60+e.minuteOffset,e.plusMinus==="+"&&(t=0-t)),Date.UTC(e.year,e.month,e.day,e.hour,e.minute+t,e.second,e.millisecond)}function is(n){var e,t;const r=Fu.exec(n);return r?{year:ft(r[1]),month:ft(r[2],1)-1,day:ft(r[3],1),hour:ft(r[4]),minute:ft(r[5]),second:ft(r[6]),millisecond:r[7]?ft(r[7].substring(0,3)):0,precision:(e=(t=r[7])==null?void 0:t.length)!=null?e:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:ft(r[10]),minuteOffset:ft(r[11])}:null}function ft(n,e=0){return Number(n)||e}let ju=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Uu=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,zu=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,qu="^\\d{4}-\\d{2}-\\d{2}",Bu="\\d{2}:\\d{2}:\\d{2}",Hu="(([+-]\\d{2}(:?\\d{2})?)|Z)",Wu=new RegExp(`${qu}T${Bu}(\\.\\d+)?${Hu}$`),Vu=n=>Ye(n)||n===n.trim(),Yu={}.toString();function Y(){return new Ao}class Ao extends Le{constructor(){super({type:"string",check(e){return e instanceof String&&(e=e.valueOf()),typeof e=="string"}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce||this.isType(e)||Array.isArray(e))return e;const r=e!=null&&e.toString?e.toString():e;return r===Yu?e:r})})}required(e){return super.required(e).withMutation(t=>t.test({message:e||nt.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(e=>(e.tests=e.tests.filter(t=>t.OPTIONS.name!=="required"),e))}length(e,t=$e.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,t=$e.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,t=$e.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}matches(e,t){let r=!1,s,i;return t&&(typeof t=="object"?{excludeEmptyString:r=!1,message:s,name:i}=t:s=t),this.test({name:i||"matches",message:s||$e.matches,params:{regex:e},skipAbsent:!0,test:o=>o===""&&r||o.search(e)!==-1})}email(e=$e.email){return this.matches(ju,{name:"email",message:e,excludeEmptyString:!0})}url(e=$e.url){return this.matches(Uu,{name:"url",message:e,excludeEmptyString:!0})}uuid(e=$e.uuid){return this.matches(zu,{name:"uuid",message:e,excludeEmptyString:!1})}datetime(e){let t="",r,s;return e&&(typeof e=="object"?{message:t="",allowOffset:r=!1,precision:s=void 0}=e:t=e),this.matches(Wu,{name:"datetime",message:t||$e.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||$e.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const o=is(i);return o?!!o.z:!1}}).test({name:"datetime_precision",message:t||$e.datetime_precision,params:{precision:s},skipAbsent:!0,test:i=>{if(!i||s==null)return!0;const o=is(i);return o?o.precision===s:!1}})}ensure(){return this.default("").transform(e=>e===null?"":e)}trim(e=$e.trim){return this.transform(t=>t!=null?t.trim():t).test({message:e,name:"trim",test:Vu})}lowercase(e=$e.lowercase){return this.transform(t=>Ye(t)?t:t.toLowerCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ye(t)||t===t.toLowerCase()})}uppercase(e=$e.uppercase){return this.transform(t=>Ye(t)?t:t.toUpperCase()).test({message:e,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>Ye(t)||t===t.toUpperCase()})}}Y.prototype=Ao.prototype;let Xu=n=>n!=+n;function cn(){return new Ro}class Ro extends Le{constructor(){super({type:"number",check(e){return e instanceof Number&&(e=e.valueOf()),typeof e=="number"&&!Xu(e)}}),this.withMutation(()=>{this.transform((e,t)=>{if(!this.spec.coerce)return e;let r=e;if(typeof r=="string"){if(r=r.replace(/\s/g,""),r==="")return NaN;r=+r}return this.isType(r)||r===null?r:parseFloat(r)})})}min(e,t=yt.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r>=this.resolve(e)}})}max(e,t=yt.max){return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(r){return r<=this.resolve(e)}})}lessThan(e,t=yt.lessThan){return this.test({message:t,name:"max",exclusive:!0,params:{less:e},skipAbsent:!0,test(r){return r<this.resolve(e)}})}moreThan(e,t=yt.moreThan){return this.test({message:t,name:"min",exclusive:!0,params:{more:e},skipAbsent:!0,test(r){return r>this.resolve(e)}})}positive(e=yt.positive){return this.moreThan(0,e)}negative(e=yt.negative){return this.lessThan(0,e)}integer(e=yt.integer){return this.test({name:"integer",message:e,skipAbsent:!0,test:t=>Number.isInteger(t)})}truncate(){return this.transform(e=>Ye(e)?e:e|0)}round(e){var t;let r=["ceil","floor","round","trunc"];if(e=((t=e)==null?void 0:t.toLowerCase())||"round",e==="trunc")return this.truncate();if(r.indexOf(e.toLowerCase())===-1)throw new TypeError("Only valid options for round() are: "+r.join(", "));return this.transform(s=>Ye(s)?s:Math[e](s))}}cn.prototype=Ro.prototype;let Ju=new Date(""),Zu=n=>Object.prototype.toString.call(n)==="[object Date]";class os extends Le{constructor(){super({type:"date",check(e){return Zu(e)&&!isNaN(e.getTime())}}),this.withMutation(()=>{this.transform((e,t)=>!this.spec.coerce||this.isType(e)||e===null?e:(e=Lu(e),isNaN(e)?os.INVALID_DATE:new Date(e)))})}prepareParam(e,t){let r;if(It.isRef(e))r=e;else{let s=this.cast(e);if(!this._typeCheck(s))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);r=s}return r}min(e,t=ns.min){let r=this.prepareParam(e,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(s){return s>=this.resolve(r)}})}max(e,t=ns.max){let r=this.prepareParam(e,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(s){return s<=this.resolve(r)}})}}os.INVALID_DATE=Ju;function Gu(n,e=[]){let t=[],r=new Set,s=new Set(e.map(([o,a])=>`${o}-${a}`));function i(o,a){let l=Dt.split(o)[0];r.add(l),s.has(`${a}-${l}`)||t.push([a,l])}for(const o of Object.keys(n)){let a=n[o];r.add(o),It.isRef(a)&&a.isSibling?i(a.path,o):Un(a)&&"deps"in a&&a.deps.forEach(l=>i(l,o))}return Cu.array(Array.from(r),t).reverse()}function Oo(n,e){let t=1/0;return n.some((r,s)=>{var i;if((i=e.path)!=null&&i.includes(r))return t=s,!0}),t}function Po(n){return(e,t)=>Oo(n,e)-Oo(n,t)}const Do=(n,e,t)=>{if(typeof n!="string")return n;let r=n;try{r=JSON.parse(n)}catch{}return t.isType(r)?r:n};function Hn(n){if("fields"in n){const e={};for(const[t,r]of Object.entries(n.fields))e[t]=Hn(r);return n.setFields(e)}if(n.type==="array"){const e=n.optional();return e.innerType&&(e.innerType=Hn(e.innerType)),e}return n.type==="tuple"?n.optional().clone({types:n.spec.types.map(Hn)}):"optional"in n?n.optional():n}const Ku=(n,e)=>{const t=[...Dt.normalizePath(e)];if(t.length===1)return t[0]in n;let r=t.pop(),s=Dt.getter(Dt.join(t),!0)(n);return!!(s&&r in s)};let Io=n=>Object.prototype.toString.call(n)==="[object Object]";function $o(n,e){let t=Object.keys(n.fields);return Object.keys(e).filter(r=>t.indexOf(r)===-1)}const Qu=Po([]);function V(n){return new No(n)}class No extends Le{constructor(e){super({type:"object",check(t){return Io(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=Qu,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{e&&this.shape(e)})}_cast(e,t={}){var r;let s=super._cast(e,t);if(s===void 0)return this.getDefault(t);if(!this._typeCheck(s))return s;let i=this.fields,o=(r=t.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(s).filter(d=>!this._nodes.includes(d))),l={},c=Object.assign({},t,{parent:l,__validating:t.__validating||!1}),u=!1;for(const d of a){let g=i[d],h=d in s,f=s[d];if(g){let m;c.path=(t.path?`${t.path}.`:"")+d,g=g.resolve({value:f,context:t.context,parent:l});let b=g instanceof Le?g.spec:void 0,v=b==null?void 0:b.strict;if(b!=null&&b.strip){u=u||d in s;continue}m=!t.__validating||!v?g.cast(f,c):f,m!==void 0&&(l[d]=m)}else h&&!o&&(l[d]=f);(h!==d in l||l[d]!==f)&&(u=!0)}return u?l:s}_validate(e,t={},r,s){let{from:i=[],originalValue:o=e,recursive:a=this.spec.recursive}=t;t.from=[{schema:this,value:o},...i],t.__validating=!0,t.originalValue=o,super._validate(e,t,r,(l,c)=>{if(!a||!Io(c)){s(l,c);return}o=o||c;let u=[];for(let d of this._nodes){let g=this.fields[d];!g||It.isRef(g)||u.push(g.asNestedTest({options:t,key:d,parent:c,parentPath:t.path,originalParent:o}))}this.runTests({tests:u,value:c,originalValue:o,options:t},r,d=>{s(d.sort(this._sortErrors).concat(l),c)})})}clone(e){const t=super.clone(e);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(e){let t=super.concat(e),r=t.fields;for(let[s,i]of Object.entries(this.fields)){const o=r[s];r[s]=o===void 0?i:o}return t.withMutation(s=>s.setFields(r,[...this._excludedEdges,...e._excludedEdges]))}_getDefault(e){if("default"in this.spec)return super._getDefault(e);if(!this._nodes.length)return;let t={};return this._nodes.forEach(r=>{var s;const i=this.fields[r];let o=e;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),t[r]=i&&"getDefault"in i?i.getDefault(o):void 0}),t}setFields(e,t){let r=this.clone();return r.fields=e,r._nodes=Gu(e,t),r._sortErrors=Po(Object.keys(e)),t&&(r._excludedEdges=t),r}shape(e,t=[]){return this.clone().withMutation(r=>{let s=r._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),s=[...r._excludedEdges,...t]),r.setFields(Object.assign(r.fields,e),s)})}partial(){const e={};for(const[t,r]of Object.entries(this.fields))e[t]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(e)}deepPartial(){return Hn(this)}pick(e){const t={};for(const r of e)this.fields[r]&&(t[r]=this.fields[r]);return this.setFields(t,this._excludedEdges.filter(([r,s])=>e.includes(r)&&e.includes(s)))}omit(e){const t=[];for(const r of Object.keys(this.fields))e.includes(r)||t.push(r);return this.pick(t)}from(e,t,r){let s=Dt.getter(e,!0);return this.transform(i=>{if(!i)return i;let o=i;return Ku(i,e)&&(o=Object.assign({},i),r||delete o[e],o[t]=s(i)),o})}json(){return this.transform(Do)}exact(e){return this.test({name:"exact",exclusive:!0,message:e||Ln.exact,test(t){if(t==null)return!0;const r=$o(this.schema,t);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(e=!0,t=Ln.noUnknown){typeof e!="boolean"&&(t=e,e=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:t,test(s){if(s==null)return!0;const i=$o(this.schema,s);return!e||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=e,r}unknown(e=!0,t=Ln.noUnknown){return this.noUnknown(!e,t)}transformKeys(e){return this.transform(t=>{if(!t)return t;const r={};for(const s of Object.keys(t))r[e(s)]=t[s];return r})}camelCase(){return this.transformKeys(es.camelCase)}snakeCase(){return this.transformKeys(es.snakeCase)}constantCase(){return this.transformKeys(e=>es.snakeCase(e).toUpperCase())}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);r.fields={};for(const[i,o]of Object.entries(t.fields)){var s;let a=e;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=o.describe(a)}return r}}V.prototype=No.prototype;function Wn(n){return new Mo(n)}class Mo extends Le{constructor(e){super({type:"array",spec:{types:e},check(t){return Array.isArray(t)}}),this.innerType=void 0,this.innerType=e}_cast(e,t){const r=super._cast(e,t);if(!this._typeCheck(r)||!this.innerType)return r;let s=!1;const i=r.map((o,a)=>{const l=this.innerType.cast(o,Object.assign({},t,{path:`${t.path||""}[${a}]`,parent:r,originalValue:o,value:o,index:a}));return l!==o&&(s=!0),l});return s?i:r}_validate(e,t={},r,s){var i;let o=this.innerType,a=(i=t.recursive)!=null?i:this.spec.recursive;t.originalValue!=null&&t.originalValue,super._validate(e,t,r,(l,c)=>{var u;if(!a||!o||!this._typeCheck(c)){s(l,c);return}let d=new Array(c.length);for(let h=0;h<c.length;h++){var g;d[h]=o.asNestedTest({options:t,index:h,parent:c,parentPath:t.path,originalParent:(g=t.originalValue)!=null?g:e})}this.runTests({value:c,tests:d,originalValue:(u=t.originalValue)!=null?u:e,options:t},r,h=>s(h.concat(l),c))})}clone(e){const t=super.clone(e);return t.innerType=this.innerType,t}json(){return this.transform(Do)}concat(e){let t=super.concat(e);return t.innerType=this.innerType,e.innerType&&(t.innerType=t.innerType?t.innerType.concat(e.innerType):e.innerType),t}of(e){let t=this.clone();if(!Un(e))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+ht(e));return t.innerType=e,t.spec=Object.assign({},t.spec,{types:e}),t}length(e,t=jn.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:e},skipAbsent:!0,test(r){return r.length===this.resolve(e)}})}min(e,t){return t=t||jn.min,this.test({message:t,name:"min",exclusive:!0,params:{min:e},skipAbsent:!0,test(r){return r.length>=this.resolve(e)}})}max(e,t){return t=t||jn.max,this.test({message:t,name:"max",exclusive:!0,params:{max:e},skipAbsent:!0,test(r){return r.length<=this.resolve(e)}})}ensure(){return this.default(()=>[]).transform((e,t)=>this._typeCheck(e)?e:t==null?[]:[].concat(t))}compact(e){let t=e?(r,s,i)=>!e(r,s,i):r=>!!r;return this.transform(r=>r!=null?r.filter(t):r)}describe(e){const t=(e?this.resolve(e):this).clone(),r=super.describe(e);if(t.innerType){var s;let i=e;(s=i)!=null&&s.value&&(i=Object.assign({},i,{parent:i.value,value:i.value[0]})),r.innerType=t.innerType.describe(i)}return r}}Wn.prototype=Mo.prototype;const ge=(n,e=[])=>t=>{const r=t?Object.keys(t).filter(s=>!n.includes(s)&&!e.includes(s)):[];if(r.length>0)throw new ve(`Unknown properties: ${r.join(", ")}`,t,"custom-validation");return!0},ed=V().shape({params:V().shape({id:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Id is required")}).test("custom-validation","Custom validation failed",n=>ge(["id"],[])(n))}),td=V().shape({body:V().shape({userId:Y().trim().min(1,"User Id must be at least 1 character").max(1e3,"User Id cannot exceed 1000 characters").required("User Id is required"),visitor:ss().required("Visitor is required"),chatbotId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Chatbot Id").required("Chatbot Id is required")}).test("custom-validation","Custom validation failed",ge(["userId","visitor","chatbotId"]))}),Fo={readById:async n=>{await ed.validate({params:n.params},{abortEarly:!1});const{data:e}=await Ie.get(`/live/readById/${n.params.id}`);return e},generateToken:async n=>{await td.validate({body:n.body},{abortEarly:!1});const{data:e}=await Ie.post("/live/generateToken",n.body);return e}},nd=V().shape({params:V().shape({id:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Id is required")}).test("custom-validation","Custom validation failed",ge(["id"],[]))}),rd=V().shape({query:V().shape({skip:Y().trim().min(1,"Skip must be at least 1 character").max(1e4,"Skip cannot exceed 10000 characters").optional()}).test("custom-validation","Custom validation failed",ge([],["skip"]))}),sd=V().shape({body:V().shape({currentNode:Y().trim().min(1,"Current Node must be at least 1 character").max(1e3,"Current Node cannot exceed 1000 characters").required("Current Node is required")}).test("custom-validation","Custom validation failed",ge(["currentNode"])),params:V().shape({id:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Id is required")}).test("custom-validation","Custom validation failed",ge(["id"],[]))}),id=V().shape({body:V().shape({assignType:Y().oneOf(["role","teamMember","everyone"]).required("Assign Type is required"),assignTo:Y().when("assignType",{is:"role",then:n=>n.min(1,"Role must be at least 1 character").max(500,"Role cannot exceed 500 characters").required("Role is required")}).when("assignType",{is:"teamMember",then:n=>n.trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Member Id").required("Member Id is required")}).when("assignType",{is:"everyone",then:n=>n.nullable()})}).test("custom-validation","Custom validation failed",ge(["assignType","assignTo"])),params:V().shape({id:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Id is required")}).test("custom-validation","Custom validation failed",ge(["id"],[]))}),od=V().shape({body:V().shape({chatflow:V().shape({key:Y().max(1e3,"Key cannot exceed 1000 characters").optional(),index:cn().max(1e3,"Index cannot exceed 1000").optional()}).nullable().optional(),nodeId:Y().trim().min(1,"Node ID must be at least 1 character").max(1e3,"Node ID cannot exceed 1000 characters").optional()}).test("custom-validation","Custom validation failed",ge([],["chatflow","nodeId"]))}),$t={userRead:async(n,e)=>{await nd.validate({params:n.params},{abortEarly:!1});const{data:t}=await Ie.get(`/conversation/user/read/${n.params.id}`,{headers:{Authorization:`Bearer ${e}`}});return t},userReadAll:async(n,e)=>{await rd.validate({query:e==null?void 0:e.query},{abortEarly:!1});const{data:t}=await Ie.get("/conversation/user/readAll",{params:e==null?void 0:e.query,headers:{Authorization:`Bearer ${n}`}});return t},userUpdateCurrentNode:async(n,e)=>{await sd.validate({params:n.params,body:n.body},{abortEarly:!1});const{data:t}=await Ie.post(`/conversation/user/update/currentNode/${n.params.id}`,n.body,{headers:{Authorization:`Bearer ${e}`}});return t},userAssignToAgent:async(n,e)=>{await id.validate({params:n.params,body:n.body},{abortEarly:!1});const{data:t}=await Ie.post(`/conversation/user/update/assign/${n.params.id}`,n.body,{headers:{Authorization:`Bearer ${e}`}});return t},userCreate:async(n,e)=>{await od.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/conversation/user/create",n.body,{headers:{Authorization:`Bearer ${e}`}});return t}},ad=({className:n,style:e={}})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 256 256",className:n,style:e,children:p("path",{fill:"currentColor",d:"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"})}),un=({className:n,width:e=16,height:t=16})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 256 256",className:n,children:p("path",{fill:"currentColor",d:"M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"})}),Zt=({className:n})=>p("svg",{width:"100%",height:"100%",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",className:n,children:p("path",{fill:"currentColor",d:"M13 0C10.4288 0 7.91543 0.762437 5.77759 2.1909C3.63975 3.61935 1.97351 5.64968 0.989572 8.02512C0.0056327 10.4006 -0.251811 13.0144 0.249797 15.5362C0.751405 18.0579 1.98953 20.3743 3.80762 22.1924C5.6257 24.0105 7.94208 25.2486 10.4638 25.7502C12.9856 26.2518 15.5995 25.9944 17.9749 25.0104C20.3503 24.0265 22.3807 22.3603 23.8091 20.2224C25.2376 18.0846 26 15.5712 26 13C25.9964 9.5533 24.6256 6.24882 22.1884 3.81163C19.7512 1.37445 16.4467 0.00363977 13 0Z"})}),Lo=({className:n})=>p("svg",{width:"11",height:"6",viewBox:"0 0 11 6",xmlns:"http://www.w3.org/2000/svg",className:n,children:p("path",{fill:"currentColor",d:"M10.7884 1.18378L6.00738 5.79649C5.94076 5.861 5.86159 5.91218 5.77442 5.9471C5.68725 5.98202 5.59379 6 5.4994 6C5.40501 6 5.31156 5.98202 5.22438 5.9471C5.13721 5.91218 5.05805 5.861 4.99142 5.79649L0.210413 1.18378C0.0756879 1.0538 0 0.877507 0 0.693683C0 0.50986 0.0756879 0.333566 0.210413 0.203583C0.345138 0.0736001 0.527865 0.000576714 0.718395 0.000576712C0.908925 0.00057671 1.09165 0.0736001 1.22638 0.203583L5.5 4.32677L9.77362 0.203007C9.90835 0.0730239 10.0911 0 10.2816 0C10.4721 0 10.6549 0.0730239 10.7896 0.203007C10.9243 0.332989 11 0.509284 11 0.693107C11 0.87693 10.9243 1.05322 10.7896 1.18321Z"})}),ld=({className:n})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 256 256",className:n,children:p("path",{fill:"currentColor",d:"M234.29,114.85l-45,38.83L203,211.75a16.4,16.4,0,0,1-24.5,17.82L128,198.49,77.47,229.57A16.4,16.4,0,0,1,53,211.75l13.76-58.07-45-38.83A16.46,16.46,0,0,1,31.08,86l59-4.76,22.76-55.08a16.36,16.36,0,0,1,30.27,0l22.75,55.08,59,4.76a16.46,16.46,0,0,1,9.37,28.86Z"})}),jo=({className:n,width:e=32,height:t=32})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 256 256",className:n,children:p("path",{fill:"currentColor",d:"M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"})}),cd=({className:n,width:e=32})=>p("svg",{width:e,height:e*2,viewBox:"0 0 9 14",xmlns:"http://www.w3.org/2000/svg",className:n,children:[p("circle",{cx:"6.99929",cy:"1.27273",r:"1.27273",fill:"currentColor"}),p("circle",{cx:"1.27273",cy:"1.27273",r:"1.27273",fill:"currentColor"}),p("circle",{cx:"6.99929",cy:"7.00002",r:"1.27273",fill:"currentColor"}),p("circle",{cx:"1.27273",cy:"7.00002",r:"1.27273",fill:"currentColor"}),p("circle",{cx:"6.99929",cy:"12.7273",r:"1.27273",fill:"currentColor"}),p("circle",{cx:"1.27273",cy:"12.7273",r:"1.27273",fill:"currentColor"})]}),ud=({className:n})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 256 256",className:n,children:p("path",{fill:"currentColor",d:"M231.87,114l-168-95.89A16,16,0,0,0,40.92,37.34L71.55,128,40.92,218.67A16,16,0,0,0,56,240a16.15,16.15,0,0,0,7.93-2.1l167.92-96.05a16,16,0,0,0,.05-27.89ZM56,224a.56.56,0,0,0,0-.12L85.74,136H144a8,8,0,0,0,0-16H85.74L56.06,32.16A.46.46,0,0,0,56,32l168,95.83Z"})}),dd=({className:n})=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 256 256",className:n,children:p("path",{fill:"currentColor",d:"M209.66,122.34a8,8,0,0,1,0,11.32l-82.05,82a56,56,0,0,1-79.2-79.21L147.67,35.73a40,40,0,1,1,56.61,56.55L105,193A24,24,0,1,1,71,159L154.3,74.38A8,8,0,1,1,165.7,85.6L82.39,170.31a8,8,0,1,0,11.27,11.36L192.93,81A24,24,0,1,0,159,47L59.76,147.68a40,40,0,1,0,56.53,56.62l82.06-82A8,8,0,0,1,209.66,122.34Z"})}),hd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADcAAAAxCAYAAAB+gjFbAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAALhSURBVHgB7ZlNbtpAFMf/MxC1qySIdNFVnRtwg5ATlJygdNdFCuYEgRPEVN2HnqD0BNAbJCeId13kA6SuKjUzfW8MgQbHGJi09ig/aWQbxpJ/fvPlNwLrcnxVhZAVSHFAVxUqu5OyKaEpWl1AYYjizyGC/THWQKxU27/chdpuQggfdkRSonu4U1/w+dVwlbvSybGU3j6h6j7+L0OIX+8RvA7TVF4u9/HKhyyQ2L+M1DJ0gG65taxWslzz5jQD0XqMkKJ4mBTFeDnTDHe+0lkV2SZRUMbeoncGyL4Y40G/GMD/4cX9uShnmqIZ2vPCRHC0MCb8Ledf1zPcx5IgQX328MdZn+PQ8hvginlFqCMEe/3p5SxyaquNPIsxWp7ON89IjqMm5DvkH49WMvXpRSQXRc0NpLgPUiQn5AHcoQKfFvVguWNz4sEllKzxQULKKlxDmM8wbpY6TxN2WoyTpP72Bi7yYeTxgOLBRV7CyGXoO80uEg7zLJdXnuXyii05ymWIQyr75qh0Cxrf6ffkZCrX0bpL9xzd3wucwxICzVuNTeEH/FSO/4L3R7xa8KBUtBKSMkQkECIoLcrzolcXBtgUelFF2OHxCAUlFuHSRyr0WqnzOOw0S5tLuN/SgyUs9Tldi8s+rYVEDZawNaBQEledYFOinSNr6Q6LUwGlBBuj9R+M8ziFwhnscW53nhO01dS4WT2CHDG7aUUzEtufxIVo0/RyOUlfJMPRalz3KGJ286UaF3ywNRU8xDMP3LzlHdJvNKn3qYyh7sYoblXoBXiUpXpLD1FdcfszHVqZacfOJJ41eLUTlEIH15aix2J85p6cQGd66pjcLGqMS3LhfNQYd+SEas1HjXFDTujO/L7clPzLGbFyO+6vfMsliDFPtUJ5asZRH9vrJVXKnxznXaSok1i4rGp+5CKpNrqlYdpbsi1nhPSQhoY+Sa2cFStS5qqDrKCpLxUkJ4ii7Fi3tFGy6A+7st8LQyzi5QAAAABJRU5ErkJggg==",as=n=>{const e=new Date(n);if(Number.isNaN(e.getTime()))return"Invalid date";const r=new Date().getTime()-e.getTime();if(r<0)return"in the future";const s=Math.floor(r/1e3),i=Math.floor(s/60),o=Math.floor(i/60),a=Math.floor(o/24),l=Math.floor(a/30),c=Math.floor(l/12);let d=[{limit:60*1e3,label:"just now"},{limit:60*60*1e3,label:`${i} minute${i!==1?"s":""}`},{limit:24*60*60*1e3,label:`${o} hour${o!==1?"s":""}`},{limit:30*24*60*60*1e3,label:`${a} day${a!==1?"s":""}`}].find(g=>r<g.limit);return d?d.label:l>0?`${l} month${l!==1?"s":""} ago`:`${c} year${c!==1?"s":""} ago`},fd=V().shape({name:Y().min(1,"Name must be at least 1 character").max(1e3,"Name cannot exceed 1000 characters").required("Name is required"),url:Y().min(1,"URL must be at least 1 character").max(1e3,"URL cannot exceed 1000 characters").required("URL is required")}).test("custom-validation","Custom validation failed",ge(["name","url"])),pd=V().shape({text:Y().min(1,"Text must be at least 1 character").max(1e3,"Text cannot exceed 1000 characters").optional(),file:fd.when("text",{is:n=>!n,then:n=>n.required(),otherwise:n=>n.strip()})}).test("text-or-file","Either 'text' or 'file' must be provided",function(n){const{text:e,file:t}=n;return!e&&!t?this.createError({path:"data",message:"Either 'text' or 'file' must be provided"}):!0}).test("custom-validation","Custom validation failed",ge([],["text","file"])),gd=V().shape({params:V().shape({id:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Id is required")}).test("custom-validation","Custom validation failed",ge(["id"]))}),md=V().shape({body:V().shape({conversationId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Conversation Id").required("Conversation Id is required"),skip:cn().min(0,"Skip must be at least 0").max(1e4,"Skip cannot exceed 10000").optional()}).test("custom-validation","Custom validation failed",ge(["conversationId"],["skip"]))}),Uo=V().shape({body:V().shape({owner:Y().oneOf(["ai","user"]).required("Owner must be 'ai' or 'user'"),conversationId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Conversation Id").required("Conversation Id is required"),type:Y().oneOf(["AI Text","Human Text","External API","External API Text","AI Response"]).required("Type is required"),data:pd.required("Message data is required"),currentChatflow:V().shape({key:Y().max(1e3,"Key cannot exceed 1000 characters").optional(),index:cn().max(1e3,"Index cannot exceed 1000").optional()}).nullable().optional()}).test("custom-validation","Custom validation failed",ge(["owner","conversationId","type","data"],["currentChatflow"]))}),bd=V().shape({body:V().shape({queries:Wn().of(Y().min(1,"Query must be at least 1 character").max(1e3,"Query cannot exceed 1000 characters")).max(200,"Queries cannot exceed 200 items").optional(),conversationHistory:Wn().of(V().shape({user:Y().min(1,"User message must be at least 1 character").max(1e3,"User message cannot exceed 1000 characters").optional(),ai:Y().min(1,"AI message must be at least 1 character").max(1e3,"AI message cannot exceed 1000 characters").optional()}).test("custom-validation","Custom validation failed",ge([],["user","ai"]))).min(1,"Conversation history must have at least 1 entry").max(3,"Conversation history cannot exceed 3 entries").required("Conversation history is required")}).test("custom-validation","Custom validation failed",ge(["queries","conversationHistory"]))}),_d=V().shape({body:V().shape({conversationId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Conversation Id").required("Conversation Id is required"),conversationHistory:Wn().of(V().shape({user:Y().min(1,"User message must be at least 1 character").max(1e3,"User message cannot exceed 1000 characters").optional(),ai:Y().min(1,"AI message must be at least 1 character").max(2500,"AI message cannot exceed 2500 characters").optional()}).test("custom-validation","Custom validation failed",ge([],["user","ai"]))).min(1,"Conversation history must have at least 1 entry").max(8,"Conversation history cannot exceed 8 entries").required("Conversation history is required"),enableStreaming:ss().optional()}).test("custom-validation","Custom validation failed",ge(["conversationId","conversationHistory"],["enableStreaming"]))}),ls={userReadAll:async(n,e)=>{await md.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/message/user/readAll",n.body,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t},userUpdateSeen:async(n,e)=>{await gd.validate({params:n.params},{abortEarly:!1});const{data:t}=await Ie.post(`/message/user/update/seen/${n.params.id}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t},userCreate:async(n,e)=>{await Uo.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/message/user/create",n.body,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t},userAIContextMessage:async(n,e)=>{await _d.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/message/user/ai/message",n.body,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t},userAICheckQueries:async(n,e)=>{await bd.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/message/user/ai/checkQueries",n.body,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t}},vd={userUploadAsset:async(n,e)=>{const t=new FormData;t.append("file",n);const{data:r}=await Ie.post("/asset/userUpload",t,{headers:{"Content-Type":"multipart/form-data",Authorization:`Bearer ${e}`}});return r}};V().shape({rating:Y().trim().min(1).max(1),skip:Y().trim().min(1).max(1e3),limit:Y().trim().min(1).max(1e3)}).test("custom-validation","Custom validation failed",ge([],["rating","skip","limit"]));const yd=V().shape({body:V().shape({conversationId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Conversation Id is required"),chatbotId:Y().trim().matches(/^[0-9a-fA-F]{24}$/,"Invalid Id").required("Chatbot Id is required"),comment:Y().trim().max(500).min(3).required("Comment is required"),rating:cn().max(5).min(1).required("Rating is required")}).test("custom-validation","Custom validation failed",ge(["conversationId","chatbotId","comment","rating"]))}),xd={userCreate:async(n,e)=>{await yd.validate({body:n.body},{abortEarly:!1});const{data:t}=await Ie.post("/review/user/create",n.body,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}});return t}};class wd{constructor(){this.buffer="",this.eventType=null,this.eventData=""}async parseStream(e,t,r){const s=e.body.getReader(),i=new TextDecoder;try{for(;;){const{done:o,value:a}=await s.read();if(o)break;this.buffer+=i.decode(a,{stream:!0}),this.processBuffer(t)}this.buffer.trim()&&this.processBuffer(t),t({type:"done",data:{}})}catch(o){console.error("SSE parsing failed:",o),r(o instanceof Error?o:new Error("Stream parsing failed"))}}processBuffer(e){const t=this.buffer.split(`