1"use strict";(self.webpackChunkflowise_ui=self.webpackChunkflowise_ui||[]).push([[1056],{21070:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(84738);const o={getAllChatflows:()=>n.A.get("/chatflows"),getSpecificChatflow:e=>n.A.get("/chatflows/".concat(e)),getSpecificChatflowFromPublicEndpoint:e=>n.A.get("/public-chatflows/".concat(e)),createNewChatflow:e=>n.A.post("/chatflows",e),updateChatflow:(e,t)=>n.A.put("/chatflows/".concat(e),t),deleteChatflow:e=>n.A.delete("/chatflows/".concat(e)),getIsChatflowStreaming:e=>n.A.get("/chatflows-streaming/".concat(e))}},84738:(e,t,a)=>{a.d(t,{A:()=>s});var n=a(74075),o=a(13706);const r=n.A.create({baseURL:"".concat(o.VY,"/api/v1"),headers:{"Content-type":"application/json"}});r.interceptors.request.use((function(e){const t=localStorage.getItem("username"),a=localStorage.getItem("password");return t&&a&&(e.auth={username:t,password:a}),e}));const s=r},77616:(e,t,a)=>{a.d(t,{A:()=>o});var n=a(72176);const o=e=>{const[t,a]=(0,n.useState)(null),[o,r]=(0,n.useState)(null),[s,i]=(0,n.useState)(!1);return{data:t,error:o,loading:s,request:async function(){i(!0);try{const t=await e(...arguments);a(t.data)}catch(t){r(t||"Unexpected Error!")}finally{i(!1)}}}}},53497:(e,t,a)=>{a.d(t,{O:()=>s});var n=a(54972),o=a(7003),r=a(94694);const s=(0,n.Ay)(o.A)((e=>{let{theme:t,color:a="primary"}=e;return{color:"white",backgroundColor:t.palette[a].main,"&:hover":{backgroundColor:t.palette[a].main,backgroundImage:"linear-gradient(rgb(0 0 0/10%) 0 0)"}}}));(0,n.Ay)(r.A)((e=>{let{theme:t,color:a="primary"}=e;return{"&.Mui-selected, &.Mui-selected:hover":{color:"white",backgroundColor:t.palette[a].main}}}))},72761:(e,t,a)=>{a.d(t,{A:()=>p});var n=a(43989),o=a(72176),r=a(42534),s=a(89611),i=a(27997),l=a(96048),c=a(41642),d=a(53497),u=a(18624),h=a(80812);const p=e=>{let{show:t,dialogProps:a,onConfirm:p}=e;const g=document.getElementById("portal"),[m,f]=(0,o.useState)(""),[x,b]=(0,o.useState)(""),v=t?(0,h.jsxs)(r.A,{onKeyUp:e=>{"Enter"===e.key&&p(m,x)},open:t,fullWidth:!0,maxWidth:"xs","aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[(0,h.jsx)(s.A,{sx:{fontSize:"1rem"},id:"alert-dialog-title",children:a.title}),(0,h.jsxs)(i.A,{children:[(0,h.jsx)(l.A,{children:"Username"}),(0,h.jsx)(u.p,{inputParam:{label:"Username",name:"username",type:"string",placeholder:"john doe"},onChange:e=>f(e),value:m,showDialog:!1}),(0,h.jsx)("div",{style:{marginTop:20}}),(0,h.jsx)(l.A,{children:"Password"}),(0,h.jsx)(u.p,{inputParam:{label:"Password",name:"password",type:"password"},onChange:e=>b(e),value:x})]}),(0,h.jsx)(c.A,{children:(0,h.jsx)(d.O,{variant:"contained",onClick:()=>p(m,x),children:a.confirmButtonName})})]}):null;return(0,n.createPortal)(v,g)}},18624:(e,t,a)=>{a.d(t,{p:()=>u});var n=a(72176),o=a(53124),r=a(31472),s=a(71987),i=a(86681),l=a(98747),c=a(91597),d=a(80812);const u=e=>{var t,a,u,h;let{inputParam:p,value:g,nodes:m,edges:f,nodeId:x,onChange:b,disabled:v=!1}=e;const[w,y]=(0,n.useState)(null!==g&&void 0!==g?g:""),[j,A]=(0,n.use
1State)(null),[C,S]=(0,n.useState)([]),k=(0,n.useRef)(null),I=Boolean(j),E=()=>{A(null)},P=e=>{switch(e){case"string":default:return"text";case"password":return"password";case"number":return"number"}};return(0,n.useEffect)((()=>{if(!v&&m&&f&&x&&p){const e=null!==p&&void 0!==p&&p.acceptVariable?(0,c.Qs)(m,f,x,p.id):[];S(e)}}),[v,p,m,f,x]),(0,n.useEffect)((()=>{"string"===typeof w&&w&&w.endsWith("{{")&&A(k.current)}),[w]),(0,d.jsxs)(d.Fragment,{children:["note"===p.name?(0,d.jsx)(o.A,{sx:{width:"100%",height:"auto"},size:"small",children:(0,d.jsx)(r.Ay,{id:x,size:"small",disabled:v,type:P(p.type),placeholder:p.placeholder,multiline:!!p.rows,minRows:null!==(t=p.rows)&&void 0!==t?t:1,value:w,name:p.name,onChange:e=>{y(e.target.value),b(e.target.value)},inputProps:{step:null!==(a=p.step)&&void 0!==a?a:1,style:{border:"none",background:"none",color:"#212121"}},sx:{border:"none",background:"none",padding:"10px 14px",textarea:{"&::placeholder":{color:"#616161"}}}})}):(0,d.jsx)(o.A,{sx:{mt:1,width:"100%"},size:"small",children:(0,d.jsx)(s.A,{id:p.name,size:"small",disabled:v,type:P(p.type),placeholder:p.placeholder,multiline:!!p.rows,rows:null!==(u=p.rows)&&void 0!==u?u:1,value:w,name:p.name,onChange:e=>{y(e.target.value),b(e.target.value)},inputProps:{step:null!==(h=p.step)&&void 0!==h?h:1,style:{height:p.rows?"90px":"inherit"}}})}),(0,d.jsx)("div",{ref:k}),(null===p||void 0===p?void 0:p.acceptVariable)&&(0,d.jsx)(i.Ay,{open:I,anchorEl:j,onClose:E,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:(0,d.jsx)(l.A,{disabled:v,availableNodesForVariable:C,onSelectAndReturnVal:e=>{(e=>{const t=w+e.substring(2);b(t),y(t)})(e),E()}})})]})}},98747:(e,t,a)=>{a.d(t,{A:()=>b});var n=a(84139),o=a(39806),r=a(96048),s=a(92683),i=a(64124),l=a(61495),c=a(70824),d=a(50962),u=a(32285),h=a(40947),p=a.n(h),g=a(9363);const m=a.p+"static/media/chathistory.c04a95d8006f2ac86a7d.png";var f=a(13706),x=a(80812);const b=e=>{let{availableNodesForVariable:t,disabled:a=!1,onSelectAndReturnVal:h}=e;const b=(0,n.d4)((e=>e.customization)),v=(e,t)=>{let a=e?"".concat(e.id,".data.instance"):t;const n="{{".concat(a,"}}");h(n)};return(0,x.jsx)(x.Fragment,{children:!a&&(0,x.jsxs)("div",{style:{flex:30},children:[(0,x.jsx)(o.A,{flexDirection:"row",sx:{mb:1,ml:2,mt:2},children:(0,x.jsx)(r.A,{variant:"h5",children:"Select Variable"})}),(0,x.jsx)(p(),{style:{height:"100%",maxHeight:"calc(100vh - 220px)",overflowX:"hidden"},children:(0,x.jsx)(s.A,{sx:{pl:2,pr:2},children:(0,x.jsxs)(i.A,{children:[(0,x.jsx)(l.A,{sx:{p:0,borderRadius:"".concat(b.borderRadius,"px"),boxShadow:"0 2px 14px 0 rgb(32 40 45 / 8%)",mb:1},disabled:a,onClick:()=>v(null,"question"),children:(0,x.jsxs)(c.Ay,{alignItems:"center",children:[(0,x.jsx)(d.A,{children:(0,x.jsx)("div",{style:{width:50,height:50,borderRadius:"50%",backgroundColor:"white"},children:(0,x.jsx)("img",{style:{width:"100%",height:"100%",padding:10,objectFit:"contain"},alt:"AI",src:g})})}),(0,x.jsx)(u.A,{sx:{ml:1},primary:"question",secondary:"User's question from chatbox"})]})}),(0,x.jsx)(l.A,{sx:{p:0,borderRadius:"".concat(b.borderRadius,"px"),boxShadow:"0 2px 14px 0 rgb(32 40 45 / 8%)",mb:1},disabled:a,onClick:()=>v(null,"chat_history"),children:(0,x.jsxs)(c.Ay,{alignItems:"center",children:[(0,x.jsx)(d.A,{children:(0,x.jsx)("div",{style:{width:50,height:50,borderRadius:"50%",backgroundColor:"white"},children:(0,x.jsx)("img",{style:{width:"100%",height:"100%",padding:10,objectFit:"contain"},alt:"chatHistory",src:m})})}),(0,x.jsx)(u.A,{sx:{ml:1},primary:"chat_history",secondary:"Past conversation history between user and AI"})]})}),t&&t.length>0&&t.map(((e,t)=>{var n,o,r,s;const i=e.data.outputAnchors[0].options.find((t=>t.name===e.data.outputs.output));return(0,x.jsx)(l.A,{sx:{p:0,borderRadius:"".concat(b.borderRadius,"px"),boxShadow:"0 2px 14px 0 rgb(32 40 45 / 8%)",mb:1},disabled:a,onClick:()=>v(e),children:(0,x.jsxs)(c.Ay,{alignItems:"center",children:[(0,x.jsx)(d.A,{children:(0,x.jsx)("div",{style:{width:50,height:50,borderRadius:"50%",backgroundColor:"white"},children:(0,x.jsx)("img",{style:{width:"100%",height:"100%",padding:10,objectFit:"contain"},alt:e.data.name,src:"".concat(f.VY,"/api/v1/node-icon/").concat(e.data.name)})})}),(0,x.jsx)(u.A,{sx:{ml:1},primary:null!==(n=null!==(o=null!==(r=e.data.inputs.chainName)&&void 0!==r?r:e.data.inputs.functionName)&&void 0!==o?o:e.data.inputs.variableName)&&void 0!==n?n:e.data.id,secondary:"ifElseFunction"===e.data.name?"".concat(e.data.description):"".concat(null!==(s=null===i||void 0===i?void 0:i.label)&&void 0!==s?s:"output"," from ").concat(e.data.label)})]})},t)}))]})})})]})})}},49616:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var n=a(72176),o=a(80812);function r(e,t,a,n){return new(a||(a=Promise))((function(o,r){function s(e){try{l(n.next(e))}catch(e){r(e)}}function i(e){try{l(n.throw(e))}catch(e){r(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof a?t:new a((function(e){e(t)}))).then(s,i)}l((n=n.apply(e,t||[])).next())}))}const s=e=>{var{style:t,className:s}=e,i=function(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(a[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(a[n[o]]=e[n[o]])}return a}(e,["style","className"]);const l=(0,n.useRef)(null);return(0,n.useEffect)((()=>{r(void 0,void 0,void 0,(function*(){yield a.e(4078).then(a.bind(a,84078))}))}),[]),(0,n.useEffect)((()=>{l.current&&Object.assign(l.current,i)}),[i]),(0,o.jsx)("flowise-fullchatbot",{ref:l,style:t,class:s})};var i=a(3998),l=a(72761),c=a(21070),d=a(77616),u=a(13706);const h=()=>{const e=document.location.pathname.toString().split("/"),t="chatbot"===e[e.length-1]?"":e[e.length-1],a=(0,i.Zp)(),[r,h]=(0,n.use
1State)(null),[p,g]=(0,n.useState)({}),[m,f]=(0,n.useState)(!1),[x,b]=(0,n.useState)({}),[v,w]=(0,n.useState)(!0),[y,j]=(0,n.useState)({}),A=(0,d.A)(c.A.getSpecificChatflowFromPublicEndpoint),C=(0,d.A)(c.A.getSpecificChatflow);return(0,n.useEffect)((()=>{A.request(t)}),[]),(0,n.useEffect)((()=>{var e,a;A.error&&(401===(null===(e=A.error)||void 0===e||null===(a=e.response)||void 0===a?void 0:a.status)&&(localStorage.getItem("username")&&localStorage.getItem("password")?C.request(t):(b({title:"Login",confirmButtonName:"Login"}),f(!0))))}),[A.error]),(0,n.useEffect)((()=>{var e,t;C.error&&(401===(null===(e=C.error)||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)&&(b({title:"Login",confirmButtonName:"Login"}),f(!0)))}),[C.error]),(0,n.useEffect)((()=>{if(A.data||C.data){const t=A.data||C.data;if(h(t),t.chatbotConfig)try{const e=JSON.parse(t.chatbotConfig);g(e),e.overrideConfig&&(e.overrideConfig.generateNewSession&&(e.overrideConfig.sessionId=Date.now().toString()),j(e.overrideConfig))}catch(e){console.error(e),g({}),j({})}}}),[A.data,C.data]),(0,n.useEffect)((()=>{w(A.loading||C.loading)}),[A.loading,C.loading]),(0,o.jsx)(o.Fragment,{children:v?null:(0,o.jsxs)(o.Fragment,{children:[!r||r.apikeyid?(0,o.jsx)("p",{children:"Invalid Chatbot"}):(0,o.jsx)(s,{chatflowid:r.id,apiHost:u.VY,chatflowConfig:y,theme:{chatWindow:p}}),(0,o.jsx)(l.A,{show:m,dialogProps:x,onConfirm:(e,t)=>{localStorage.setItem("username",e),localStorage.setItem("password",t),a(0)}})]})})}},9363:(e,t,a)=>{e.exports=a.p+"static/media/robot.3e38acc0493763eacabe.png"}}]); 2//# sourceMappingURL=1056.6b2d79fc.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.