1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5777],{65777:(e,t,o)=>{o.d(t,{A:()=>A});var l=o(37876),a=o(14232),n=o(2171),r=o(97778),i=o(31377),s=o(75784),c=o(18847),u=o.n(c),d=o(16495),m=o(21639),p=o(89311),x=o(4755),y=o(83872),h=o(53767),f=o(34321),g=o(82669),b=o(95993),j=o(95372),v=o(19392),N=o(56256),w=o(63819),I=o(87156);let P=u()(()=>Promise.resolve().then(o.bind(o,89638)),{loadableGenerated:{webpack:()=>[89638]},ssr:!1}),k=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?{duration:0}:{type:"spring",stiffness:300,damping:26,mass:.8}},C=(0,a.forwardRef)((e,t)=>{let{uniqueId:o,selectedMention:c,autofocusArea:u,smallerSize:g=!1,postComment:C=()=>{},loading:A,error:Y,onChange:E=()=>{},placeholder:T="Post your comment",editable:O=!0,showEmojiPicker:L=!0,showImageUploader:M=!1,customActionButton:W=null,companyAdminsOnly:_=!1,editableValue:z,isProject:D=!1,projectCommentExpand:R,setProjectCommentExpand:B,post:U={}}=e,X=(e=>["What stood out to you in this project?","Whatâs one thing you love about ".concat(e,"?"),"Got any suggestions to make this project even better?","What problem does this project solve for you?","Would you recommend ".concat(e," to others? Why?"),"Whatâs something cool you noticed about this project?","How does this project inspire you?","Whatâs one thing the creator of ".concat(e," should know?"),"Any thoughts on how this project could evolve?","What made you upvote this project?"])(null==U?void 0:U.title),{isLoggedIn:G}
1=(0,I.A)(),H=(0,n.useSelector)(b.oz),F=(0,a.useRef)(),q=(0,a.useRef)(),[Q,J]=(0,a.useState)(!1),[K,V]=(0,a.useState)(null),[Z,$]=(0,a.useState)(!1),[ee,et]=(0,a.useState)(!0),[eo,el]=(0,a.useState)(0),ea=R||!!K;(0,a.useImperativeHandle)(t,()=>({clearContent:()=>{var e;V(null),null==F||null==(e=F.current)||e.clearContent()}}));let en=R&&W||m.Ay.Primary,er=async()=>{V(null);try{let e={media:K.path,type:d.ALLOWED_UPLOAD_TYPES.COMMENTS};await f.DX.delete({data:e})}catch(e){}},ei="".concat(o,"-").concat("create-comment-box"),es=(0,a.useMemo)(()=>X[Math.floor(w.default.randomInRange(0,X.length))],[]),ec=!!D||"size",eu=(0,l.jsx)(r.PY1.form,{id:"post-a-comment-form",className:"w-full ".concat(ea?"flex flex-col":"flex flex-col gap-2"," ").concat(R?"border bg-white dark:bg-gray-00 p-2 mb-1 flex rounded-2xl flex-grow-0":""),ref:q,onSubmit:e=>{var t;if(null==e||e.preventDefault(),et(!0),Q||A)return null;let o=null==F||null==(t=F.current)?void 0:t.getHTML();M&&(null==K?void 0:K.path)?C(o,K.path):C(o),el(e=>e+1)},layout:ec,layoutId:"post-a-comment-form",transition:k(ee),children:(0,l.jsxs)(r.PY1.div,{className:"break-words w-full flex ".concat(ea?"flex-col":""," "),layout:ec,layoutId:"post-a-comment-wrapper",transition:k(ee),children:[(0,l.jsxs)(r.PY1.div,{className:"flex items-center gap-2 flex-grow",layout:"size",layoutId:"post-a-comment-input-wrapper",transition:k(ee),children:[(0,l.jsx)(r.PY1.div,{className:"border border-gray-00 rounded-full hidden sm:block self-start",layout:ec,layoutId:"post-a-comment-profile-picture",transition:k(ee),children:g?(0,l.jsx)(x.Ay.Smallest,{image:null==H?void 0:H.profilePicture,className:"hover:opacity-80 cursor-pointer",as:r.PY1.img,layout:ec,layoutId:"post-a-comment-profile-picture",transition:k(ee)}):(0,l.jsx)(x.Ay.Smaller,{image:null==H?void 0:H.profilePicture,className:"hover:opacity-80 cursor-pointer",as:r.PY1.img,layout:ec,layoutId:"post-a-comment-profile-picture",transition:k(ee)})}),(0,l.jsx)(j.A,{id:"post-a-comment",ref:F,autofocus:u,editorClassName:"text-sm max-h-36 overflow-y-auto break-words cursor-text w-full ",disabled:!O,onChange:E,hideToolbar:!0,editorType:v.Q.SCROLL,placeholder:R?"Write a comment":T,content:(null==z?void 0:z.comment)||"",companyAdminsOnly:_,selectedMentionUser:c,characterLimit:d.COMMENTS_LENGTH,onModEnterEvent:()=>{var e;null==q||null==(e=q.current)||e.requestSubmit()}},"editor-".concat(R))]}),(0,l.jsxs)(r.PY1.div,{className:"flex items-end ".concat(K?"justify-between":"justify-end"," gap-2 ").concat(ea?"w-full":""),layout:!ee&&"size",layoutId:"post-a-comment-buttons",transition:ee?{duration:0}:null,children:[K?(0,l.jsx)(r.PY1.div,{layout:ec,layoutId:"comment-upload-img-innerr-div",className:"flex sm:ml-10",children:(0,l.jsx)(S,{image:K,onRemoveImage:er,imgLoading:Q})}):null,(0,l.jsxs)(r.PY1.div,{layout:!ee&&ec,layoutId:"post-a-comment-image-button-div",className:"flex items-center gap-2 justify-self-end",transition:ee?{duration:0}:null,children:[M?(0,l.jsx)(r.PY1.div,{layout:ec,layoutId:"post-a-comment-image-uploader",transition:{duration:.2*!ee,layout:{duration:.2*!ee}},children:(0,l.jsx)(h.A,{setLoading:J,loading:A,setImageInfo:e=>{(null==e?void 0:e.url)&&V(e)},callbackWithPath:e=>{V(t=>({...t,src:"".concat(d.CLOUDFRONT_PROD_S3).concat(e),path:e}))},callbackWithBlob:e=>V(t=>({...t,blob:e})),signImageAPICall:e=>f.DX.getSignedUrl({filename:null==e?void 0:e.name,context:d.IMAGE_UPLOAD_CONTEXTS.COMMENTS}),getImageFileName:()=>"".concat(H.id,"-comment-").concat(Date.now()),id:z?"".concat(null==z?void 0:z.id,"-edit"):"".concat(o),disabled:!G||!!K||z,clipboardElementId:ei,children:(0,l.jsx)(m.Ay.CarbonOutline,{small:!0,circular:!0,className:"".concat(K||z||!G?"opacity-50 cursor-not-allowed":"cursor-pointer"),as:G?r.PY1.div:"button",layout:ec,layoutId:"post-a-comment-image-uploader-button",transition:k(ee),disabled:!G||K||z,children:(0,l.jsx)(y.ImageAddIcon,{size:14})})})}):null,L?(0,l.jsx)(r.PY1.div,{className:"hidden lg:block mt-0.5",layout:ec,layoutId:"post-a-comment-emoji-picker",transition:{duration:.2*!ee,layout:{duration:.2*!ee}},children:(0,l.jsx)(P,{onEmojiSelect:e=>{if(null==F?void 0:F.current){var t;null==F||null==(t=F.current)||t.addEmoji(e)}},small:!0,as:r.PY1.button,layout:ec,layoutId:"post-a-comment-emoji-picker-button",transition:k(ee),showPicker:Z,setShowPicker:$})},"emoji-picker-".concat(eo)):null,(0,l.jsx)(en,{circular:!0,small:g,type:"submit",disabled:A||!O||Q,loading:A||Q,as:r.PY1.button,layout:ec,layoutId:"post-a-comment-button",transition:{duration:.2*!ee,layout:{duration:.2*!ee}},children:z?(0,l.jsx)(y.CheckIcon,{size:g?18:20}):(0,l.jsx)(y.ArrowUpIcon,{size:g?18:20})})]})]})]})});return(0,l.jsx)(i.o,{id:o,children:(0,l.jsx)(s.N,{initial:!1,children:R?(0,l.jsxs)(r.PY1.div,{id:ei,className:"flex flex-col gap-3",role:"none",onClick:e=>{var t;null==e||e.stopPropagation(),null==F||null==(t=F.current)||t.focu
1s()},layout:!0,layoutId:"post-a-comment",transition:k(ee),children:[(0,l.jsxs)(r.PY1.div,{className:"border border-primaryBorder w-full flex flex-col ".concat(g?"rounded-xl":"rounded-2xl"," bg-gray-200 dark:bg-gray-100 px-1 "),layoutId:"post-a-comment-box",transition:k(ee),children:[(0,l.jsxs)(r.PY1.div,{className:"flex p-3 flex-row justify-between",initial:{opacity:0,filter:"blur(2px)"},animate:{opacity:1,filter:"blur(0px)"},exit:{opacity:0,filter:"blur(2px)"},transition:{duration:.2,delay:.1},layout:"position",children:[(0,l.jsx)(s.N,{children:(0,l.jsx)(N.A,{text:es,as:p.default.SemiBoldText,xs:!0},"message-".concat(R))}),(0,l.jsxs)("button",{type:"button",onClick:()=>{B(!1),V(null)},className:"flex items-center group ",children:[(0,l.jsx)("span",{className:"text-gray-400 group-hover:text-gray-700 ",children:(0,l.jsx)(y.CloseXIcon,{size:"12"})}),(0,l.jsx)(p.default.SemiBoldText,{xxs:!0,className:"group-hover:text-gray-700 uppercase text-gray-400 hidden sm:block",children:"Close"})]})]}),eu]}),Y&&(0,l.jsx)(p.default.ErrorText,{className:"mt-2",children:Y})]}):(0,l.jsxs)(r.PY1.div,{id:ei,className:"group",role:"none",onClick:e=>{var t;null==e||e.stopPropagation(),null==F||null==(t=F.current)||t.focus()},layout:ec,layoutId:"post-a-comment",transition:k(ee),children:[(0,l.jsx)(r.PY1.div,{className:"border border-primaryBorder w-full flex items-center bg-gray-25 group group-focus-within:bg-gray-00 ".concat(g?"p-1 rounded-xl":"p-1.5 rounded-2xl"),layout:ec,layoutId:"post-a-comment-box",transition:k(ee),children:eu}),Y&&(0,l.jsx)(p.default.ErrorText,{className:"mt-2",children:Y})]})})},o)}),S=e=>{let{image:t,onRemoveImage:o=()=>{},imgLoading:a=!1}=e;return(0,l.jsxs)("div",{className:"relative max-w-fit w-16 h-16 flex items-center justify-center mt-2",children:[(0,l.jsx)("img",{src:(null==t?void 0:t.src)||(null==t?void 0:t.blob)||(null==t?void 0:t.url),alt:"comment attachment",className:"w-16 h-16 object-cover border border-primaryBorder rounded-lg"}),(0,l.jsx)(m.Ay.CarbonOutline,{small:!0,circular:!0,className:"-top-2 -right-2 absolute z-[1]",onClick:o,children:(0,l.jsx)(y.CloseXIcon,{size:14})}),a?(0,l.jsx)("div",{className:"absolute w-full h-full bg-gray-00/30 flex items-center justify-center",children:(0,l.jsx)(g.A,{})}):null]})},A=(0,a.memo)(C)}}]);
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.