PageSourceSearch

https://getonyx.ai/static/js/3095.ea29a1af.chunk.js

js getonyx.ai collected 2026-10-05 12:06:15 UTC 7,736 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkonyx_frontend=self.webpackChunkonyx_frontend||[]).push([[3095],{53095:(e,l,s)=>{s.r(l),s.d(l,{default:()=>j});var t=s(89379),i=s(17583),n=s(9950),o=s(3951),r=s(45512),a=s(72663),d=s(99779),c=s(20998),u=s(95996),m=s(67009),v=s(9520),p=s(68165),x=s(79293),f=s(24948),g=s(29714),h=s(44414);const j=function(e){let{onSubmit:l,loading:s,handleClose:j}=e;const[b,y]=(0,n.useState)(!1),[w,N]=(0,n.useState)(null),[P,F]=(0,n.useState)(!1),A=(0,n.useRef)({}),k=(0,n.useRef)({}),C=g.Ik().shape({flag_message:g.Yj().trim().required("Description is required"),documents:g.YO().max(3,"Maximum 3 files allowed")}),I=[v.N.pdf,v.N.jpg,v.N.png,"image/jpeg","image/gif","image/webp","image/bmp","image/tiff","image/x-icon"],D=e=>l=>{var s,t;const i=null===l||void 0===l||null===(s=l.data)||void 0===s?void 0:s.status,n=null===l||void 0===l||null===(t=l.response)||void 0===t?void 0:t.result;if("done"===i&&n){var o,r,a;const s=(null===l||void 0===l||null===(o=l.data)||void 0===o?void 0:o.size)||0,t=(null===l||void 0===l||null===(r=l.data)||void 0===r?void 0:r.name)||"";A.current[n]=s,k.current[n]=t;const i=(null===e||void 0===e||null===(a=e.values)||void 0===a?void 0:a.documents)||[];if(i.length>3){(0,f.A)({type:"error",message:"Maximum 3 files allowed"});const l=i.filter(e=>("object"===typeof e?e.url:e)!==n);return delete A.current[n],delete k.current[n],void e.setFieldValue("documents",l)}const d=5;if(s/1024/1024>d){(0,f.A)({type:"error",message:"File too large. Maximum allowed size is ".concat(d," MB.")});const l=i.filter(e=>("object"===typeof e?e.url:e)!==n);return delete A.current[n],delete k.current[n],void e.setFieldValue("documents",l)}const c=5;if(i.reduce((e,l)=>{const s="object"===typeof l?l.url:l;return e+(A.current[s]||0)},0)/1024/1024>c){(0,f.A)({type:"error",message:"Total file size exceeds ".concat(c," MB. Please remove some files.")});const l=i.filter(e=>("object"===typeof e?e.url:e)!==n);return delete A.current[n],delete k.current[n],void e.setFieldValue("documents",l)}}else if("removed"===i){var d,c;const e=(null===l||void 0===l||null===(d=l.data)||void 0===d?void 0:d.name)||(null===l||void 0===l||null===(c=l.response)||void 0===c?void 0:c.result);e&&(delete A.current[e],delete k.current[e])}};return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(i.l1,{onSubmit:(e,s)=>{var i;let{resetForm:n}=s;const o=(0,t.A)((0,t.A)({},e),{},{documents:(null===(i=e.documents)||void 0===i?void 0:i.map(e=>{const l="object"===typeof e?e.url:e;return{url:l,name:k.current[l]||"",size:A.current[l]||0}}))||[]});l(o,n)},validationSchema:C,initialValues:(0,t.A)({},{flag_message:"",documents:[]}),enableReinitialize:!0,children:e=>{var l,t,n,v,f,g,w;return(0,h.jsxs)(i.lV,{children:[(0,h.jsxs)(o.A.Group,{className:"mb-3",controlId:"formGridAddress1",children:[(0,h.jsx)(o.A.Label,{className:"fw-bold",children:"Description"}),(0,h.jsx)(a.A,{placeholder:"Write here a description...",formik:e,className:"bg-light",name:"flag_message"})]}),(0,h.jsxs)(o.A.Group,{className:"mb-3",controlId:"formGridAttachments",children:[(0,h.jsx)(o.A.Label,{className:"fw-bold",children:"Attachments"}),(null===e||void 0===e||null===(l=e.values)||void 0===l||null===(t=l.documents)||void 0===t?void 0:t.length)>0&&(0,h.jsx)("div",{className:"mb-3",children:null===e||void 0===e||null===(n=e.values)||void 0===n||null===(v=n.documents)||void 0===v?void 0:v.map((l,t)=>{var i;const n="object"===typeof l?l.url:l,o=A.current[n]||null,a=null===n||void 0===n||null===(i=n.split("."))||void 0===i?void 0:i.pop(),d=(null===p.E||void 0===p.E?void 0:p.E[a])||"docImage.svg",u=(0,x.Sb)(n);return(0,h.jsxs)("div",{className:"d-flex align-items-center justify-content-between p-2 mb-2 border rounded",children:[(0,h.jsxs)("div",{className:"d-flex align-items-center flex-grow-1 cursor-pointer",onClick:()=>{N({url:n,type:u,isImage:"image"===u,isPdf:"pdf"===u||(null===n||void 0===n?void 0:n.includes(".pdf"))}),F(!0)},style:{cursor:"pointer"},children:[(0,h.jsx)("div",{className:"me-2 p-2 bg-light rounded",children:(0,h.jsx)(c.default,{source:d,width:"24"})}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"mb-0 small fw-medium",children:k.current[n]||"File ".concat(t+1)}),(0,h.jsx)("small",{className:"text-secondary d-block",children:o?(0,x.v7)(o):""})]})]}),(0,h.jsx)(r.mU,{type:"button",className:"p-1 bg-transparent border-0",onClick:l=>{l.stopPropagation(),((e,l,s)=>{var t;let i=[...null===e||void 0===e||null===(t=e.values)||void 0===t?void 0:t[l]];const n=i[s],o="object"===typeof n?n.url:n;o&&(delete A.current[o],delete k.current[o]),i.splice(s,1),e.setFieldValue(l,i)})(e,"documents",t)},disabled:s||b,children:(0,h.jsx)(c.default,{source:"closeBtn.svg",width:"16"})})]},t)})}),(!(null!==e&&void 0!==e&&null!==(f=e.values)&&void 0!==f&&f.documents)||(null===e||void 0===e||null===(g=e.values)||void 0===g||null===(w=g.documents)||void 0===w?void 0:w.length)<3)&&(0,h.jsx)(d.default,{name:"documents",uploadName:"file",validateFileType:I,customMessage:"PDF, JPG, PNG, GIF, WEBP, BMP, TIFF (SVG not allowed)",apiEndPoints:"".concat(u.A.API_BASE_URL).concat(m.A.upload),showUploadList:!1,applyImageCropper:!1,isMultiple:!0,loadingFn:y,callback:D(e),children:(0,h.jsx)("div",{className:"upload text-center p-3 rounded-2 border border-dashed",children:(0,h.jsxs)("label",{className:"upload-area d-flex flex-column align-items-center justify-content-center cursor-pointer",children:[(0,h.jsx)("span",{className:"upload-button position-relative mb-2",children:(0,h.jsx)(c.default,{source:"uploadLogo.svg",alt:"",width:"50",height:"50"})}),(0,h.jsxs)("div",{children:[(0,h.jsxs)("p",{className:"mb-1 small",children:["Drag and drop file here or"," ",(0,h.jsx)("strong",{className:"primaryClr",children:"Choose file"})]}),(0,h.jsx)("p",{className:"mb-0 text-secondary small",children:"PDF and images (max 3 files, 5MB total)"})]})]})})})]}),(0,h.jsxs)("div",{className:"text-end",children:[(0,h.jsx)(r.mU,{type:"submit",className:"text-white fw-bold primaryBorder me-3 px-4",disabled:s,children:"Save"}),(0,h.jsx)(r.mU,{type:"button",disabled:s,onClick:()=>{j()},className:"primaryClr fw-bold outline-danger bg-white px-4",children:"Cancel"})]})]})}}),(0,h.jsx)(r.zf,{show:P,handleClose:()=>{F(!1),N(null)},className:"previewModal",size:"xl",title:null!==w&&void 0!==w&&w.isImage?"Image Preview":null!==w&&void 0!==w&&w.isPdf?"PDF Preview":"File Preview",children:w&&(0,h.jsx)("div",{className:"d-flex align-items-center justify-content-center h-100",style:{minHeight:"400px"},children:w.isImage?(0,h.jsx)("div",{className:"w-100 d-flex align-items-center justify-content-center",children:(0,h.jsx)(c.default,{previewSource:w.url,source:"forumImg.jpg",className:"post-media",style:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"},alt:"Preview"})}):w.isPdf?(0,h.jsx)("div",{className:"w-100 d-flex align-items-center justify-content-center",style:{height:"70vh"},children:(0,h.jsx)("object",{data:"".concat(w.url,"#toolbar=0&navpanes=0&scrollbar=1"),type:"application/pdf",width:"100%",height:"100%",style:{border:"none"},children:(0,h.jsxs)("p",{className:"text-center",children:["Unable to display PDF file."," ",(0,h.jsx)("a",{href:w.url,target:"_blank",rel:"noopener noreferrer",children:"Download instead"})]})})}):(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("p",{children:"Preview not available for this file type"}),(0,h.jsx)(r.mU,{type:"button",onClick:()=>window.open(w.url,"_blank"),className:"text-white fw-bold primaryBorder px-4",children:"Open in New Tab"})]})})})]})}},68165:(e,l,s)=>{s.d(l,{E:()=>t});const t={xls:"excel.svg",pdf:"pdf.svg",xlsx:"excel.svg",doc:"docx.svg",docx:"docx.svg",csv:"csv.svg",txt:"txt.svg",jpg:"imageDoc.svg",jpeg:"imageDoc.svg",png:"imageDoc.svg"}}}]);

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.