diff --git a/langserve/chat_playground/dist/assets/index-d9089d96.js b/langserve/chat_playground/dist/assets/index-86d4d9c0.js similarity index 99% rename from langserve/chat_playground/dist/assets/index-d9089d96.js rename to langserve/chat_playground/dist/assets/index-86d4d9c0.js index fee1c959..82a80da5 100644 --- a/langserve/chat_playground/dist/assets/index-d9089d96.js +++ b/langserve/chat_playground/dist/assets/index-86d4d9c0.js @@ -126,7 +126,7 @@ function print() { __p += __j.call(arguments, '') } `:`; `)+fe+`return __p }`;var oe=Y0(function(){return Qt(M,be+"return "+fe).apply(void 0,B)});if(oe.source=fe,kf(oe))throw oe;return oe},T.times=function(i,a){if((i=qe(i))<1||i>9007199254740991)return[];var d=4294967295,m=cn(i,4294967295);i-=4294967295;for(var x=Fc(m,a=Re(a));++d=R)return i;var M=d-ki(m);if(M<1)return m;var B=j?po(j,0,M).join(""):i.slice(0,M);if(x===void 0)return B+m;if(j&&(M+=B.length-M),Rf(x)){if(i.slice(M).search(x)){var te,J=B;for(x.global||(x=Wc(x.source,ct(Wt.exec(x))+"g")),x.lastIndex=0;te=x.exec(J);)var fe=te.index;B=B.slice(0,fe===void 0?M:fe)}}else if(i.indexOf(Ln(x),M)!=M){var Ce=B.lastIndexOf(x);Ce>-1&&(B=B.slice(0,Ce))}return B+m},T.unescape=function(i){return(i=ct(i))&&W.test(i)?i.replace(F,d3):i},T.uniqueId=function(i){var a=++v3;return ct(i)+a},T.upperCase=Y4,T.upperFirst=Nf,T.each=k0,T.eachRight=R0,T.first=b0,Df(T,(zf={},Sr(T,function(i,a){vt.call(T.prototype,a)||(zf[a]=i)}),zf),{chain:!1}),T.VERSION="4.17.15",Kn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){T[i].placeholder=T}),Kn(["drop","take"],function(i,a){Xe.prototype[i]=function(d){d=d===void 0?1:Kt(qe(d),0);var m=this.__filtered__&&!a?new Xe(this):this.clone();return m.__filtered__?m.__takeCount__=cn(d,m.__takeCount__):m.__views__.push({size:cn(d,4294967295),type:i+(m.__dir__<0?"Right":"")}),m},Xe.prototype[i+"Right"]=function(d){return this.reverse()[i](d).reverse()}}),Kn(["filter","map","takeWhile"],function(i,a){var d=a+1,m=d==1||d==3;Xe.prototype[i]=function(x){var R=this.clone();return R.__iteratees__.push({iteratee:Re(x,3),type:d}),R.__filtered__=R.__filtered__||m,R}}),Kn(["head","last"],function(i,a){var d="take"+(a?"Right":"");Xe.prototype[i]=function(){return this[d](1).value()[0]}}),Kn(["initial","tail"],function(i,a){var d="drop"+(a?"":"Right");Xe.prototype[i]=function(){return this.__filtered__?new Xe(this):this[d](1)}}),Xe.prototype.compact=function(){return this.filter(kn)},Xe.prototype.find=function(i){return this.filter(i).head()},Xe.prototype.findLast=function(i){return this.reverse().find(i)},Xe.prototype.invokeMap=Ge(function(i,a){return typeof i=="function"?new Xe(this):this.map(function(d){return Pu(d,i,a)})}),Xe.prototype.reject=function(i){return this.filter(Ta(Re(i)))},Xe.prototype.slice=function(i,a){i=qe(i);var d=this;return d.__filtered__&&(i>0||a<0)?new Xe(d):(i<0?d=d.takeRight(-i):i&&(d=d.drop(i)),a!==void 0&&(d=(a=qe(a))<0?d.dropRight(-a):d.take(a-i)),d)},Xe.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Xe.prototype.toArray=function(){return this.take(4294967295)},Sr(Xe.prototype,function(i,a){var d=/^(?:filter|find|map|reject)|While$/.test(a),m=/^(?:head|last)$/.test(a),x=T[m?"take"+(a=="last"?"Right":""):a],R=m||/^find/.test(a);x&&(T.prototype[a]=function(){var j=this.__wrapped__,M=m?[1]:arguments,B=j instanceof Xe,te=M[0],J=B||We(j),fe=function(De){var Ee=x.apply(T,io([De],M));return m&&Ce?Ee[0]:Ee};J&&d&&typeof te=="function"&&te.length!=1&&(B=J=!1);var Ce=this.__chain__,be=!!this.__actions__.length,$e=R&&!Ce,oe=B&&!be;if(!R&&J){j=oe?j:new Xe(this);var he=i.apply(j,M);return he.__actions__.push({func:Ca,args:[fe],thisArg:void 0}),new Zn(he,Ce)}return $e&&oe?i.apply(this,M):(he=this.thru(fe),$e?m?he.value()[0]:he.value():he)})}),Kn(["pop","push","shift","sort","splice","unshift"],function(i){var a=Ks[i],d=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",m=/^(?:pop|shift)$/.test(i);T.prototype[i]=function(){var x=arguments;if(m&&!this.__chain__){var R=this.value();return a.apply(We(R)?R:[],x)}return this[d](function(j){return a.apply(We(j)?j:[],x)})}}),Sr(Xe.prototype,function(i,a){var d=T[a];if(d){var m=d.name+"";vt.call(Pi,m)||(Pi[m]=[]),Pi[m].push({name:a,func:d})}}),Pi[ma(void 0,2).name]=[{name:"wrapper",func:void 0}],Xe.prototype.clone=function(){var i=new Xe(this.__wrapped__);return i.__actions__=Sn(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Sn(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Sn(this.__views__),i},Xe.prototype.reverse=function(){if(this.__filtered__){var i=new Xe(this);i.__dir__=-1,i.__filtered__=!0}else(i=this.clone()).__dir__*=-1;return i},Xe.prototype.value=function(){var i=this.__wrapped__.value(),a=this.__dir__,d=We(i),m=a<0,x=d?i.length:0,R=function(Qe,ke,Pe){for(var Yt=-1,gn=Pe.length;++Yt=this.__values__.length;return{done:i,value:i?void 0:this.__values__[this.__index__++]}},T.prototype.plant=function(i){for(var a,d=this;d instanceof aa;){var m=_0(d);m.__index__=0,m.__values__=void 0,a?x.__wrapped__=m:a=m;var x=m;d=d.__wrapped__}return x.__wrapped__=i,a},T.prototype.reverse=function(){var i=this.__wrapped__;if(i instanceof Xe){var a=i;return this.__actions__.length&&(a=new Xe(this)),(a=a.reverse()).__actions__.push({func:Ca,args:[bf],thisArg:void 0}),new Zn(a,this.__chain__)}return this.thru(bf)},T.prototype.toJSON=T.prototype.valueOf=T.prototype.value=function(){return Bh(this.__wrapped__,this.__actions__)},T.prototype.first=T.prototype.head,bu&&(T.prototype[bu]=function(){return this}),T}();s(n(46))=="object"&&n(46)?(kt._=so,(u=(function(){return so}).call(t,n,t,o))===void 0||(o.exports=u)):qo?((qo.exports=so)._=so,Ac._=so):kt._=so}).call(this)}).call(this,n(11),n(14)(e))},function(e,t,n){var r=n(87);e.exports={Graph:r.Graph,json:n(213),alg:n(214),version:r.version}},function(e,t,n){e.exports={Graph:n(28),version:n(212)}},function(e,t,n){var r=n(89);e.exports=function(o){return r(o,4)}},function(e,t,n){var r=n(29),o=n(33),u=n(49),s=n(118),l=n(124),c=n(127),f=n(128),h=n(129),p=n(130),v=n(59),g=n(131),E=n(10),_=n(135),O=n(136),y=n(141),w=n(0),C=n(12),b=n(142),S=n(5),k=n(144),N=n(6),P={};P["[object Arguments]"]=P["[object Array]"]=P["[object ArrayBuffer]"]=P["[object DataView]"]=P["[object Boolean]"]=P["[object Date]"]=P["[object Float32Array]"]=P["[object Float64Array]"]=P["[object Int8Array]"]=P["[object Int16Array]"]=P["[object Int32Array]"]=P["[object Map]"]=P["[object Number]"]=P["[object Object]"]=P["[object RegExp]"]=P["[object Set]"]=P["[object String]"]=P["[object Symbol]"]=P["[object Uint8Array]"]=P["[object Uint8ClampedArray]"]=P["[object Uint16Array]"]=P["[object Uint32Array]"]=!0,P["[object Error]"]=P["[object Function]"]=P["[object WeakMap]"]=!1,e.exports=function ee(L,H,V,me,G,K){var Q,ue=1&H,U=2&H,Z=4&H;if(V&&(Q=G?V(L,me,G,K):V(L)),Q!==void 0)return Q;if(!S(L))return L;var ae=w(L);if(ae){if(Q=_(L),!ue)return f(L,Q)}else{var I=E(L),F=I=="[object Function]"||I=="[object GeneratorFunction]";if(C(L))return c(L,ue);if(I=="[object Object]"||I=="[object Arguments]"||F&&!G){if(Q=U||F?{}:y(L),!ue)return U?p(L,l(Q,L)):h(L,s(Q,L))}else{if(!P[I])return G?L:{};Q=O(L,I,ue)}}K||(K=new r);var se=K.get(L);if(se)return se;K.set(L,Q),k(L)?L.forEach(function(le){Q.add(ee(le,H,V,le,L,K))}):b(L)&&L.forEach(function(le,ge){Q.set(ge,ee(le,H,V,ge,L,K))});var W=Z?U?g:v:U?keysIn:N,ie=ae?void 0:W(L);return o(ie||L,function(le,ge){ie&&(le=L[ge=le]),u(Q,ge,ee(le,H,V,ge,L,K))}),Q}},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,n){var r=n(16),o=Array.prototype.splice;e.exports=function(u){var s=this.__data__,l=r(s,u);return!(l<0)&&(l==s.length-1?s.pop():o.call(s,l,1),--this.size,!0)}},function(e,t,n){var r=n(16);e.exports=function(o){var u=this.__data__,s=r(u,o);return s<0?void 0:u[s][1]}},function(e,t,n){var r=n(16);e.exports=function(o){return r(this.__data__,o)>-1}},function(e,t,n){var r=n(16);e.exports=function(o,u){var s=this.__data__,l=r(s,o);return l<0?(++this.size,s.push([o,u])):s[l][1]=u,this}},function(e,t,n){var r=n(15);e.exports=function(){this.__data__=new r,this.size=0}},function(e,t){e.exports=function(n){var r=this.__data__,o=r.delete(n);return this.size=r.size,o}},function(e,t){e.exports=function(n){return this.__data__.get(n)}},function(e,t){e.exports=function(n){return this.__data__.has(n)}},function(e,t,n){var r=n(15),o=n(31),u=n(32);e.exports=function(s,l){var c=this.__data__;if(c instanceof r){var f=c.__data__;if(!o||f.length<199)return f.push([s,l]),this.size=++c.size,this;c=this.__data__=new u(f)}return c.set(s,l),this.size=c.size,this}},function(e,t,n){var r=n(17),o=n(103),u=n(5),s=n(48),l=/^\[object .+?Constructor\]$/,c=Function.prototype,f=Object.prototype,h=c.toString,p=f.hasOwnProperty,v=RegExp("^"+h.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(g){return!(!u(g)||o(g))&&(r(g)?v:l).test(s(g))}},function(e,t,n){var r=n(9),o=Object.prototype,u=o.hasOwnProperty,s=o.toString,l=r?r.toStringTag:void 0;e.exports=function(c){var f=u.call(c,l),h=c[l];try{c[l]=void 0;var p=!0}catch{}var v=s.call(c);return p&&(f?c[l]=h:delete c[l]),v}},function(e,t){var n=Object.prototype.toString;e.exports=function(r){return n.call(r)}},function(e,t,n){var r,o=n(104),u=(r=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(s){return!!u&&u in s}},function(e,t,n){var r=n(2)["__core-js_shared__"];e.exports=r},function(e,t){e.exports=function(n,r){return n==null?void 0:n[r]}},function(e,t,n){var r=n(107),o=n(15),u=n(31);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(u||o),string:new r}}},function(e,t,n){var r=n(108),o=n(109),u=n(110),s=n(111),l=n(112);function c(f){var h=-1,p=f==null?0:f.length;for(this.clear();++h0&&c(g)?l>1?u(g,l-1,c,f,h):r(h,g):f||(h[h.length]=g)}return h}},function(e,t,n){var r=n(9),o=n(21),u=n(0),s=r?r.isConcatSpreadable:void 0;e.exports=function(l){return u(l)||o(l)||!!(s&&l&&l[s])}},function(e,t,n){var r=n(25),o=n(195),u=n(197);e.exports=function(s,l){return u(o(s,l,r),s+"")}},function(e,t,n){var r=n(196),o=Math.max;e.exports=function(u,s,l){return s=o(s===void 0?u.length-1:s,0),function(){for(var c=arguments,f=-1,h=o(c.length-s,0),p=Array(h);++f0){if(++o>=800)return arguments[0]}else o=0;return r.apply(void 0,arguments)}}},function(e,t,n){var r=n(68),o=n(201),u=n(206),s=n(69),l=n(207),c=n(42);e.exports=function(f,h,p){var v=-1,g=o,E=f.length,_=!0,O=[],y=O;if(p)_=!1,g=u;else if(E>=200){var w=h?null:l(f);if(w)return c(w);_=!1,g=s,y=new r}else y=h?[]:O;e:for(;++v-1}},function(e,t,n){var r=n(203),o=n(204),u=n(205);e.exports=function(s,l,c){return l==l?u(s,l,c):r(s,o,c)}},function(e,t){e.exports=function(n,r,o,u){for(var s=n.length,l=o+(u?1:-1);u?l--:++l1||s.length===1&&u.hasEdge(s[0],s[0])})}},function(e,t,n){var r=n(1);e.exports=function(u,s,l){return function(c,f,h){var p={},v=c.nodes();return v.forEach(function(g){p[g]={},p[g][g]={distance:0},v.forEach(function(E){g!==E&&(p[g][E]={distance:Number.POSITIVE_INFINITY})}),h(g).forEach(function(E){var _=E.v===g?E.w:E.v,O=f(E);p[g][_]={distance:O,predecessor:g}})}),v.forEach(function(g){var E=p[g];v.forEach(function(_){var O=p[_];v.forEach(function(y){var w=O[g],C=E[y],b=O[y],S=w.distance+C.distance;S0;){if(c=p.removeMin(),r.has(h,c))f.setEdge(c,h[c]);else{if(g)throw new Error("Input graph is not connected: "+s);g=!0}s.nodeEdges(c).forEach(v)}return f}},function(e,t,n){(function(r){function o(l,c){for(var f=0,h=l.length-1;h>=0;h--){var p=l[h];p==="."?l.splice(h,1):p===".."?(l.splice(h,1),f++):f&&(l.splice(h,1),f--)}if(c)for(;f--;f)l.unshift("..");return l}function u(l,c){if(l.filter)return l.filter(c);for(var f=[],h=0;h=-1&&!c;f--){var h=f>=0?arguments[f]:r.cwd();if(typeof h!="string")throw new TypeError("Arguments to path.resolve must be strings");h&&(l=h+"/"+l,c=h.charAt(0)==="/")}return(c?"/":"")+(l=o(u(l.split("/"),function(p){return!!p}),!c).join("/"))||"."},t.normalize=function(l){var c=t.isAbsolute(l),f=s(l,-1)==="/";return(l=o(u(l.split("/"),function(h){return!!h}),!c).join("/"))||c||(l="."),l&&f&&(l+="/"),(c?"/":"")+l},t.isAbsolute=function(l){return l.charAt(0)==="/"},t.join=function(){var l=Array.prototype.slice.call(arguments,0);return t.normalize(u(l,function(c,f){if(typeof c!="string")throw new TypeError("Arguments to path.join must be strings");return c}).join("/"))},t.relative=function(l,c){function f(O){for(var y=0;y=0&&O[w]==="";w--);return y>w?[]:O.slice(y,w-y+1)}l=t.resolve(l).substr(1),c=t.resolve(c).substr(1);for(var h=f(l.split("/")),p=f(c.split("/")),v=Math.min(h.length,p.length),g=v,E=0;E=1;--v)if((c=l.charCodeAt(v))===47){if(!p){h=v;break}}else p=!1;return h===-1?f?"/":".":f&&h===1?"/":l.slice(0,h)},t.basename=function(l,c){var f=function(h){typeof h!="string"&&(h+="");var p,v=0,g=-1,E=!0;for(p=h.length-1;p>=0;--p)if(h.charCodeAt(p)===47){if(!E){v=p+1;break}}else g===-1&&(E=!1,g=p+1);return g===-1?"":h.slice(v,g)}(l);return c&&f.substr(-1*c.length)===c&&(f=f.substr(0,f.length-c.length)),f},t.extname=function(l){typeof l!="string"&&(l+="");for(var c=-1,f=0,h=-1,p=!0,v=0,g=l.length-1;g>=0;--g){var E=l.charCodeAt(g);if(E!==47)h===-1&&(p=!1,h=g+1),E===46?c===-1?c=g:v!==1&&(v=1):c!==-1&&(v=-1);else if(!p){f=g+1;break}}return c===-1||h===-1||v===0||v===1&&c===h-1&&c===f+1?"":l.slice(c,h)};var s="ab".substr(-1)==="b"?function(l,c,f){return l.substr(c,f)}:function(l,c,f){return c<0&&(c=l.length+c),l.substr(c,f)}}).call(this,n(13))},function(e,t,n){function r(s){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l})(s)}var o={file:n(225),http:n(81),https:n(81)},u=(typeof window>"u"?"undefined":r(window))==="object"||typeof importScripts=="function"?o.http:o.file;typeof Promise>"u"&&n(83),e.exports.load=function(s,l){var c=Promise.resolve();return l===void 0&&(l={}),c=(c=c.then(function(){if(s===void 0)throw new TypeError("location is required");if(typeof s!="string")throw new TypeError("location must be a string");if(l!==void 0){if(r(l)!=="object")throw new TypeError("options must be an object");if(l.processContent!==void 0&&typeof l.processContent!="function")throw new TypeError("options.processContent must be a function")}})).then(function(){return new Promise(function(f,h){(function(p){var v=function(E){return E!==void 0&&(E=E.indexOf("://")===-1?"":E.split("://")[0]),E}(p),g=o[v];if(g===void 0){if(v!=="")throw new Error("Unsupported scheme: "+v);g=u}return g})(s).load(s,l||{},function(p,v){p?h(p):f(v)})})}).then(function(f){return l.processContent?new Promise(function(h,p){r(f)!=="object"&&(f={text:f}),f.location=s,l.processContent(f,function(v,g){v?p(v):h(g)})}):r(f)==="object"?f.text:f})}},function(e,t,n){var r=new TypeError("The 'file' scheme is not supported in the browser");e.exports.getBase=function(){throw r},e.exports.load=function(){var o=arguments[arguments.length-1];if(typeof o!="function")throw r;o(r)}},function(e,t,n){function r(b){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(S){return typeof S}:function(S){return S&&typeof Symbol=="function"&&S.constructor===Symbol&&S!==Symbol.prototype?"symbol":typeof S})(b)}var o;typeof window<"u"?o=window:typeof self<"u"?o=self:(console.warn("Using browser-only version of superagent in non-browser environment"),o=this);var u=n(227),s=n(228),l=n(82),c=n(229),f=n(231);function h(){}var p=t=e.exports=function(b,S){return typeof S=="function"?new t.Request("GET",b).end(S):arguments.length==1?new t.Request("GET",b):new t.Request(b,S)};t.Request=w,p.getXHR=function(){if(!(!o.XMLHttpRequest||o.location&&o.location.protocol=="file:"&&o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch{}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch{}throw Error("Browser-only version of superagent could not find XHR")};var v="".trim?function(b){return b.trim()}:function(b){return b.replace(/(^\s*|\s*$)/g,"")};function g(b){if(!l(b))return b;var S=[];for(var k in b)E(S,k,b[k]);return S.join("&")}function E(b,S,k){if(k!=null)if(Array.isArray(k))k.forEach(function(P){E(b,S,P)});else if(l(k))for(var N in k)E(b,S+"["+N+"]",k[N]);else b.push(encodeURIComponent(S)+"="+encodeURIComponent(k));else k===null&&b.push(encodeURIComponent(S))}function _(b){for(var S,k,N={},P=b.split("&"),ee=0,L=P.length;ee=2&&b._responseTimeoutTimer&&clearTimeout(b._responseTimeoutTimer),H==4){var V;try{V=S.status}catch{V=0}if(!V)return b.timedout||b._aborted?void 0:b.crossDomainError();b.emit("end")}};var N=function(H,V){V.total>0&&(V.percent=V.loaded/V.total*100),V.direction=H,b.emit("progress",V)};if(this.hasListeners("progress"))try{S.onprogress=N.bind(null,"download"),S.upload&&(S.upload.onprogress=N.bind(null,"upload"))}catch{}try{this.username&&this.password?S.open(this.method,this.url,!0,this.username,this.password):S.open(this.method,this.url,!0)}catch(H){return this.callback(H)}if(this._withCredentials&&(S.withCredentials=!0),!this._formData&&this.method!="GET"&&this.method!="HEAD"&&typeof k!="string"&&!this._isHost(k)){var P=this._header["content-type"],ee=this._serializer||p.serialize[P?P.split(";")[0]:""];!ee&&O(P)&&(ee=p.serialize["application/json"]),ee&&(k=ee(k))}for(var L in this.header)this.header[L]!=null&&this.header.hasOwnProperty(L)&&S.setRequestHeader(L,this.header[L]);return this._responseType&&(S.responseType=this._responseType),this.emit("request",this),S.send(k!==void 0?k:null),this},p.agent=function(){return new f},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(b){f.prototype[b.toLowerCase()]=function(S,k){var N=new p.Request(b,S);return this._setDefaults(N),k&&N.end(k),N}}),f.prototype.del=f.prototype.delete,p.get=function(b,S,k){var N=p("GET",b);return typeof S=="function"&&(k=S,S=null),S&&N.query(S),k&&N.end(k),N},p.head=function(b,S,k){var N=p("HEAD",b);return typeof S=="function"&&(k=S,S=null),S&&N.query(S),k&&N.end(k),N},p.options=function(b,S,k){var N=p("OPTIONS",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.del=C,p.delete=C,p.patch=function(b,S,k){var N=p("PATCH",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.post=function(b,S,k){var N=p("POST",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.put=function(b,S,k){var N=p("PUT",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N}},function(e,t,n){function r(o){if(o)return function(u){for(var s in r.prototype)u[s]=r.prototype[s];return u}(o)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,u){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(u),this},r.prototype.once=function(o,u){function s(){this.off(o,s),u.apply(this,arguments)}return s.fn=u,this.on(o,s),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,u){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s,l=this._callbacks["$"+o];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var c=0;c=this._maxRetries)return!1;if(this._retryCallback)try{var f=this._retryCallback(l,c);if(f===!0)return!0;if(f===!1)return!1}catch(h){console.error(h)}return!!(c&&c.status&&c.status>=500&&c.status!=501||l&&(l.code&&~s.indexOf(l.code)||l.timeout&&l.code=="ECONNABORTED"||l.crossDomain))},u.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},u.prototype.then=function(l,c){if(!this._fullfilledPromise){var f=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(h,p){f.end(function(v,g){v?p(v):h(g)})})}return this._fullfilledPromise.then(l,c)},u.prototype.catch=function(l){return this.then(void 0,l)},u.prototype.use=function(l){return l(this),this},u.prototype.ok=function(l){if(typeof l!="function")throw Error("Callback required");return this._okCallback=l,this},u.prototype._isResponseOK=function(l){return!!l&&(this._okCallback?this._okCallback(l):l.status>=200&&l.status<300)},u.prototype.get=function(l){return this._header[l.toLowerCase()]},u.prototype.getHeader=u.prototype.get,u.prototype.set=function(l,c){if(o(l)){for(var f in l)this.set(f,l[f]);return this}return this._header[l.toLowerCase()]=c,this.header[l]=c,this},u.prototype.unset=function(l){return delete this._header[l.toLowerCase()],delete this.header[l],this},u.prototype.field=function(l,c){if(l==null)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),o(l)){for(var f in l)this.field(f,l[f]);return this}if(Array.isArray(c)){for(var h in c)this.field(l,c[h]);return this}if(c==null)throw new Error(".field(name, val) val can not be empty");return typeof c=="boolean"&&(c=""+c),this._getFormData().append(l,c),this},u.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},u.prototype._auth=function(l,c,f,h){switch(f.type){case"basic":this.set("Authorization","Basic "+h(l+":"+c));break;case"auto":this.username=l,this.password=c;break;case"bearer":this.set("Authorization","Bearer "+l)}return this},u.prototype.withCredentials=function(l){return l==null&&(l=!0),this._withCredentials=l,this},u.prototype.redirects=function(l){return this._maxRedirects=l,this},u.prototype.maxResponseSize=function(l){if(typeof l!="number")throw TypeError("Invalid argument");return this._maxResponseSize=l,this},u.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},u.prototype.send=function(l){var c=o(l),f=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),c&&!this._data)Array.isArray(l)?this._data=[]:this._isHost(l)||(this._data={});else if(l&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(c&&o(this._data))for(var h in l)this._data[h]=l[h];else typeof l=="string"?(f||this.type("form"),f=this._header["content-type"],this._data=f=="application/x-www-form-urlencoded"?this._data?this._data+"&"+l:l:(this._data||"")+l):this._data=l;return!c||this._isHost(l)||f||this.type("json"),this},u.prototype.sortQuery=function(l){return this._sort=l===void 0||l,this},u.prototype._finalizeQueryString=function(){var l=this._query.join("&");if(l&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+l),this._query.length=0,this._sort){var c=this.url.indexOf("?");if(c>=0){var f=this.url.substring(c+1).split("&");typeof this._sort=="function"?f.sort(this._sort):f.sort(),this.url=this.url.substring(0,c)+"?"+f.join("&")}}},u.prototype._appendQueryString=function(){console.trace("Unsupported")},u.prototype._timeoutError=function(l,c,f){if(!this._aborted){var h=new Error(l+c+"ms exceeded");h.timeout=c,h.code="ECONNABORTED",h.errno=f,this.timedout=!0,this.abort(),this.callback(h)}},u.prototype._setTimeouts=function(){var l=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){l._timeoutError("Timeout of ",l._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){l._timeoutError("Response timeout of ",l._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t,n){var r=n(230);function o(u){if(u)return function(s){for(var l in o.prototype)s[l]=o.prototype[l];return s}(u)}e.exports=o,o.prototype.get=function(u){return this.header[u.toLowerCase()]},o.prototype._setHeaderProperties=function(u){var s=u["content-type"]||"";this.type=r.type(s);var l=r.params(s);for(var c in l)this[c]=l[c];this.links={};try{u.link&&(this.links=r.parseLinks(u.link))}catch{}},o.prototype._setStatusProperties=function(u){var s=u/100|0;this.status=this.statusCode=u,this.statusType=s,this.info=s==1,this.ok=s==2,this.redirect=s==3,this.clientError=s==4,this.serverError=s==5,this.error=(s==4||s==5)&&this.toError(),this.created=u==201,this.accepted=u==202,this.noContent=u==204,this.badRequest=u==400,this.unauthorized=u==401,this.notAcceptable=u==406,this.forbidden=u==403,this.notFound=u==404,this.unprocessableEntity=u==422}},function(e,t,n){t.type=function(r){return r.split(/ *; */).shift()},t.params=function(r){return r.split(/ *; */).reduce(function(o,u){var s=u.split(/ *= */),l=s.shift(),c=s.shift();return l&&c&&(o[l]=c),o},{})},t.parseLinks=function(r){return r.split(/ *, */).reduce(function(o,u){var s=u.split(/ *; */),l=s[0].slice(1,-1);return o[s[1].split(/ *= */)[1].slice(1,-1)]=l,o},{})},t.cleanHeader=function(r,o){return delete r["content-type"],delete r["content-length"],delete r["transfer-encoding"],delete r.host,o&&(delete r.authorization,delete r.cookie),r}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(r){n.prototype[r]=function(){return this._defaults.push({fn:r,arguments}),this}}),n.prototype._setDefaults=function(r){this._defaults.forEach(function(o){r[o.fn].apply(r,o.arguments)})},e.exports=n},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,u=Function.prototype.apply;function s(l,c){this._id=l,this._clearFn=c}t.setTimeout=function(){return new s(u.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new s(u.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(l){l&&l.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(l,c){clearTimeout(l._idleTimeoutId),l._idleTimeout=c},t.unenroll=function(l){clearTimeout(l._idleTimeoutId),l._idleTimeout=-1},t._unrefActive=t.active=function(l){clearTimeout(l._idleTimeoutId);var c=l._idleTimeout;c>=0&&(l._idleTimeoutId=setTimeout(function(){l._onTimeout&&l._onTimeout()},c))},n(233),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(e,t,n){(function(r,o){(function(u,s){if(!u.setImmediate){var l,c,f,h,p,v=1,g={},E=!1,_=u.document,O=Object.getPrototypeOf&&Object.getPrototypeOf(u);O=O&&O.setTimeout?O:u,{}.toString.call(u.process)==="[object process]"?l=function(C){o.nextTick(function(){w(C)})}:function(){if(u.postMessage&&!u.importScripts){var C=!0,b=u.onmessage;return u.onmessage=function(){C=!1},u.postMessage("","*"),u.onmessage=b,C}}()?(h="setImmediate$"+Math.random()+"$",p=function(C){C.source===u&&typeof C.data=="string"&&C.data.indexOf(h)===0&&w(+C.data.slice(h.length))},u.addEventListener?u.addEventListener("message",p,!1):u.attachEvent("onmessage",p),l=function(C){u.postMessage(h+C,"*")}):u.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){w(C.data)},l=function(C){f.port2.postMessage(C)}):_&&"onreadystatechange"in _.createElement("script")?(c=_.documentElement,l=function(C){var b=_.createElement("script");b.onreadystatechange=function(){w(C),b.onreadystatechange=null,c.removeChild(b),b=null},c.appendChild(b)}):l=function(C){setTimeout(w,0,C)},O.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var b=new Array(arguments.length-1),S=0;S"u"?r===void 0?this:r:self)}).call(this,n(11),n(13))},function(e,t,n){t.decode=t.parse=n(235),t.encode=t.stringify=n(236)},function(e,t,n){function r(u,s){return Object.prototype.hasOwnProperty.call(u,s)}e.exports=function(u,s,l,c){s=s||"&",l=l||"=";var f={};if(typeof u!="string"||u.length===0)return f;var h=/\+/g;u=u.split(s);var p=1e3;c&&typeof c.maxKeys=="number"&&(p=c.maxKeys);var v=u.length;p>0&&v>p&&(v=p);for(var g=0;g=0?(E=w.substr(0,C),_=w.substr(C+1)):(E=w,_=""),O=decodeURIComponent(E),y=decodeURIComponent(_),r(f,O)?o(f[O])?f[O].push(y):f[O]=[f[O],y]:f[O]=y}return f};var o=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"}},function(e,t,n){function r(c){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(c)}var o=function(c){switch(r(c)){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};e.exports=function(c,f,h,p){return f=f||"&",h=h||"=",c===null&&(c=void 0),r(c)==="object"?s(l(c),function(v){var g=encodeURIComponent(o(v))+h;return u(c[v])?s(c[v],function(E){return g+encodeURIComponent(o(E))}).join(f):g+encodeURIComponent(o(c[v]))}).join(f):p?encodeURIComponent(o(p))+h+encodeURIComponent(o(c)):""};var u=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function s(c,f){if(c.map)return c.map(f);for(var h=[],p=0;p1){D[0]=D[0].slice(0,-1);for(var X=D.length-1,Y=1;Y= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,N=String.fromCharCode;function P(A){throw new RangeError(S[A])}function ee(A,D){var z=A.split("@"),X="";z.length>1&&(X=z[0]+"@",A=z[1]);var Y=function(Se,Oe){for(var Ue=[],at=Se.length;at--;)Ue[at]=Oe(Se[at]);return Ue}((A=A.replace(b,".")).split("."),D).join(".");return X+Y}function L(A){for(var D=[],z=0,X=A.length;z=55296&&Y<=56319&&z>1,A+=k(A/D);A>455;X+=36)A=k(A/35);return k(X+36*A/(A+38))},me=function(A){var D,z=[],X=A.length,Y=0,Se=128,Oe=72,Ue=A.lastIndexOf("-");Ue<0&&(Ue=0);for(var at=0;at=128&&P("not-basic"),z.push(A.charCodeAt(at));for(var je=Ue>0?Ue+1:0;je=X&&P("invalid-input");var dt=(D=A.charCodeAt(je++))-48<10?D-22:D-65<26?D-65:D-97<26?D-97:36;(dt>=36||dt>k((y-Y)/st))&&P("overflow"),Y+=dt*st;var qt=Lt<=Oe?1:Lt>=Oe+26?26:Lt-Oe;if(dtk(y/gt)&&P("overflow"),st*=gt}var Gt=z.length+1;Oe=V(Y-lt,Gt,lt==0),k(Y/Gt)>y-Se&&P("overflow"),Se+=k(Y/Gt),Y%=Gt,z.splice(Y++,0,Se)}return String.fromCodePoint.apply(String,z)},G=function(A){var D=[],z=(A=L(A)).length,X=128,Y=0,Se=72,Oe=!0,Ue=!1,at=void 0;try{for(var je,lt=A[Symbol.iterator]();!(Oe=(je=lt.next()).done);Oe=!0){var st=je.value;st<128&&D.push(N(st))}}catch(kt){Ue=!0,at=kt}finally{try{!Oe&<.return&<.return()}finally{if(Ue)throw at}}var Lt=D.length,dt=Lt;for(Lt&&D.push("-");dt=X&&crk((y-Y)/bn)&&P("overflow"),Y+=(qt-X)*bn,X=qt;var Gn=!0,Vo=!1,Ir=void 0;try{for(var Ws,pt=A[Symbol.iterator]();!(Gn=(Ws=pt.next()).done);Gn=!0){var ht=Ws.value;if(hty&&P("overflow"),ht==X){for(var Ci=Y,bi=36;;bi+=36){var Si=bi<=Se?1:bi>=Se+26?26:bi-Se;if(Ci>6|192).toString(16).toUpperCase()+"%"+(63&D|128).toString(16).toUpperCase():"%"+(D>>12|224).toString(16).toUpperCase()+"%"+(D>>6&63|128).toString(16).toUpperCase()+"%"+(63&D|128).toString(16).toUpperCase()}function Z(A){for(var D="",z=0,X=A.length;z=194&&Y<224){if(X-z>=6){var Se=parseInt(A.substr(z+4,2),16);D+=String.fromCharCode((31&Y)<<6|63&Se)}else D+=A.substr(z,6);z+=6}else if(Y>=224){if(X-z>=9){var Oe=parseInt(A.substr(z+4,2),16),Ue=parseInt(A.substr(z+7,2),16);D+=String.fromCharCode((15&Y)<<12|(63&Oe)<<6|63&Ue)}else D+=A.substr(z,9);z+=9}else D+=A.substr(z,3),z+=3}return D}function ae(A,D){function z(X){var Y=Z(X);return Y.match(D.UNRESERVED)?Y:X}return A.scheme&&(A.scheme=String(A.scheme).replace(D.PCT_ENCODED,z).toLowerCase().replace(D.NOT_SCHEME,"")),A.userinfo!==void 0&&(A.userinfo=String(A.userinfo).replace(D.PCT_ENCODED,z).replace(D.NOT_USERINFO,U).replace(D.PCT_ENCODED,v)),A.host!==void 0&&(A.host=String(A.host).replace(D.PCT_ENCODED,z).toLowerCase().replace(D.NOT_HOST,U).replace(D.PCT_ENCODED,v)),A.path!==void 0&&(A.path=String(A.path).replace(D.PCT_ENCODED,z).replace(A.scheme?D.NOT_PATH:D.NOT_PATH_NOSCHEME,U).replace(D.PCT_ENCODED,v)),A.query!==void 0&&(A.query=String(A.query).replace(D.PCT_ENCODED,z).replace(D.NOT_QUERY,U).replace(D.PCT_ENCODED,v)),A.fragment!==void 0&&(A.fragment=String(A.fragment).replace(D.PCT_ENCODED,z).replace(D.NOT_FRAGMENT,U).replace(D.PCT_ENCODED,v)),A}function I(A){return A.replace(/^0*(.*)/,"$1")||"0"}function F(A,D){var z=A.match(D.IPV4ADDRESS)||[],X=O(z,2)[1];return X?X.split(".").map(I).join("."):A}function se(A,D){var z=A.match(D.IPV6ADDRESS)||[],X=O(z,3),Y=X[1],Se=X[2];if(Y){for(var Oe=Y.toLowerCase().split("::").reverse(),Ue=O(Oe,2),at=Ue[0],je=Ue[1],lt=je?je.split(":").map(I):[],st=at.split(":").map(I),Lt=D.IPV4ADDRESS.test(st[st.length-1]),dt=Lt?7:8,qt=st.length-dt,gt=Array(dt),Gt=0;Gt1){var Dr=gt.slice(0,qn.index),cr=gt.slice(qn.index+qn.length);lr=Dr.join(":")+"::"+cr.join(":")}else lr=gt.join(":");return Se&&(lr+="%"+Se),lr}return A}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ie="".match(/(){0}/)[1]===void 0;function le(A){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z={},X=D.iri!==!1?_:E;D.reference==="suffix"&&(A=(D.scheme?D.scheme+":":"")+"//"+A);var Y=A.match(W);if(Y){ie?(z.scheme=Y[1],z.userinfo=Y[3],z.host=Y[4],z.port=parseInt(Y[5],10),z.path=Y[6]||"",z.query=Y[7],z.fragment=Y[8],isNaN(z.port)&&(z.port=Y[5])):(z.scheme=Y[1]||void 0,z.userinfo=A.indexOf("@")!==-1?Y[3]:void 0,z.host=A.indexOf("//")!==-1?Y[4]:void 0,z.port=parseInt(Y[5],10),z.path=Y[6]||"",z.query=A.indexOf("?")!==-1?Y[7]:void 0,z.fragment=A.indexOf("#")!==-1?Y[8]:void 0,isNaN(z.port)&&(z.port=A.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?Y[4]:void 0)),z.host&&(z.host=se(F(z.host,X),X)),z.scheme!==void 0||z.userinfo!==void 0||z.host!==void 0||z.port!==void 0||z.path||z.query!==void 0?z.scheme===void 0?z.reference="relative":z.fragment===void 0?z.reference="absolute":z.reference="uri":z.reference="same-document",D.reference&&D.reference!=="suffix"&&D.reference!==z.reference&&(z.error=z.error||"URI is not a "+D.reference+" reference.");var Se=ue[(D.scheme||z.scheme||"").toLowerCase()];if(D.unicodeSupport||Se&&Se.unicodeSupport)ae(z,X);else{if(z.host&&(D.domainHost||Se&&Se.domainHost))try{z.host=K(z.host.replace(X.PCT_ENCODED,Z).toLowerCase())}catch(Oe){z.error=z.error||"Host's domain name can not be converted to ASCII via punycode: "+Oe}ae(z,E)}Se&&Se.parse&&Se.parse(z,D)}else z.error=z.error||"URI can not be parsed.";return z}function ge(A,D){var z=D.iri!==!1?_:E,X=[];return A.userinfo!==void 0&&(X.push(A.userinfo),X.push("@")),A.host!==void 0&&X.push(se(F(String(A.host),z),z).replace(z.IPV6ADDRESS,function(Y,Se,Oe){return"["+Se+(Oe?"%25"+Oe:"")+"]"})),typeof A.port=="number"&&(X.push(":"),X.push(A.port.toString(10))),X.length?X.join(""):void 0}var Te=/^\.\.?\//,Ve=/^\/\.(\/|$)/,He=/^\/\.\.(\/|$)/,Ze=/^\/?(?:.|\n)*?(?=\/|$)/;function pe(A){for(var D=[];A.length;)if(A.match(Te))A=A.replace(Te,"");else if(A.match(Ve))A=A.replace(Ve,"/");else if(A.match(He))A=A.replace(He,"/"),D.pop();else if(A==="."||A==="..")A="";else{var z=A.match(Ze);if(!z)throw new Error("Unexpected dot segment condition");var X=z[0];A=A.slice(X.length),D.push(X)}return D.join("")}function we(A){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=D.iri?_:E,X=[],Y=ue[(D.scheme||A.scheme||"").toLowerCase()];if(Y&&Y.serialize&&Y.serialize(A,D),A.host&&!z.IPV6ADDRESS.test(A.host)){if(D.domainHost||Y&&Y.domainHost)try{A.host=D.iri?Q(A.host):K(A.host.replace(z.PCT_ENCODED,Z).toLowerCase())}catch(Ue){A.error=A.error||"Host's domain name can not be converted to "+(D.iri?"Unicode":"ASCII")+" via punycode: "+Ue}}ae(A,z),D.reference!=="suffix"&&A.scheme&&(X.push(A.scheme),X.push(":"));var Se=ge(A,D);if(Se!==void 0&&(D.reference!=="suffix"&&X.push("//"),X.push(Se),A.path&&A.path.charAt(0)!=="/"&&X.push("/")),A.path!==void 0){var Oe=A.path;D.absolutePath||Y&&Y.absolutePath||(Oe=pe(Oe)),Se===void 0&&(Oe=Oe.replace(/^\/\//,"/%2F")),X.push(Oe)}return A.query!==void 0&&(X.push("?"),X.push(A.query)),A.fragment!==void 0&&(X.push("#"),X.push(A.fragment)),X.join("")}function Me(A,D){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},X=arguments[3],Y={};return X||(A=le(we(A,z),z),D=le(we(D,z),z)),!(z=z||{}).tolerant&&D.scheme?(Y.scheme=D.scheme,Y.userinfo=D.userinfo,Y.host=D.host,Y.port=D.port,Y.path=pe(D.path||""),Y.query=D.query):(D.userinfo!==void 0||D.host!==void 0||D.port!==void 0?(Y.userinfo=D.userinfo,Y.host=D.host,Y.port=D.port,Y.path=pe(D.path||""),Y.query=D.query):(D.path?(D.path.charAt(0)==="/"?Y.path=pe(D.path):(A.userinfo===void 0&&A.host===void 0&&A.port===void 0||A.path?A.path?Y.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+D.path:Y.path=D.path:Y.path="/"+D.path,Y.path=pe(Y.path)),Y.query=D.query):(Y.path=A.path,D.query!==void 0?Y.query=D.query:Y.query=A.query),Y.userinfo=A.userinfo,Y.host=A.host,Y.port=A.port),Y.scheme=A.scheme),Y.fragment=D.fragment,Y}function _e(A,D){return A&&A.toString().replace(D&&D.iri?_.PCT_ENCODED:E.PCT_ENCODED,Z)}var ze={scheme:"http",domainHost:!0,parse:function(A,D){return A.host||(A.error=A.error||"HTTP URIs must have a host."),A},serialize:function(A,D){return A.port!==(String(A.scheme).toLowerCase()!=="https"?80:443)&&A.port!==""||(A.port=void 0),A.path||(A.path="/"),A}},tt={scheme:"https",domainHost:ze.domainHost,parse:ze.parse,serialize:ze.serialize},Ye={},Ke="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",nt="[0-9A-Fa-f]",ft=h(h("%[EFef][0-9A-Fa-f]%"+nt+nt+"%"+nt+nt)+"|"+h("%[89A-Fa-f][0-9A-Fa-f]%"+nt+nt)+"|"+h("%"+nt+nt)),Ne=f("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Wt=new RegExp(Ke,"g"),rt=new RegExp(ft,"g"),Vt=new RegExp(f("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Ne),"g"),Cn=new RegExp(f("[^]",Ke,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Wo=Cn;function Ae(A){var D=Z(A);return D.match(Wt)?D:A}var Be={scheme:"mailto",parse:function(A,D){var z=A,X=z.to=z.path?z.path.split(","):[];if(z.path=void 0,z.query){for(var Y=!1,Se={},Oe=z.query.split("&"),Ue=0,at=Oe.length;Uet.resolved)}const oc=e=>typeof e=="object"&&e!==null&&e.toString()==={}.toString(),Pc=e=>JSON.parse(JSON.stringify(e)),Q1=(e,t)=>{e=Pc(e);for(const n in t)if(t.hasOwnProperty(n)){const r=t[n],o=e[n];oc(r)&&oc(o)?e[n]=Q1(o,r):e[n]=r}return e},G2=function(e,t){const n=e.replace(/^#\/definitions\//,"").split("/"),r=function(u,s){const l=u.shift();return l?s[l]?u.length?r(u,s[l]):s[l]:{}:{}},o=r(n,t);return oc(o)?Pc(o):o},I_=function(e,t){const n=e.length;let r=-1,o={};for(;++r{if(typeof e.default<"u")return e.default;if(typeof e.allOf<"u"){const n=I_(e.allOf,t);return Wi(n,t)}else if(typeof e.$ref<"u"){const n=G2(e.$ref,t);return Wi(n,t)}else if(e.type==="object"){if(!e.properties)return{};for(const n in e.properties)e.properties.hasOwnProperty(n)&&(e.properties[n]=Wi(e.properties[n],t),typeof e.properties[n]>"u"&&delete e.properties[n]);return e.properties}else if(e.type==="array"){if(!e.items)return[];const n=e.minItems||0;if(e.items.constructor===Array){const o=e.items.map(u=>Wi(u,t));for(let u=o.length-1;u>=0&&!(typeof o[u]<"u");u--)u+1>n&&o.pop();return o.every(u=>typeof u>"u")?void 0:o}const r=Wi(e.items,t);if(typeof r>"u")return[];{const o=[];for(let u=0;u"u"?t=e.definitions||{}:oc(e.definitions)&&(t=Q1(t,e.definitions)),Wi(Pc(e),t)}function L_(){return Bs(["/feedback"],async()=>window.FEEDBACK_ENABLED?window.FEEDBACK_ENABLED==="true":(await fetch(Ei("/feedback"),{method:"HEAD"})).ok)}function M_(){return Bs(["/public_trace_link"],async()=>window.PUBLIC_TRACE_LINK_ENABLED?window.PUBLIC_TRACE_LINK_ENABLED==="true":(await fetch(Ei("/public_trace_link"),{method:"HEAD"})).ok)}function z_(e){return Bs(["/input_schema",e],async([,t])=>{const n=t?`/c/${Oc.compressToEncodedURIComponent(JSON.stringify(t))}`:"";let r=null;if(!n&&window.INPUT_SCHEMA)r=await rc(window.INPUT_SCHEMA);else{const o=await fetch(Ei(`${n}/input_schema`));if(!o.ok)throw new Error(await o.text());const u=await o.json();r=await rc(u)}return r==null?null:{schema:r,defaults:Q2(r)}},{keepPreviousData:!0})}function U_(e){return Bs(["/output_schema",e],async([,t])=>{const n=t?`/c/${Oc.compressToEncodedURIComponent(JSON.stringify(t))}`:"";let r=null;if(!n&&window.OUTPUT_SCHEMA)r=await rc(window.OUTPUT_SCHEMA);else{const o=await fetch(Ei(`${n}/output_schema`));if(!o.ok)throw new Error(await o.text());const u=await o.json();r=await rc(u)}return r==null?null:{schema:r,defaults:Q2(r)}},{keepPreviousData:!0})}function F_(e){return e!=null&&typeof e.content=="string"&&["AIMessageChunk","AIMessage"].includes(e.type)}function H_(e){const{startStream:t,messagesInputKey:n,inputKey:r}=e,[o,u]=$.useState(""),[s,l]=$.useState(!1),[c,f]=$.useState([]),h=$.useRef(null),p=L_(),v=M_(),g=()=>{const _=o;if(_.length===0||s)return;l(!0);const O=[...c,{type:"human",content:_}];f(O),u(""),r===void 0?t({[n]:O},{}):(console.log({[n]:O.slice(0,-1),[r]:O[O.length-1].content}),t({[n]:O.slice(0,-1),[r]:O[O.length-1].content},{}))},E=()=>{s||(l(!0),r===void 0?t({[n]:c},{}):t({[n]:c.slice(0,-1),[r]:c[c.length-1]},{}))};return pl("onStart",()=>{f(_=>[..._,{type:"ai",content:""}])}),pl("onChunk",(_,O)=>{const y=O==null?void 0:O.final_output;typeof y=="string"?f(w=>[...w.slice(0,-1),{type:"ai",content:y,runId:O==null?void 0:O.id}]):F_(y)&&f(w=>[...w.slice(0,-1),{type:"ai",content:y.content,runId:O==null?void 0:O.id}])}),pl("onSuccess",()=>{l(!1)}),pl("onError",_=>{var O;l(!1),wt(_.message+` +Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.`);b.crossDomain=!0,b.status=this.status,b.method=this.method,b.url=this.url,this.callback(b)},w.prototype.buffer=w.prototype.ca=w.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},w.prototype.pipe=w.prototype.write=function(){throw Error("Streaming is not supported in browser version of superagent")},w.prototype._isHost=function(b){return b&&r(b)==="object"&&!Array.isArray(b)&&Object.prototype.toString.call(b)!=="[object Object]"},w.prototype.end=function(b){return this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=b||h,this._finalizeQueryString(),this._end()},w.prototype._end=function(){var b=this,S=this.xhr=p.getXHR(),k=this._formData||this._data;this._setTimeouts(),S.onreadystatechange=function(){var H=S.readyState;if(H>=2&&b._responseTimeoutTimer&&clearTimeout(b._responseTimeoutTimer),H==4){var V;try{V=S.status}catch{V=0}if(!V)return b.timedout||b._aborted?void 0:b.crossDomainError();b.emit("end")}};var N=function(H,V){V.total>0&&(V.percent=V.loaded/V.total*100),V.direction=H,b.emit("progress",V)};if(this.hasListeners("progress"))try{S.onprogress=N.bind(null,"download"),S.upload&&(S.upload.onprogress=N.bind(null,"upload"))}catch{}try{this.username&&this.password?S.open(this.method,this.url,!0,this.username,this.password):S.open(this.method,this.url,!0)}catch(H){return this.callback(H)}if(this._withCredentials&&(S.withCredentials=!0),!this._formData&&this.method!="GET"&&this.method!="HEAD"&&typeof k!="string"&&!this._isHost(k)){var P=this._header["content-type"],ee=this._serializer||p.serialize[P?P.split(";")[0]:""];!ee&&O(P)&&(ee=p.serialize["application/json"]),ee&&(k=ee(k))}for(var L in this.header)this.header[L]!=null&&this.header.hasOwnProperty(L)&&S.setRequestHeader(L,this.header[L]);return this._responseType&&(S.responseType=this._responseType),this.emit("request",this),S.send(k!==void 0?k:null),this},p.agent=function(){return new f},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach(function(b){f.prototype[b.toLowerCase()]=function(S,k){var N=new p.Request(b,S);return this._setDefaults(N),k&&N.end(k),N}}),f.prototype.del=f.prototype.delete,p.get=function(b,S,k){var N=p("GET",b);return typeof S=="function"&&(k=S,S=null),S&&N.query(S),k&&N.end(k),N},p.head=function(b,S,k){var N=p("HEAD",b);return typeof S=="function"&&(k=S,S=null),S&&N.query(S),k&&N.end(k),N},p.options=function(b,S,k){var N=p("OPTIONS",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.del=C,p.delete=C,p.patch=function(b,S,k){var N=p("PATCH",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.post=function(b,S,k){var N=p("POST",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N},p.put=function(b,S,k){var N=p("PUT",b);return typeof S=="function"&&(k=S,S=null),S&&N.send(S),k&&N.end(k),N}},function(e,t,n){function r(o){if(o)return function(u){for(var s in r.prototype)u[s]=r.prototype[s];return u}(o)}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(o,u){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(u),this},r.prototype.once=function(o,u){function s(){this.off(o,s),u.apply(this,arguments)}return s.fn=u,this.on(o,s),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(o,u){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var s,l=this._callbacks["$"+o];if(!l)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var c=0;c=this._maxRetries)return!1;if(this._retryCallback)try{var f=this._retryCallback(l,c);if(f===!0)return!0;if(f===!1)return!1}catch(h){console.error(h)}return!!(c&&c.status&&c.status>=500&&c.status!=501||l&&(l.code&&~s.indexOf(l.code)||l.timeout&&l.code=="ECONNABORTED"||l.crossDomain))},u.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this._end()},u.prototype.then=function(l,c){if(!this._fullfilledPromise){var f=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise(function(h,p){f.end(function(v,g){v?p(v):h(g)})})}return this._fullfilledPromise.then(l,c)},u.prototype.catch=function(l){return this.then(void 0,l)},u.prototype.use=function(l){return l(this),this},u.prototype.ok=function(l){if(typeof l!="function")throw Error("Callback required");return this._okCallback=l,this},u.prototype._isResponseOK=function(l){return!!l&&(this._okCallback?this._okCallback(l):l.status>=200&&l.status<300)},u.prototype.get=function(l){return this._header[l.toLowerCase()]},u.prototype.getHeader=u.prototype.get,u.prototype.set=function(l,c){if(o(l)){for(var f in l)this.set(f,l[f]);return this}return this._header[l.toLowerCase()]=c,this.header[l]=c,this},u.prototype.unset=function(l){return delete this._header[l.toLowerCase()],delete this.header[l],this},u.prototype.field=function(l,c){if(l==null)throw new Error(".field(name, val) name can not be empty");if(this._data&&console.error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()"),o(l)){for(var f in l)this.field(f,l[f]);return this}if(Array.isArray(c)){for(var h in c)this.field(l,c[h]);return this}if(c==null)throw new Error(".field(name, val) val can not be empty");return typeof c=="boolean"&&(c=""+c),this._getFormData().append(l,c),this},u.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},u.prototype._auth=function(l,c,f,h){switch(f.type){case"basic":this.set("Authorization","Basic "+h(l+":"+c));break;case"auto":this.username=l,this.password=c;break;case"bearer":this.set("Authorization","Bearer "+l)}return this},u.prototype.withCredentials=function(l){return l==null&&(l=!0),this._withCredentials=l,this},u.prototype.redirects=function(l){return this._maxRedirects=l,this},u.prototype.maxResponseSize=function(l){if(typeof l!="number")throw TypeError("Invalid argument");return this._maxResponseSize=l,this},u.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},u.prototype.send=function(l){var c=o(l),f=this._header["content-type"];if(this._formData&&console.error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()"),c&&!this._data)Array.isArray(l)?this._data=[]:this._isHost(l)||(this._data={});else if(l&&this._data&&this._isHost(this._data))throw Error("Can't merge these send calls");if(c&&o(this._data))for(var h in l)this._data[h]=l[h];else typeof l=="string"?(f||this.type("form"),f=this._header["content-type"],this._data=f=="application/x-www-form-urlencoded"?this._data?this._data+"&"+l:l:(this._data||"")+l):this._data=l;return!c||this._isHost(l)||f||this.type("json"),this},u.prototype.sortQuery=function(l){return this._sort=l===void 0||l,this},u.prototype._finalizeQueryString=function(){var l=this._query.join("&");if(l&&(this.url+=(this.url.indexOf("?")>=0?"&":"?")+l),this._query.length=0,this._sort){var c=this.url.indexOf("?");if(c>=0){var f=this.url.substring(c+1).split("&");typeof this._sort=="function"?f.sort(this._sort):f.sort(),this.url=this.url.substring(0,c)+"?"+f.join("&")}}},u.prototype._appendQueryString=function(){console.trace("Unsupported")},u.prototype._timeoutError=function(l,c,f){if(!this._aborted){var h=new Error(l+c+"ms exceeded");h.timeout=c,h.code="ECONNABORTED",h.errno=f,this.timedout=!0,this.abort(),this.callback(h)}},u.prototype._setTimeouts=function(){var l=this;this._timeout&&!this._timer&&(this._timer=setTimeout(function(){l._timeoutError("Timeout of ",l._timeout,"ETIME")},this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout(function(){l._timeoutError("Response timeout of ",l._responseTimeout,"ETIMEDOUT")},this._responseTimeout))}},function(e,t,n){var r=n(230);function o(u){if(u)return function(s){for(var l in o.prototype)s[l]=o.prototype[l];return s}(u)}e.exports=o,o.prototype.get=function(u){return this.header[u.toLowerCase()]},o.prototype._setHeaderProperties=function(u){var s=u["content-type"]||"";this.type=r.type(s);var l=r.params(s);for(var c in l)this[c]=l[c];this.links={};try{u.link&&(this.links=r.parseLinks(u.link))}catch{}},o.prototype._setStatusProperties=function(u){var s=u/100|0;this.status=this.statusCode=u,this.statusType=s,this.info=s==1,this.ok=s==2,this.redirect=s==3,this.clientError=s==4,this.serverError=s==5,this.error=(s==4||s==5)&&this.toError(),this.created=u==201,this.accepted=u==202,this.noContent=u==204,this.badRequest=u==400,this.unauthorized=u==401,this.notAcceptable=u==406,this.forbidden=u==403,this.notFound=u==404,this.unprocessableEntity=u==422}},function(e,t,n){t.type=function(r){return r.split(/ *; */).shift()},t.params=function(r){return r.split(/ *; */).reduce(function(o,u){var s=u.split(/ *= */),l=s.shift(),c=s.shift();return l&&c&&(o[l]=c),o},{})},t.parseLinks=function(r){return r.split(/ *, */).reduce(function(o,u){var s=u.split(/ *; */),l=s[0].slice(1,-1);return o[s[1].split(/ *= */)[1].slice(1,-1)]=l,o},{})},t.cleanHeader=function(r,o){return delete r["content-type"],delete r["content-length"],delete r["transfer-encoding"],delete r.host,o&&(delete r.authorization,delete r.cookie),r}},function(e,t){function n(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert"].forEach(function(r){n.prototype[r]=function(){return this._defaults.push({fn:r,arguments}),this}}),n.prototype._setDefaults=function(r){this._defaults.forEach(function(o){r[o.fn].apply(r,o.arguments)})},e.exports=n},function(e,t,n){(function(r){var o=r!==void 0&&r||typeof self<"u"&&self||window,u=Function.prototype.apply;function s(l,c){this._id=l,this._clearFn=c}t.setTimeout=function(){return new s(u.call(setTimeout,o,arguments),clearTimeout)},t.setInterval=function(){return new s(u.call(setInterval,o,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(l){l&&l.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(o,this._id)},t.enroll=function(l,c){clearTimeout(l._idleTimeoutId),l._idleTimeout=c},t.unenroll=function(l){clearTimeout(l._idleTimeoutId),l._idleTimeout=-1},t._unrefActive=t.active=function(l){clearTimeout(l._idleTimeoutId);var c=l._idleTimeout;c>=0&&(l._idleTimeoutId=setTimeout(function(){l._onTimeout&&l._onTimeout()},c))},n(233),t.setImmediate=typeof self<"u"&&self.setImmediate||r!==void 0&&r.setImmediate||this&&this.setImmediate,t.clearImmediate=typeof self<"u"&&self.clearImmediate||r!==void 0&&r.clearImmediate||this&&this.clearImmediate}).call(this,n(11))},function(e,t,n){(function(r,o){(function(u,s){if(!u.setImmediate){var l,c,f,h,p,v=1,g={},E=!1,_=u.document,O=Object.getPrototypeOf&&Object.getPrototypeOf(u);O=O&&O.setTimeout?O:u,{}.toString.call(u.process)==="[object process]"?l=function(C){o.nextTick(function(){w(C)})}:function(){if(u.postMessage&&!u.importScripts){var C=!0,b=u.onmessage;return u.onmessage=function(){C=!1},u.postMessage("","*"),u.onmessage=b,C}}()?(h="setImmediate$"+Math.random()+"$",p=function(C){C.source===u&&typeof C.data=="string"&&C.data.indexOf(h)===0&&w(+C.data.slice(h.length))},u.addEventListener?u.addEventListener("message",p,!1):u.attachEvent("onmessage",p),l=function(C){u.postMessage(h+C,"*")}):u.MessageChannel?((f=new MessageChannel).port1.onmessage=function(C){w(C.data)},l=function(C){f.port2.postMessage(C)}):_&&"onreadystatechange"in _.createElement("script")?(c=_.documentElement,l=function(C){var b=_.createElement("script");b.onreadystatechange=function(){w(C),b.onreadystatechange=null,c.removeChild(b),b=null},c.appendChild(b)}):l=function(C){setTimeout(w,0,C)},O.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var b=new Array(arguments.length-1),S=0;S"u"?r===void 0?this:r:self)}).call(this,n(11),n(13))},function(e,t,n){t.decode=t.parse=n(235),t.encode=t.stringify=n(236)},function(e,t,n){function r(u,s){return Object.prototype.hasOwnProperty.call(u,s)}e.exports=function(u,s,l,c){s=s||"&",l=l||"=";var f={};if(typeof u!="string"||u.length===0)return f;var h=/\+/g;u=u.split(s);var p=1e3;c&&typeof c.maxKeys=="number"&&(p=c.maxKeys);var v=u.length;p>0&&v>p&&(v=p);for(var g=0;g=0?(E=w.substr(0,C),_=w.substr(C+1)):(E=w,_=""),O=decodeURIComponent(E),y=decodeURIComponent(_),r(f,O)?o(f[O])?f[O].push(y):f[O]=[f[O],y]:f[O]=y}return f};var o=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"}},function(e,t,n){function r(c){return(r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f})(c)}var o=function(c){switch(r(c)){case"string":return c;case"boolean":return c?"true":"false";case"number":return isFinite(c)?c:"";default:return""}};e.exports=function(c,f,h,p){return f=f||"&",h=h||"=",c===null&&(c=void 0),r(c)==="object"?s(l(c),function(v){var g=encodeURIComponent(o(v))+h;return u(c[v])?s(c[v],function(E){return g+encodeURIComponent(o(E))}).join(f):g+encodeURIComponent(o(c[v]))}).join(f):p?encodeURIComponent(o(p))+h+encodeURIComponent(o(c)):""};var u=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"};function s(c,f){if(c.map)return c.map(f);for(var h=[],p=0;p1){D[0]=D[0].slice(0,-1);for(var X=D.length-1,Y=1;Y= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=Math.floor,N=String.fromCharCode;function P(A){throw new RangeError(S[A])}function ee(A,D){var z=A.split("@"),X="";z.length>1&&(X=z[0]+"@",A=z[1]);var Y=function(Se,Oe){for(var Ue=[],at=Se.length;at--;)Ue[at]=Oe(Se[at]);return Ue}((A=A.replace(b,".")).split("."),D).join(".");return X+Y}function L(A){for(var D=[],z=0,X=A.length;z=55296&&Y<=56319&&z>1,A+=k(A/D);A>455;X+=36)A=k(A/35);return k(X+36*A/(A+38))},me=function(A){var D,z=[],X=A.length,Y=0,Se=128,Oe=72,Ue=A.lastIndexOf("-");Ue<0&&(Ue=0);for(var at=0;at=128&&P("not-basic"),z.push(A.charCodeAt(at));for(var je=Ue>0?Ue+1:0;je=X&&P("invalid-input");var dt=(D=A.charCodeAt(je++))-48<10?D-22:D-65<26?D-65:D-97<26?D-97:36;(dt>=36||dt>k((y-Y)/st))&&P("overflow"),Y+=dt*st;var qt=Lt<=Oe?1:Lt>=Oe+26?26:Lt-Oe;if(dtk(y/gt)&&P("overflow"),st*=gt}var Gt=z.length+1;Oe=V(Y-lt,Gt,lt==0),k(Y/Gt)>y-Se&&P("overflow"),Se+=k(Y/Gt),Y%=Gt,z.splice(Y++,0,Se)}return String.fromCodePoint.apply(String,z)},G=function(A){var D=[],z=(A=L(A)).length,X=128,Y=0,Se=72,Oe=!0,Ue=!1,at=void 0;try{for(var je,lt=A[Symbol.iterator]();!(Oe=(je=lt.next()).done);Oe=!0){var st=je.value;st<128&&D.push(N(st))}}catch(kt){Ue=!0,at=kt}finally{try{!Oe&<.return&<.return()}finally{if(Ue)throw at}}var Lt=D.length,dt=Lt;for(Lt&&D.push("-");dt=X&&crk((y-Y)/bn)&&P("overflow"),Y+=(qt-X)*bn,X=qt;var Gn=!0,Vo=!1,Ir=void 0;try{for(var Ws,pt=A[Symbol.iterator]();!(Gn=(Ws=pt.next()).done);Gn=!0){var ht=Ws.value;if(hty&&P("overflow"),ht==X){for(var Ci=Y,bi=36;;bi+=36){var Si=bi<=Se?1:bi>=Se+26?26:bi-Se;if(Ci>6|192).toString(16).toUpperCase()+"%"+(63&D|128).toString(16).toUpperCase():"%"+(D>>12|224).toString(16).toUpperCase()+"%"+(D>>6&63|128).toString(16).toUpperCase()+"%"+(63&D|128).toString(16).toUpperCase()}function Z(A){for(var D="",z=0,X=A.length;z=194&&Y<224){if(X-z>=6){var Se=parseInt(A.substr(z+4,2),16);D+=String.fromCharCode((31&Y)<<6|63&Se)}else D+=A.substr(z,6);z+=6}else if(Y>=224){if(X-z>=9){var Oe=parseInt(A.substr(z+4,2),16),Ue=parseInt(A.substr(z+7,2),16);D+=String.fromCharCode((15&Y)<<12|(63&Oe)<<6|63&Ue)}else D+=A.substr(z,9);z+=9}else D+=A.substr(z,3),z+=3}return D}function ae(A,D){function z(X){var Y=Z(X);return Y.match(D.UNRESERVED)?Y:X}return A.scheme&&(A.scheme=String(A.scheme).replace(D.PCT_ENCODED,z).toLowerCase().replace(D.NOT_SCHEME,"")),A.userinfo!==void 0&&(A.userinfo=String(A.userinfo).replace(D.PCT_ENCODED,z).replace(D.NOT_USERINFO,U).replace(D.PCT_ENCODED,v)),A.host!==void 0&&(A.host=String(A.host).replace(D.PCT_ENCODED,z).toLowerCase().replace(D.NOT_HOST,U).replace(D.PCT_ENCODED,v)),A.path!==void 0&&(A.path=String(A.path).replace(D.PCT_ENCODED,z).replace(A.scheme?D.NOT_PATH:D.NOT_PATH_NOSCHEME,U).replace(D.PCT_ENCODED,v)),A.query!==void 0&&(A.query=String(A.query).replace(D.PCT_ENCODED,z).replace(D.NOT_QUERY,U).replace(D.PCT_ENCODED,v)),A.fragment!==void 0&&(A.fragment=String(A.fragment).replace(D.PCT_ENCODED,z).replace(D.NOT_FRAGMENT,U).replace(D.PCT_ENCODED,v)),A}function I(A){return A.replace(/^0*(.*)/,"$1")||"0"}function F(A,D){var z=A.match(D.IPV4ADDRESS)||[],X=O(z,2)[1];return X?X.split(".").map(I).join("."):A}function se(A,D){var z=A.match(D.IPV6ADDRESS)||[],X=O(z,3),Y=X[1],Se=X[2];if(Y){for(var Oe=Y.toLowerCase().split("::").reverse(),Ue=O(Oe,2),at=Ue[0],je=Ue[1],lt=je?je.split(":").map(I):[],st=at.split(":").map(I),Lt=D.IPV4ADDRESS.test(st[st.length-1]),dt=Lt?7:8,qt=st.length-dt,gt=Array(dt),Gt=0;Gt1){var Dr=gt.slice(0,qn.index),cr=gt.slice(qn.index+qn.length);lr=Dr.join(":")+"::"+cr.join(":")}else lr=gt.join(":");return Se&&(lr+="%"+Se),lr}return A}var W=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ie="".match(/(){0}/)[1]===void 0;function le(A){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z={},X=D.iri!==!1?_:E;D.reference==="suffix"&&(A=(D.scheme?D.scheme+":":"")+"//"+A);var Y=A.match(W);if(Y){ie?(z.scheme=Y[1],z.userinfo=Y[3],z.host=Y[4],z.port=parseInt(Y[5],10),z.path=Y[6]||"",z.query=Y[7],z.fragment=Y[8],isNaN(z.port)&&(z.port=Y[5])):(z.scheme=Y[1]||void 0,z.userinfo=A.indexOf("@")!==-1?Y[3]:void 0,z.host=A.indexOf("//")!==-1?Y[4]:void 0,z.port=parseInt(Y[5],10),z.path=Y[6]||"",z.query=A.indexOf("?")!==-1?Y[7]:void 0,z.fragment=A.indexOf("#")!==-1?Y[8]:void 0,isNaN(z.port)&&(z.port=A.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?Y[4]:void 0)),z.host&&(z.host=se(F(z.host,X),X)),z.scheme!==void 0||z.userinfo!==void 0||z.host!==void 0||z.port!==void 0||z.path||z.query!==void 0?z.scheme===void 0?z.reference="relative":z.fragment===void 0?z.reference="absolute":z.reference="uri":z.reference="same-document",D.reference&&D.reference!=="suffix"&&D.reference!==z.reference&&(z.error=z.error||"URI is not a "+D.reference+" reference.");var Se=ue[(D.scheme||z.scheme||"").toLowerCase()];if(D.unicodeSupport||Se&&Se.unicodeSupport)ae(z,X);else{if(z.host&&(D.domainHost||Se&&Se.domainHost))try{z.host=K(z.host.replace(X.PCT_ENCODED,Z).toLowerCase())}catch(Oe){z.error=z.error||"Host's domain name can not be converted to ASCII via punycode: "+Oe}ae(z,E)}Se&&Se.parse&&Se.parse(z,D)}else z.error=z.error||"URI can not be parsed.";return z}function ge(A,D){var z=D.iri!==!1?_:E,X=[];return A.userinfo!==void 0&&(X.push(A.userinfo),X.push("@")),A.host!==void 0&&X.push(se(F(String(A.host),z),z).replace(z.IPV6ADDRESS,function(Y,Se,Oe){return"["+Se+(Oe?"%25"+Oe:"")+"]"})),typeof A.port=="number"&&(X.push(":"),X.push(A.port.toString(10))),X.length?X.join(""):void 0}var Te=/^\.\.?\//,Ve=/^\/\.(\/|$)/,He=/^\/\.\.(\/|$)/,Ze=/^\/?(?:.|\n)*?(?=\/|$)/;function pe(A){for(var D=[];A.length;)if(A.match(Te))A=A.replace(Te,"");else if(A.match(Ve))A=A.replace(Ve,"/");else if(A.match(He))A=A.replace(He,"/"),D.pop();else if(A==="."||A==="..")A="";else{var z=A.match(Ze);if(!z)throw new Error("Unexpected dot segment condition");var X=z[0];A=A.slice(X.length),D.push(X)}return D.join("")}function we(A){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},z=D.iri?_:E,X=[],Y=ue[(D.scheme||A.scheme||"").toLowerCase()];if(Y&&Y.serialize&&Y.serialize(A,D),A.host&&!z.IPV6ADDRESS.test(A.host)){if(D.domainHost||Y&&Y.domainHost)try{A.host=D.iri?Q(A.host):K(A.host.replace(z.PCT_ENCODED,Z).toLowerCase())}catch(Ue){A.error=A.error||"Host's domain name can not be converted to "+(D.iri?"Unicode":"ASCII")+" via punycode: "+Ue}}ae(A,z),D.reference!=="suffix"&&A.scheme&&(X.push(A.scheme),X.push(":"));var Se=ge(A,D);if(Se!==void 0&&(D.reference!=="suffix"&&X.push("//"),X.push(Se),A.path&&A.path.charAt(0)!=="/"&&X.push("/")),A.path!==void 0){var Oe=A.path;D.absolutePath||Y&&Y.absolutePath||(Oe=pe(Oe)),Se===void 0&&(Oe=Oe.replace(/^\/\//,"/%2F")),X.push(Oe)}return A.query!==void 0&&(X.push("?"),X.push(A.query)),A.fragment!==void 0&&(X.push("#"),X.push(A.fragment)),X.join("")}function Me(A,D){var z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},X=arguments[3],Y={};return X||(A=le(we(A,z),z),D=le(we(D,z),z)),!(z=z||{}).tolerant&&D.scheme?(Y.scheme=D.scheme,Y.userinfo=D.userinfo,Y.host=D.host,Y.port=D.port,Y.path=pe(D.path||""),Y.query=D.query):(D.userinfo!==void 0||D.host!==void 0||D.port!==void 0?(Y.userinfo=D.userinfo,Y.host=D.host,Y.port=D.port,Y.path=pe(D.path||""),Y.query=D.query):(D.path?(D.path.charAt(0)==="/"?Y.path=pe(D.path):(A.userinfo===void 0&&A.host===void 0&&A.port===void 0||A.path?A.path?Y.path=A.path.slice(0,A.path.lastIndexOf("/")+1)+D.path:Y.path=D.path:Y.path="/"+D.path,Y.path=pe(Y.path)),Y.query=D.query):(Y.path=A.path,D.query!==void 0?Y.query=D.query:Y.query=A.query),Y.userinfo=A.userinfo,Y.host=A.host,Y.port=A.port),Y.scheme=A.scheme),Y.fragment=D.fragment,Y}function _e(A,D){return A&&A.toString().replace(D&&D.iri?_.PCT_ENCODED:E.PCT_ENCODED,Z)}var ze={scheme:"http",domainHost:!0,parse:function(A,D){return A.host||(A.error=A.error||"HTTP URIs must have a host."),A},serialize:function(A,D){return A.port!==(String(A.scheme).toLowerCase()!=="https"?80:443)&&A.port!==""||(A.port=void 0),A.path||(A.path="/"),A}},tt={scheme:"https",domainHost:ze.domainHost,parse:ze.parse,serialize:ze.serialize},Ye={},Ke="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",nt="[0-9A-Fa-f]",ft=h(h("%[EFef][0-9A-Fa-f]%"+nt+nt+"%"+nt+nt)+"|"+h("%[89A-Fa-f][0-9A-Fa-f]%"+nt+nt)+"|"+h("%"+nt+nt)),Ne=f("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Wt=new RegExp(Ke,"g"),rt=new RegExp(ft,"g"),Vt=new RegExp(f("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',Ne),"g"),Cn=new RegExp(f("[^]",Ke,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),Wo=Cn;function Ae(A){var D=Z(A);return D.match(Wt)?D:A}var Be={scheme:"mailto",parse:function(A,D){var z=A,X=z.to=z.path?z.path.split(","):[];if(z.path=void 0,z.query){for(var Y=!1,Se={},Oe=z.query.split("&"),Ue=0,at=Oe.length;Uet.resolved)}const oc=e=>typeof e=="object"&&e!==null&&e.toString()==={}.toString(),Pc=e=>JSON.parse(JSON.stringify(e)),Q1=(e,t)=>{e=Pc(e);for(const n in t)if(t.hasOwnProperty(n)){const r=t[n],o=e[n];oc(r)&&oc(o)?e[n]=Q1(o,r):e[n]=r}return e},G2=function(e,t){const n=e.replace(/^#\/definitions\//,"").split("/"),r=function(u,s){const l=u.shift();return l?s[l]?u.length?r(u,s[l]):s[l]:{}:{}},o=r(n,t);return oc(o)?Pc(o):o},I_=function(e,t){const n=e.length;let r=-1,o={};for(;++r{if(typeof e.default<"u")return e.default;if(typeof e.allOf<"u"){const n=I_(e.allOf,t);return Wi(n,t)}else if(typeof e.$ref<"u"){const n=G2(e.$ref,t);return Wi(n,t)}else if(e.type==="object"){if(!e.properties)return{};for(const n in e.properties)e.properties.hasOwnProperty(n)&&(e.properties[n]=Wi(e.properties[n],t),typeof e.properties[n]>"u"&&delete e.properties[n]);return e.properties}else if(e.type==="array"){if(!e.items)return[];const n=e.minItems||0;if(e.items.constructor===Array){const o=e.items.map(u=>Wi(u,t));for(let u=o.length-1;u>=0&&!(typeof o[u]<"u");u--)u+1>n&&o.pop();return o.every(u=>typeof u>"u")?void 0:o}const r=Wi(e.items,t);if(typeof r>"u")return[];{const o=[];for(let u=0;u"u"?t=e.definitions||{}:oc(e.definitions)&&(t=Q1(t,e.definitions)),Wi(Pc(e),t)}function L_(){return Bs(["/feedback"],async()=>window.FEEDBACK_ENABLED?window.FEEDBACK_ENABLED==="true":(await fetch(Ei("/feedback"),{method:"HEAD"})).ok)}function M_(){return Bs(["/public_trace_link"],async()=>window.PUBLIC_TRACE_LINK_ENABLED?window.PUBLIC_TRACE_LINK_ENABLED==="true":(await fetch(Ei("/public_trace_link"),{method:"HEAD"})).ok)}function z_(e){return Bs(["/input_schema",e],async([,t])=>{const n=t?`/c/${Oc.compressToEncodedURIComponent(JSON.stringify(t))}`:"";let r=null;if(!n&&window.INPUT_SCHEMA)r=await rc(window.INPUT_SCHEMA);else{const o=await fetch(Ei(`${n}/input_schema`));if(!o.ok)throw new Error(await o.text());const u=await o.json();r=await rc(u)}return r==null?null:{schema:r,defaults:Q2(r)}},{keepPreviousData:!0})}function U_(e){return Bs(["/output_schema",e],async([,t])=>{const n=t?`/c/${Oc.compressToEncodedURIComponent(JSON.stringify(t))}`:"";let r=null;if(!n&&window.OUTPUT_SCHEMA)r=await rc(window.OUTPUT_SCHEMA);else{const o=await fetch(Ei(`${n}/output_schema`));if(!o.ok)throw new Error(await o.text());const u=await o.json();r=await rc(u)}return r==null?null:{schema:r,defaults:Q2(r)}},{keepPreviousData:!0})}function F_(e){return e!=null&&typeof e.content=="string"&&["AIMessageChunk","AIMessage"].includes(e.type)}function H_(e){const{startStream:t,messagesInputKey:n,inputKey:r}=e,[o,u]=$.useState(""),[s,l]=$.useState(!1),[c,f]=$.useState([]),h=$.useRef(null),p=L_(),v=M_(),g=()=>{const _=o;if(_.length===0||s)return;l(!0);const O=[...c,{type:"human",content:_}];f(O),u(""),r===void 0?t({[n]:O},{}):t({[n]:O.slice(0,-1),[r]:O[O.length-1].content},{})},E=()=>{s||(l(!0),r===void 0?t({[n]:c},{}):t({[n]:c.slice(0,-1),[r]:c[c.length-1].content},{}))};return pl("onStart",()=>{f(_=>[..._,{type:"ai",content:""}])}),pl("onChunk",(_,O)=>{const y=O==null?void 0:O.final_output;typeof y=="string"?f(w=>[...w.slice(0,-1),{type:"ai",content:y,runId:O==null?void 0:O.id}]):F_(y)&&f(w=>[...w.slice(0,-1),{type:"ai",content:y.content,runId:O==null?void 0:O.id}])}),pl("onSuccess",()=>{l(!1)}),pl("onError",_=>{var O;l(!1),wt(_.message+` Check your backend logs for errors.`,{hideProgressBar:!0}),u((O=c[c.length-2])==null?void 0:O.content),f(y=>[...y.slice(0,-2)])}),ce.jsxs("div",{className:"flex flex-col h-screen w-screen",children:[ce.jsxs("nav",{className:"flex items-center justify-between p-8",children:[ce.jsxs("div",{className:"flex items-center",children:[ce.jsx(j_,{}),ce.jsx("span",{className:"ml-1",children:"Playground"})]}),ce.jsx("div",{className:"flex items-center space-x-4",children:ce.jsx($_,{config:{},children:ce.jsx("button",{type:"button",className:"px-3 py-1 border rounded-full px-8 py-2 share-button",children:ce.jsx("span",{children:"Share"})})})})]}),ce.jsx("div",{className:"flex-grow flex flex-col items-center justify-center mt-8",children:c.length>0?ce.jsx("div",{className:"flex flex-col-reverse basis-0 overflow-auto flex-re grow max-w-[640px] w-[640px]",children:c.map((_,O)=>ce.jsx(w9,{message:_,isLoading:s,onError:y=>wt(y.message,{hideProgressBar:!0}),feedbackEnabled:p.data,publicTraceLinksEnabled:v.data,isFinalMessage:O===c.length-1,onRemove:()=>f(y=>[...y.slice(0,O),...y.slice(O+1)]),onTypeChange:y=>{f(w=>[...w.slice(0,O),{..._,type:y},...w.slice(O+1)])},onChange:y=>{f(w=>[...w.slice(0,O),{..._,content:y},...w.slice(O+1)])},onRegenerate:()=>E()},O)).reverse()}):ce.jsxs("div",{className:"flex flex-col items-center justify-center",children:[ce.jsx(A_,{}),ce.jsx("h1",{className:"text-lg",children:"Start testing your application"})]})}),ce.jsx("div",{className:"m-16 mt-4 flex justify-center",children:ce.jsxs("div",{className:"flex items-center p-3 rounded-[48px] border shadow-sm max-w-[768px] grow",onClick:()=>{var _;return(_=h.current)==null?void 0:_.focus()},children:[ce.jsx(u2,{inputRef:h,className:"flex-grow mr-4 ml-8 border-none focus:ring-0 py-2 cursor-text",placeholder:"Send a message...",value:o,onChange:_=>{u(_)},onKeyDown:_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),g())}}),ce.jsx("button",{className:"flex items-center justify-center px-3 py-1 rounded-[40px] "+(s?"":o.length>0?"bg-button-green":"bg-button-green-disabled"),onClick:_=>{_.preventDefault(),g()},children:s?ce.jsx(kp,{className:"animate-spin w-5 h-5 text-background fill-background"}):ce.jsx(N_,{className:"mx-2 my-2 h-5 w-5 stroke-white"})})]})}),ce.jsx(Sp,{})]})}/*! * https://github.com/Starcounter-Jack/JSON-Patch * (c) 2017-2022 Joachim Wester diff --git a/langserve/chat_playground/dist/index.html b/langserve/chat_playground/dist/index.html index b1dd61e6..e7cfd963 100644 --- a/langserve/chat_playground/dist/index.html +++ b/langserve/chat_playground/dist/index.html @@ -5,7 +5,7 @@ Chat Playground - + diff --git a/langserve/chat_playground/src/components/ChatWindow.tsx b/langserve/chat_playground/src/components/ChatWindow.tsx index c25714f2..9ec8b547 100644 --- a/langserve/chat_playground/src/components/ChatWindow.tsx +++ b/langserve/chat_playground/src/components/ChatWindow.tsx @@ -62,10 +62,6 @@ export function ChatWindow(props: { if (inputKey === undefined) { startStream({ [messagesInputKey]: newMessages }, {}); } else { - console.log({ - [messagesInputKey]: newMessages.slice(0, -1), - [inputKey]: newMessages[newMessages.length - 1].content - }) startStream({ [messagesInputKey]: newMessages.slice(0, -1), [inputKey]: newMessages[newMessages.length - 1].content @@ -84,7 +80,7 @@ export function ChatWindow(props: { } else { startStream({ [messagesInputKey]: messages.slice(0, -1), - [inputKey]: messages[messages.length - 1] + [inputKey]: messages[messages.length - 1].content }, {}); } };