1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5468],{9976:function(e,r,t){var o=t(88169),i=t(85893);r.Z=(0,o.Z)((0,i.jsx)("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2z"}),"Bookmark")},4854:function(e,r,t){var o=t(88169),i=t(85893);r.Z=(0,o.Z)((0,i.jsx)("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2zm0 15-5-2.18L7 18V5h10v13z"}),"BookmarkBorder")},70580:function(e,r,t){t.d(r,{s:function(){return o}});let o=(e,r)=>{try{let t=new URL(e);return[".png",".jpg",".jpeg",".webp",".gif",".avif"].some(e=>t.pathname.endsWith(e))||"IMAGE"===r}catch(e){return!1}}},85468:function(e,r,t){t.r(r),t.d(r,{default:function(){return F}});var o=t(85893),i=t(31536),n=t(15861),s=t(67294),l=t(5616),a=t(67720),c=t(93741),x=t(69417),p=t(66522),d=t(46907),h=t(45242),u=function(e){let{isValidating:r,showGenerate:t,onGenerate:n}=e,s=(0,c.T)(),{selectedExecution:l,generatedExecution:a}=(0,c.C)(e=>e.executions),{answers:u,isSimulationStreaming:f}=(0,c.C)(e=>e.chat),g=(0,c.C)(e=>e.template.isGenerating);return(0,o.jsx)(i.Z,{mx:{md:"32px"},gap:2,pb:"8px",children:!r&&!f&&(0,o.jsxs)(i.Z,{direction:"row",alignItems:"center",gap:2,flexWrap:"wrap",ml:{xs:"16px",md:(null!=l?l:a)?0:"50px"},children:[t&&(0,o.jsx)(x.Z,{onClick:n,endIcon:(0,o.jsx)(p.Z,{}),sx:{height:"22px",p:"15px",fontSize:13,fontWeight:500,bgcolor:"primary.main",borderColor:"primary.main",":hover":{bgcolor:"surface.1",color:"primary.main"}},variant:"contained",disabled:g||r,children:"Run prompt"}),!!u.length&&!a&&(0,o.jsx)(x.Z,{variant:"text",endIcon:(0,o.jsx)(d.Z,{}),sx:{height:"22px",p:"15px",fontSize:13,fontWeight:500,border:"1px solid",borderColor:"divider",color:"secondary.main",":hover":{bgcolor:"action.hover"}},onClick:()=>s((0,h.tn)([])),children:"Clear"})]})})},f=t(55529),g=t(66242),m=t(34386),j=t(93946),v=t(41248),b=t(36847),Z=t(9976),w=t(4854),S=t(35656),y=t(48509),k=t(70580),C=t(3706);let z=e=>{let{execution:r,min:t,onClick:a,promptsData:x}=e,p=(0,v.I0)(),[d,u]=(0,s.useState)(""),f=(0,c.C)(e=>e.executions.selectedExecution),z=r.id===(null==f?void 0:f.id),[W]=(0,y.tE)(),[T]=(0,y.Lk)(),G=async()=>{var e;let t=null===(e=r.prompt_executions)||void 0===e?void 0:e.find(e=>{var r,t;let o=x&&x.find(r=>r.id===e.prompt);return!(0,k.s)(e.output,null!==(t=null==o?void 0:null===(r=o.engine)||void 0===r?void 0:r.output_type)&&void 0!==t?t:"TEXT")});u(await (0,S.markdownToHTML)((null==t?void 0:t.output)||""))};(0,s.useEffect)(()=>{if(t){p((0,h.bz)(!1));return}G()},[]);let I=async e=>{e.stopPropagation();try{r.is_favorite?await T(r.id):await W(r.id)}catch(e){console.error(e)}};return(0,o.jsx)(g.Z,{onClick:()=>{p((0,b.i6)(r)),"function"==typeof a&&a()},elevation:0,sx:{bgcolor:z&&!t?"primaryContainer":"surface.3",borderRadius:"8px",p:"8px",cursor:"pointer","&:hover, &:focus":{bgcolor:z&&!t?"primaryContainer":"surface.5"}},children:t?(0,o.jsxs)(i.Z,{direction:"row",alignItems:"center",gap:1,children:[(0,o.jsx)(C.Z,{title:r.title,variant:"a"}),(0,o.jsx)(n.Z,{sx:{width:"90%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",fontSize:12,fontWeight:500,color:"onSurface"},children:r.title})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(i.Z,{direction:"row",alignItems:"center",gap:1,p:"4px",children:[(0,o.jsx)(m.Z,{title:"Save",enterDelay:1e3,enterNextDelay:1e3,children:(0,o.jsx)(j.Z,{onClick:I,sx:{border:"none",p:"6px","&:hover":{bgcolor:"surface.2",opacity:1},svg:{width:"24px",height:"24px"}},children:r.is_favorite?(0,o.jsx)(Z.Z,{}):(0,o.jsx)(w.Z,{})})}),(0,o.jsx)(n.Z,{sx:{width:"80%",whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",fontSize:12,fontWeight:500,color:"onSurface"},children:r.title})]}),(0,o.jsxs)(l.Z,{sx:{bgcolor:"surface.1",p:"16px 12px",borderRadius:"10px",height:"15svh",overflow:"hidden"},children:[(0,o.jsx)(n.Z,{sx:{fontSize:14,fontWeight:500,color:"onSurface",py:"12px"},children:r.title}),(0,o.jsx)(n.Z,{sx:{fontSize:12,fontWeight:400,color:"onSurface"},dangerouslySetInnerHTML:{__html:(0,S.sanitizeHTML)(d)}})]})]})})};var W=t(15015),T=t(9218),G=t(35e3),I=t(98456),E=t(27199),_=t(27105);let H=e=>{let{onCancel:r}=e;return(0,o.jsxs)(i.Z,{gap:1,sx:{p:"8px",borderRadius:"16px",bgcolor:"surface.3",m:"0 32px"},children:[(0,o.jsxs)(i.Z,{direction:"row",alignItems:"center",gap:2,children:[(0,o.jsxs)(i.Z,{sx:{position:"relative",bgcolor:"surface.1",p:"8px",borderRadius:"8px"},children:[(0,o.jsx)(i.Z,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%,-50%)"},children:(0,o.jsx)(E.F,{color:_.r.palette.primary.main,width:24})}),(0,o.jsx)(I.Z,{size:52,sx:{color:"primary.main",".MuiCircularProgress-circle":{strokeWidth:2}}})]}),(0,o.jsxs)(i.Z,{gap:.5,children:[(0,o.jsx)(n.Z,{fontSize:12,fontWeight:500,color:"onSurface",children:"Generating in progress..."}),(0,o.jsx)(n.Z,{fontSize:10,fontWeight:400,color:"onSurface",sx:{opacity:.5},children:"Estimated time: 360s"})]})]}),(0,o.jsx)(x.Z,{variant:"text",sx:{p:"4px 10px",borderRadius:"40px",fontSize:13,fontWeight:500,bgcolor:"surface.1",color:"onSurface",":hover":{bgcolor:"action.hover"}},onClick:r,children:"Cancel"})]})};var R=t(5699),B=t(52997);let L=e=>{let{template:r,messages:t,onGenerate:x,showGenerate:p,isValidating:d,abortGenerating:h}=e,g=(0,c.T)(),m=(0,f.nH)(),j=(0,c.C)(e=>e.template.isGenerating),{generatedExecution:v,selectedExecution:Z}=(0,c.C)(e=>e.executions),w=!!(Z||v),S=(0,s.useRef)(null),y=()=>{S.current&&(S.current.scrollTop=S.current.scrollHeight)};(0,s.useEffect)(()=>{y()},[t,w,p]);let k=null==r?void 0:r.prompts.some(e=>e.content);return(0,o.jsxs)(i.Z,{ref:S,gap:3,sx:{overflowX:"hidden",overflowY:"auto",overscrollBehavior:"contain",scrollBehavior:"smooth","&::-webkit-scrollbar":{width:{xs:"4px",md:"6px"},p:1,backgroundColor:"surface.1"},"&::-webkit-scrollbar-track":{webkitBoxShadow:"inset 0 0 6px rgba(0,0,0,0.00)"},"&::-webkit-scrollbar-thumb":{backgroundColor:"surface.5",outline:"1px solid surface.1",borderRadius:"10px"}},children:[(0,o.jsx)("div",{style:{marginTop:"auto"}}),(0,o.jsx)(l.Z,{mx:m?"40px":"16px",children:void 0!==r&&!w&&(0,o.jsx)(W.Z,{title:r.title,categoryName:null==r?void 0:r.category.name,thumbnail:r.thumbnail,tags:r.tags,description:r.description})}),(0,o.jsxs)(i.Z,{mx:{xs:"16px",md:w?"32px":"40px"},children:[(0,o.jsx)(a.Z,{sx:{fontSize:12,fontWeight:400,color:"onSurface",opacity:.5},children:"New messages"}),t.map(e=>(0,o.jsxs)(s.Fragment,{children:[(0,o.jsx)(B.v,{isExecutionShown:w,message:e,onScrollToBottom:y}),"form"===e.type&&(0,o.jsx)(l.Z,{ml:{xs:0,md:w?0:"48px"}
1,mb:2,mt:{xs:0,md:e.noHeader?-2.5:0},children:(0,o.jsx)(G.Z,{onScrollToBottom:y,messageType:e.type})}),"spark"===e.type&&e.spark&&(0,o.jsxs)(i.Z,{mx:{xs:0,md:w?0:"48px"},mb:2,gap:2,children:[(0,o.jsx)(l.Z,{maxWidth:"360px",children:(0,o.jsx)(z,{execution:e.spark,min:!0})}),(0,o.jsxs)(l.Z,{children:[(0,o.jsx)(n.Z,{fontSize:12,fontWeight:500,color:"onSurface",mb:"10px",children:"Quick Feedback:"}),(0,o.jsx)(T.Z,{execution:e.spark,variant:"button"})]})]})]},e.id))]}),k&&(0,o.jsx)(u,{onGenerate:x,showGenerate:p,isValidating:d}),j&&(0,o.jsx)(l.Z,{width:"100%",children:(0,o.jsx)(H,{onCancel:()=>{h(),g((0,b.nm)(null)),g((0,R.Hf)(!1))}})})]})};var M=t(67252),V=t(74678),N=t(23142),F=e=>{let{template:r,messages:t,showGenerate:s,generateExecutionHandler:l,isValidatingAnswer:a,abortConnection:x,validateVary:p,isGenerating:d,disableChatInput:h,inputs:u,handleSignIn:f}=e,{isMobile:g}=(0,N.Z)(),m=(0,c.C)(e=>e.user.currentUser);return(0,o.jsxs)(i.Z,{width:"100%",height:"100%",bgcolor:"surface.3",children:[!g&&(0,o.jsx)(i.Z,{direction:"row",alignItems:"center",sx:{bgcolor:"surface.1",p:"24px 8px 24px 28px"},children:(0,o.jsx)(n.Z,{fontSize:12,fontWeight:500,letterSpacing:2,textTransform:"uppercase",children:"Chat With Promptify"})}),(0,o.jsxs)(i.Z,{justifyContent:"flex-end",gap:2,height:{xs:"100%",md:"calc(100% - 66px)"},bgcolor:"surface.1",children:[(0,o.jsx)(L,{template:r,messages:t,showGenerate:s,onGenerate:l,isValidating:a,abortGenerating:x}),(null==m?void 0:m.id)?(0,o.jsx)(M.x,{onSubmit:p,disabled:a||d||h||0===u.length,showGenerate:s,onGenerate:l,isValidating:a}):(0,o.jsx)(i.Z,{direction:"column",alignItems:"center",justifyContent:"center",gap:1,p:"16px 8px 16px 16px",children:(0,o.jsx)(V.Z,{onClick:f})})]})]})}}}]);
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.