1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6884],{15367:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/webchatsignup",function(){return s(21070)}])},21070:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return Y}});var n=s(85893),a=s(67294),l=s(9008),i=s.n(l),r=s(11163),o=s(45697),c=s(73380),u=s.n(c),d=s(4696),p=s(93967),m=s.n(p),h=s(73639),_=s(18498),g=s.n(_),x=s(42577),f=s(4510),j=s.n(f),v=s(30381),w=s.n(v),C=s(16542),N=s.n(C);let b=a.memo(e=>{let{className:t,time:s}=e,[l,i]=a.useState(w()(s).calendar());return(a.useEffect(()=>{let e=null,t=!1,n=()=>{if(t)return;let a=new Date(s).getTime(),l=Date.now();i(w()(s).calendar()),l-a>6048e5||(e=setTimeout(()=>{t||n()},6e4))};return n(),()=>{t=!0,e&&clearTimeout(e)}},[s,i]),s)?(0,n.jsx)("div",{className:"".concat(t," ").concat(N().time),children:l}):null});b.displayName="TimeText";let y=o.shape({role:o.oneOf(["user","system","assistant"]),content:o.string,isSuccess:o.bool,isFailure:o.bool,isSending:o.bool,isWaiting:o.bool}),M={message:y,className:o.string,isLast:o.bool,gotoBottom:o.func},k=a.memo(e=>{let{created_at:t,content:s,displayTime:l,image:i,role:r,isWaiting:o,isFailure:c,className:u,isLast:d,gotoLast:p,..._}=e,f="user"===r?"":"/images/chat/system.png",[v,w]=(0,h._H)({remarkToRehypeOptions:{allowDangerousHtml:!0},rehypeReactOptions:{components:{a:e=>(0,n.jsx)("a",{target:"_blank",...e})}}});a.useEffect(()=>{w(s)},[s,w]);let C=a.useRef(null);return a.useEffect(()=>{if(!d)return;let e=C.current,t=new ResizeObserver(()=>{"function"==typeof p&&p()});return e&&t.observe(e),()=>{e&&t.unobserve(e)}},[C,p,d]),a.useEffect(()=>{d&&"function"==typeof p&&p()},[v,d,p]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{ref:C,className:"".concat(j().container," ").concat(j()[r]," ").concat(u),..._,children:[(0,n.jsxs)("div",{className:"".concat(j().row),children:[(0,n.jsxs)("div",{className:m()(j().sender,{"d-none":!f}),children:[(0,n.jsx)("span",{className:m()({"d-none":!0}),children:""}),f&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("img",{src:"".concat(x.ic).concat(f),alt:""})})]}),(s||o)&&(0,n.jsxs)("div",{className:"".concat(j().message," ").concat(c?j().failure:""),children:[(0,n.jsx)("div",{className:j().text,children:v}),o&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(g(),{size:"8px"})})]})]}),i&&(0,n.jsx)("div",{className:"".concat(j().row),children:(0,n.jsx)("img",{src:i,className:j().imageMessage,alt:"upload image"})})]}),l&&(0,n.jsx)(b,{className:j().timeText,time:t})]})});k.displayName="UiComponent";let D=a.memo(e=>{let{message:t,...s}=e,{created_at:a,displayTime:l,content:i,image:r,image_width:o,image_height:c,role:u,isWaiting:d,isFailure:p}=t;return(0,n.jsx)(k,{...s,displayTime:l,content:i,image:r,image_width:o,image_height:c,role:u,isWaiting:d,isFailure:p,created_at:a})});D.displayName="DMessage",D.propTypes=M,D.defaultProps={className:"",isLast:!1};var E=s(69704),T=s.n(E),I=s(87535),L=s(53051),S=s.n(L);let W=a.createContext();function R(e){let t=(0,r.useRouter)(),s=a.useCallback(()=>{t.push("/get-app",void 0,{shallow:!0})},[t]);return(0,n.jsx)("div",{className:S().container,...e,children:(0,n.jsxs)("div",{className:S().content,children:[(0,n.jsx)("div",{className:S().blur}),(0,n.jsxs)("div",{className:S().modal,children:[(0,n.jsx)("h3",{className:S().title,children:"Continue in the app"}),(0,n.jsx)("p",{className:S().text,children:"so itâs easier to return to this thread later"}),(0,n.jsx)("button",{className:S().continue,onClick:s,children:"Continue"})]})]})})}function A(e){let{children:t,defaultVisible:s,...l}=e,[i,r]=a.useState(!1);return a.useEffect(()=>{r(!!s)},[s,r]),(0,n.jsxs)(W.Provider,{value:[i,r],children:[t,i&&(0,n.jsx)(R,{...l})]})}A.propTypes={children:o.node,defaultVisible:o.bool},A.defaultProps={defaultVisible:!1};let P={className:o.string};function F(e){let{className:t,...s}=e,{messageKeyList:l}=(0,I.Jk)(),[i,r]=a.useState(!1),[,{sendChat:o}]=(0,I.WZ)(),[c,u]=a.useState(""),d=a.useRef(null),p=a.useRef(null),[m,h]=a.useState(""),_=a.useCallback(e=>{13===e.keyCode&&(e.preventDefault(),d.current.click())},[d]),g=a.useCallback(e=>{u(e.target.value),e.target.parentNode.dataset.replicatedValue=e.target.value},[u]),[x,f]=a.useState(null),j=a.useCallback(e=>{let t=e.target,s=t.files[0];if(!s)return;let n=new FileReader;n.onload=()=>{let e=n.result,a=new Image;a.onload=()=>{f({file:s,src:e,size:{width:a.width,height:a.height}}),t.value=""},a.src=e},n.readAsDataURL(s)},[f]),v=a.useCallback(e=>{e.preventDefault,f(null)},[f]),w=function(){let[,e]=function(){let e=a.useContext(W);if(!e)throw Error("useInstallAppModal should be used in InstallAppModal");return e}();return e}(),C=a.useCallback(e=>{e.preventDefault(),(c||x)&&(c.length>2e4?h("Message is too long"):l.length>13?w(!0):(r(!0),h(""),u(""),f(null),o(null,c,x).then(()=>{r(!1)}).catch(e=>{r(!1)})))},[o,c,x,u,f,r,l,w]);return a.useEffect(()=>{c||(p.current.parentNode.dataset.replicatedValue="",p.current.parentNode.scrollTop=0)},[c,p]),(0,n.jsxs)("div",{className:"".concat(T().container," ").concat(t),...s,children:[(0,n.jsx)("form",{onSubmit:C,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:T().fileInputWrapper,children:[(0,n.jsx)("div",{children:(0,n.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M12 5V19M5 12H19",stroke:"#E77C84",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,n.jsx)("input",{disabled:i,type:"file",className:T().fileInput,accept:"image/*",multiple:!1,onChange:j})]}),(0,n.jsxs)("div",{className:T().wrapper,children:[(0,n.jsx)("textarea",{ref:p,value:c,onChange:g,onKeyDown:_,placeholder:"Message",disabled:i,onInput:e=>{e.target.parentNode.dataset.replicatedValue=e.target.value}}),x&&(0,n.jsx)("div",{className:T().imagePreview,children:(0,n.jsx)("button",{onClick:v,children:(0,n.jsx)("img",{src:x.src,alt:"Selected",style:{maxWidth:"45px",maxHeight:"45px"}})})})]}),(0,n.jsx)("button",{ref:d,type:"submit",disabled:i,children:(0,n.jsxs)("svg",{width:"43",height:"43",viewBox:"0 0 43 43",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("circle",{cx:"21.5",cy:"21.5",r:"21.5",fill:"#E77C84",fillOpacity:"0.3"}),(0,n.jsx)("path",{d:"M19.3497 23.6495L30.0997 12.8995M19.4803 23.9853L22.171 30.9042C22.408 31.5138 22.5265 31.8185 22.6973 31.9075C22.8453 31.9846 23.0217 31.9847 23.1698 31.9078C23.3407 31.819 23.4596 31.5144 23.6973 30.9051L30.4446 13.6153C30.6592 13.0653 30.7665 12.7903 30.7078 12.6146C30.6568 12.462 30.5371 12.3423 30.3845 12.2913C30.2088 12.2326 29.9338 12.3399 29.3838 12.5545L12.094 19.3
1018C11.4847 19.5395 11.1801 19.6584 11.0913 19.8293C11.0144 19.9774 11.0145 20.1538 11.0916 20.3018C11.1806 20.4726 11.4853 20.5911 12.0949 20.8281L19.0138 23.5188C19.1375 23.5669 19.1994 23.591 19.2515 23.6282C19.2976 23.6611 19.338 23.7015 19.3709 23.7476C19.4081 23.7997 19.4322 23.8616 19.4803 23.9853Z",stroke:"#E77C84",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})}),(0,n.jsx)("div",{className:T().error,children:m})]})}F.propTypes=P,F.defaultProps={className:""};var H=s(8834),U=s.n(H),O=s(12313),B=s(34285),V=s(3218),Z=s(54645);let z={className:o.string},q={className:""};function G(e){let{className:t,...s}=e,l=(0,V.X)(),i=a.useRef(null),{messageKeyList:r,messages:o}=(0,I.Jk)(),[,{loadPrevMessages:c,loadNextMessages:p}]=(0,I.WZ)(),m=a.useRef(null),[h,_]=a.useState(!1),g=a.useCallback(()=>{(0,d.dv)(0,m.current)},[m]),x=(0,O.aF)(),{pk:f}=x||{pk:null};a.useEffect(()=>{l(!0),f&&p(!0).then(()=>{l(!1)}).catch(e=>{l(!1)})},[_,f,g,p,l]),a.useEffect(()=>{{let e=e=>{i.current.style.minHeight=window.innerHeight+"px",i.current.style.maxHeight=window.innerHeight+"px",(0,d.dv)(0,m.current)};return window.addEventListener&&window.addEventListener("resize",e),i.current.style.minHeight=window.innerHeight+"px",i.current.style.maxHeight=window.innerHeight+"px",()=>{window.removeEventListener&&window.removeEventListener("resize",e)}}},[m]);let[j,v]=a.useState([]),[w,C]=a.useState(null),N=a.useCallback(()=>{let e=m.current,{scrollTop:t,scrollHeight:s,clientHeight:n}=e;Math.abs(t)+n>=s-1&&(_(!0),c(!0).then(()=>{_(!1)}))},[m,c]);return a.useEffect(()=>{if(0===j.length){C(null);return}let e=j[0],t=o[e];C(s=>s&&s.key===e&&s.content===(null==t?void 0:t.content)?s:{key:e,content:null==t?void 0:t.content})},[o,j,C]),a.useEffect(()=>{g()},[w,g]),a.useEffect(()=>{v([...r].reverse())},[r,v]),(0,n.jsx)("div",{className:U().wrapper,children:(0,n.jsxs)("div",{ref:i,className:"".concat(U().container," ").concat(t),...s,children:[(0,n.jsxs)("div",{className:U().topBar,children:[(0,n.jsx)("div",{className:U().title,children:"feelset"}),(0,n.jsx)("div",{style:{position:"absolute",left:0,top:0,right:0,bottom:0,display:"flex",justifyContent:"flex-end",alignItems:"center",paddingRight:20},children:(0,n.jsx)(B.Z,{})})]}),(0,n.jsxs)("div",{className:U().messagesContainer,ref:m,onScroll:N,children:[j.map((e,t)=>{let s=o[e];return s?(0,n.jsx)(D,{message:s,isLast:0===t,gotoLast:g},e):null}),h&&(0,n.jsx)("div",{className:"pt-5 d-flex justify-content-center align-items-center mt-10",children:(0,n.jsx)(u(),{size:"20px"})})]}),(0,n.jsx)(F,{className:"mt-0"})]})})}function J(e){let t=(0,r.useRouter)(),s=(0,O.aF)(),l=(0,Z.Gu)();return a.useEffect(()=>{void 0!==s&&(l||t.push("/login",void 0,{shallow:!0}))},[s,l,t]),(0,n.jsx)(A,{defaultVisible:!1,children:(0,n.jsx)(I.ZP,{children:(0,n.jsx)(G,{...e})})})}G.propTypes=z,G.defaultProps=q,J.propTypes={...z},J.defaultProps={...q};var K=s(10877);function Y(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(i(),{children:[(0,n.jsx)("title",{children:"Feelset"}),(0,n.jsx)("meta",{name:"description",content:"Chat with your love confidant"}),(0,n.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no"})]}),(0,n.jsx)(K.Z,{children:(0,n.jsx)(J,{})})]})}},69704:function(e){e.exports={error:"Composor_error__soh_l",container:"Composor_container__Faz4_",fileInputWrapper:"C
1omposor_fileInputWrapper__DARP_",wrapper:"Composor_wrapper__qhhU_",imagePreview:"Composor_imagePreview__qcKFK"}},16542:function(e){e.exports={time:"TimeText_time__NALIA"}},4510:function(e){e.exports={timeText:"DMessage_timeText__gDRqL",container:"DMessage_container__fyjjQ",row:"DMessage_row__Zy8JP",imageMessage:"DMessage_imageMessage__s6WsQ",sender:"DMessage_sender__1_r9O",message:"DMessage_message__6CYTc",text:"DMessage_text__0I7G9",loading:"DMessage_loading__looCd",failure:"DMessage_failure__2w_R3",user:"DMessage_user__JIarf",system:"DMessage_system__gYOQx",assistant:"DMessage_assistant__h4qUB"}},53051:function(e){e.exports={container:"InstallAppModal_container__4yDld",content:"InstallAppModal_content__waB7W",blur:"InstallAppModal_blur__bZTIm",modal:"InstallAppModal_modal__relDt",title:"InstallAppModal_title__K_CWj",text:"InstallAppModal_text__mroyb",continue:"InstallAppModal_continue__aUUGG"}},8834:function(e){e.exports={wrapper:"WebChatSignUpComponent_wrapper__aFVsI",container:"WebChatSignUpComponent_container__Y4qtG",topBar:"WebChatSignUpComponent_topBar__ETvgs",title:"WebChatSignUpComponent_title__rbONp",right:"WebChatSignUpComponent_right__M6Opt",messagesContainer:"WebChatSignUpComponent_messagesContainer__AYDIW"}}},function(e){e.O(0,[1664,7602,2221,9774,2888,179],function(){return e(e.s=15367)}),_N_E=e.O()}]);
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.