1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7743,9010],{81058:function(e,l,a){"use strict";a.d(l,{g:function(){return r}});var t=a(87462),i=a(67294),n=a(82444),r=i.forwardRef(function(e,l){return i.createElement(n.r,(0,t.Z)({iconAttrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},iconVerticalAlign:"middle",iconViewBox:"0 0 16 16"},e,{ref:l}),i.createElement("path",{d:"M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"}),i.createElement("path",{d:"M7.646 1.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1-.708.708L8.5 2.707V11.5a.5.5 0 0 1-1 0V2.707L5.354 4.854a.5.5 0 1 1-.708-.708l3-3z"}))});r.displayName="Upload"},94504:function(e,l,a){"use strict";a.r(l);var t=a(85893),i=a(81058),n=a(25137),r=a(87066),o=a(67294),s=a(91444),d=a(59010),c=a(20053),p=a.n(c);l.default=e=>{let{label:l,updateFilesCb:a,maxFileSizeInBytes:c,preSelectedFiles:u,resetCb:m,...f}=e,h=(0,o.useRef)(null),[g,v]=(0,o.useState)(u||[]),[_,w]=(0,o.useState)("");(0,o.useEffect)(()=>{"reset"===m&&v([])},[m]);let addNewFilesS3=async e=>{try{w("Uploading...");let{name:l,url:a}=await (0,r.default)({method:"post",url:"/api/fileupload/s3?name=".concat(e.name,"&type=").concat(e.type)}).then(e=>e.data);await (0,r.default)({method:"put",url:a,headers:{"Content-Type":e.type},data:e});let t=a.split("?")[0];if(t.length)return w(""),{name:l,url:t};return null}catch(e){return console.log(e),w(e.message),null}},callUpdateFilesCb=e=>{a(e)},handleNewFileUpload=async e=>{let{files:l}=e.target;if(l.length){if(l[0].size<=c){let e=await addNewFilesS3(l[0]);e&&(f.multiple?(v([...g,e]),callUpdateFilesCb([...g,e])):(v([e]),callUpdateFilesCb([e])))}else s.toast.warning("File size is too large (Max 2mb)")}},removeFile=async e=>{try{w("Deleting...");let{success:l,err:a}=await (0,r.default)({method:"DELETE",url:"/api/fileupload/".concat("s3","?name=").concat(e)}).then(e=>e.data);if(l){let l=g.filter(l=>l.name!==e);v(l),callUpdateFilesCb(l)}else s.toast.error(a)}catch(e){console.log(e),s.toast.error("Something Went Wrong - ".concat(e.message))}w("")};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:p().fileUploadContainer,children:[(0,t.jsx)("label",{className:p().inputLabel,children:l}),(0,t.jsx)("p",{className:p().dragDropText,children:"Drag and drop your files anywhere or"}),(0,t.jsxs)("button",{className:p().uploadFileBtn,type:"button",onClick:()=>{h.current.click()},children:[(0,t.jsx)("div",{children:(0,t.jsx)(i.g,{width:22,height:22})}),(0,t.jsxs)("span",{children:[" Upload ",f.multiple?"files":"a file"]})]}),(0,t.jsx)("input",{className:p().formField,type:"file",ref:h,onChange:handleNewFileUpload,title:"",value:"",...f})]}),_.length>0&&(0,t.jsx)("div",{className:"text-danger my-2",children:_}),(0,t.jsxs)("div",{className:p().filePreviewContainer,children:[(0,t.jsx)("span",{children:"To Upload"}),(0,t.jsx)("div",{className:p().previewList,children:g.map((e,l)=>(0,t.jsx)("div",{className:p().previewContainer,children:(0,t.jsxs)("div",{className:p().previewItem,children:[(0,t.jsx)(d.default,{className:p().imagePreview,src:e.url,alt:e.name,width:100,height:100}),(0,t.jsx)("aside",{children:(0,t.jsx)(n.r,{width:18,height:18,className:p().removeFileIcon,onClick:()=>removeFile(e.name)})})]})},e.name+l))})]})]})}},59010:function(e,l,a){"use strict";a.r(l),a.d(l,{default:function(){return ImageLoader}});var t=a(85893),i=a(25675),n=a.n(i),r=a(67294);function ImageLoader(e){let{src:l,alt:a,width:i,height:o,quality:s,className:d,style:c,id:p,mouseMove:u,mouseOut:m,click:f,priority:h}=e,[g,v]=(0,r.useState)(l),_="".concat("https://brainstox-com.vercel.app/","/images/placeholder.jpg");return(0,t.jsx)(n(),{src:g,alt:a||l||"",width:i||100,height:o||100,className:d||null,style:c||null,placeholder:i<40?"empty":"blur",blurDataURL:_,id:p||null,onMouseMove:u||null,onMouseOut:m||null,onClick:f||null,quality:s||null,priority:h||void 0,onLoadingComplete:e=>{0===e.naturalWidth&&v(_)},onError:()=>{v(_)}})}},20053:function(e){e.exports={fileUploadContainer:"fileUpload_fileUploadContainer___BSo_",inputLabel:"fileUpload_inputLabel__i7LfU",dragDropText:"fileUpload_dragDropText__yaae1",uploadFileBtn:"fileUpload_uploadFileBtn__3Pcgs",formField:"fileUpload_formField__bJMTx",filePreviewContainer:"fileUpload_filePreviewContainer__t_9ez",previewList:"fileUpload_previewList__IRASR",previewContainer:"fileUpload_previewContainer__59vD4",previewItem:"fileUpload_previewItem__cRikd",imagePreview:"fileUpload_imagePreview__g3evF",removeFileIcon:"fileUpload_removeFileIcon__gAH7O"}}}]);
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.