PageSourceSearch

https://b2b.igt.es/assets/getQuoteExtraFields-Cao--eJ1.js

js igt.es collected 2026-09-29 16:04:00 UTC 11,817 bytes, 2 lines download raw bytes

1import{o as Q,j as e,B as u,T as m,U as se,v as E,x as re,ak as ne,J as G,ac as V,f as ie}from"./mui-CjSKCZcK.js";import{r as g}from"./reactVendor-BAhb8EbJ.js";import{u as v}from"./lang-CQnK-FEP.js";import{r as R,bD as le,bE as de,ad as ce,aj as ue,bF as fe,ag as L,bG as pe,b3 as xe,i as he,u as N,bH as me,bu as ge,bI as be,a as Y,ae as je,t as ye,a0 as qe,a5 as _,bJ as W}from"./react-setup-9frjbjB-.js";import"./load-functions-Dhv-QuHX.js";import{b as Fe}from"./base-MZV1BjLb.js";import{q as we,m as Ie,n as ve}from"./QuoteStatus-DAULfIcd.js";import{n as K}from"./lodashEs-Cjc_9xIo.js";var k={},Ce=Q;Object.defineProperty(k,"__esModule",{value:!0});var X=k.default=void 0,De=Ce(R()),Le=e;X=k.default=(0,De.default)((0,Le.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var P={},Ne=Q;Object.defineProperty(P,"__esModule",{value:!0});var Z=P.default=void 0,Ee=Ne(R()),Se=e;Z=P.default=(0,Ee.default)((0,Se.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");function ee(a){const{children:d,title:t="",header:s,defaultOpen:o=!1,handleOnChange:r}=a,[i,c]=g.useState(o),b=()=>{c(!i)};return g.useEffect(()=>{r&&r(i)},[r,i]),g.useEffect(()=>{o&&c(o)},[o]),e.jsxs(u,{children:[e.jsxs(u,{onClick:b,sx:{display:"flex",justifyContent:"space-between",cursor:"pointer",alignItems:"center"},children:[s||e.jsx(m,{variant:"h5",children:t}),i?e.jsx(X,{}):e.jsx(Z,{})]}),e.jsx(se,{in:i,timeout:"auto",unmountOnExit:!0,children:d})]})}var O={},Te=Q;
1Object.defineProperty(O,"__esModule",{value:!0});var te=O.default=void 0,Be=Te(R()),$e=e;te=O.default=(0,Be.default)((0,$e.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help");const Ae=E(u)(({style:a})=>({"& .file-upload-area":{cursor:"pointer","& .MuiDropzoneArea-textContainer":{display:"flex",alignItems:"center",color:(a==null?void 0:a.color)||"#1976D2"},"& .MuiDropzoneArea-text":{order:1,textTransform:"uppercase",fontWeight:500,fontSize:"14px",lineHeight:"24px"}}})),ze=E(u)(a=>({display:"flex",background:a.hasdelete==="true"?"rgba(25, 118, 210, 0.3)":"rgba(0, 0, 0, 0.12)",borderRadius:"18px",padding:"6px 8px",alignItems:"center",margin:"0 0 2px",color:"rgba(0, 0, 0, 0.54)","& .fileList-name-area":{display:"flex",flex:1,alignItems:"center"},"& .fileList-name":{whiteSpace:"nowrap",textOverflow:"ellipsis",overflow:"hidden",flexGrow:1,flexBasis:"100px",maxWidth:"200px",color:"#313440",fontSize:"14px",cursor:"pointer"}})),Ue=E(m)({marginBottom:"16px",fontSize:"10px",color:"rgba(0, 0, 0, 0.38)",padding:"0 12px",textAlign:"right",wordBreak:"break-word"}),J=E(le)(()=>({transform:"rotate(45deg)",marginRight:"5px"}));function _e(a,d){const t=v(),{title:s=t("global.fileUpload.addAttachment"),tips:o=t("global.fileUpload.maxFileSizeMessage"),maxFileSize:r=2097152,fileNumber:i=3,limitUploadFn:c,acceptedFiles:b=de,onchange:y=K,fileList:f=[],allowUpload:x=!0,onDelete:p=K,isEndLoadding:I=!1,requestType:S="quoteAttachedFile"}=a,B=re().palette.primary.main,[$,l]=g.useState(!1);g.useImperativeHandle(d,()=>({setUploadLoadding:n=>l(n)}));const h=n=>n/1048576>1?"".concat((n/1048576).toFixed(1),"MB"):n/1024>1?"".concat((n/1024).toFixed(1),"KB"):"".concat(n,"B"),q=(n,F,T)=>{const{size:A,type:z}=n;let U=!1;F.forEach(oe=>{U=new RegExp(oe).test(z)||U});let D="";return U||(D=t("global.fileUpload.fileTypeNotSupported")),A>T&&(D=t("global.fileUpload.fileSizeExceedsLimit",{maxFileSize:h(T)})),D&&L.error(D),D},j=()=>(L.error(t("global.fileUpload.fileSizeExceedsLimit",{maxFileSize:h(r)})),""),w=async n=>{const F=n.length>0?n[0]:null;if(!(F&&c&&c())){if(!c&&F&&f.length>=i){L.error(t("global.fileUpload.maxFileNumber",{fileNumber:i}));return}if(F)try{l(!0);const{code:T,data:A,message:z}=await pe({file:F,type:S});T===200?y({...A,id:xe()}):L.error(z)}finally{I||l(!1)}}},C=n=>{p(n)},ae=n=>{n&&window.open(n,"_blank")};return e.jsx(ce,{isSpinning:$,children:e.jsxs(u,{sx:{padding:"12px 0 0",width:"100%"},children:[e.jsx(u,{children:f.map((n,F)=>e.jsxs(u,{children:[e.jsxs(ze,{hasdelete:((n==null?void 0:n.hasDelete)||"").toString(),children:[e.jsxs(u,{className:"fileList-name-area",children:[e.jsx(J,{}),e.jsx(m,{className:"fileList-name",onClick:()=>{ae(n.fileUrl)},children:n.fileName})]}),n.hasDelete&&e.jsx(ue,{sx:{cursor:"pointer"},onClick:()=>{C((n==null?void 0:n.id)||"")}})]}),e.jsx(Ue,{children:n.title||""})]},n.id||F))}),x&&e.jsxs(u,{sx:{display:"flex",justifyContent:"space-between",marginTop:"10px"},children:[e.jsx(Ae,{style:{color:B},children:e.jsx(fe,{dropzoneClass:"file-upload-area",Icon:J,filesLimit:1,onChange:w,showPreviews:!1,showPreviewsInDropzone:!1,maxFileSize:r,showAlerts:!1,dropzoneText:s,getDropRejectMessage:q,getFileLimitExceedMessage:j,acceptedFiles:b})}),e.jsx(ne,{title:o,sx:{fontSize:"20px",color:"rgba(0, 0, 0, 0.54)"},children:e.jsx(te,{})})]})]})})}const Me=g.forwardRef(_e);function et(a){const{allowUpload:d=!0,defaultFileList:t=[],status:s,quoteId:o}=a,r=v(),i=he(),c=N(({company:l})=>l.customer.firstName),b=N(({company:l})=>l.customer.lastName),y=N(({quoteInfo:l})=>l.draftQuoteInfo),[f]=me(),[x,p]=g.useState([]),I=g.useRef(null);g.useEffect(()=>{if(s===0){const{fileInfo:l=[]}=y||{};p(typeof l!="object"?[]:l)}else t.length&&p(t)},[t.length,s]);const S=l=>{if(y){const h={...y,fileInfo:l};i(ge(h))}},H=async l=>{var h;try{let q=[];if(s!==0){const j={fileName:l.fileName,fileType:l.fileType,fileUrl:l.fileUrl,fileSize:l.fileSize},{quoteAttachFileCreate:{attachFiles:w}}=await we({fileList:[{...j}],quoteId:o});j.id=w[0].id,q=[{...j,title:r("global.quoteAttachment.uploadedByCustomer",{createdBy:w[0].createdBy}),hasDelete:!0},...x]}else q=[{...l,title:r("global.quoteAttachment.uploadedByCustomerWithName",{firstName:c,lastName:b}),hasDelete:!0},...x],S(q);p(q)}finally{(h=I.current)==null||h.setUploadLoadding(!1)}},B=async l=>{var h,q;try{(h=I.current)==null||h.setUploadLoadding(!0);const j=x.find(C=>C.id===l),w=x.filter(C=>C.id!==l);s!==0&&j?await Ie({fileId:(j==null?void 0:j.id)||"",quoteId:o}):S(w),p(w)}finally{(q=I.current)==null||q.setUploadLoadding(!1)}},$=()=>x.filter(h=>(h==null?void 0:h.title)&&h.title.includes("by customer")).length>=3?(L.error(r("global.quoteAttachment.maxFilesMessage")),!0):!1;return e.jsx(G,{children:e.jsx(V,{sx:{p:"16px !important"},children:e.jsx(ee,{title:r("global.quoteAttachment.title"),children:e.jsx(u,{children:e.jsx(Me,{ref:I,requestType:f!=="b2b"?"customerQuoteAttachedFile":"quoteAttachedFile",isEndLoadding:!0,fileList:x,limitUploadFn:$,onchange:H,onDelete:B,allowUpload:d})})})})})}const Qe=E("div")(({padding:a="1rem",alignItems:d="flex-start",flexDirection:t="row",backgroundColor:s="white",width:o="100%",xs:r})=>({display:"flex",flexDirection:t,alignItems:d,padding:a,width:o,backgroundColor:s,...r}));function Re({status:a,quoteInfo:d}){const t=v(),{info:{quoteTitle:s,referenceNumber:o},extraFields:r=[],recipients:i}=d;return e.jsxs(u,{sx:{width:"100%"},children:[e.jsx(m,{sx:{fontWeight:400,fontSize:"24px",height:"32px"},children:t("quoteDraft.quoteInfo.title")}),e.jsxs(u,{sx:{p:"15px 0"},children:[(s||a==="Draft")&&e.jsx(m,{children:"".concat(t("quoteDraft.quoteInfo.titleText")," ").concat(s)}),(o||a==="Draft")&&e.jsx(m,{children:"".concat(t("quoteDraft.quoteInfo.referenceText")," ").concat(o)}),a==="Draft"&&!i.length?e.jsx(m,{children:t("quoteDraft.quoteInfo.ccEmailText")}):i.map(c=>e.jsx(m,{sx:{wordBreak:"break-all"},children:"".concat(t("quoteDraft.quoteInfo.ccEmailText")," ").concat(c)},"ccEmail-".concat(be.encode(c)))),r.map(c=>(c.value||a==="Draft")&&e.jsx(m,{children:"".concat(c.fieldName,": ").concat(c.value)},"extraField-".concat(c.fieldName)))]})]})}const ke=["name","email","companyName","phoneNumber"],Pe=["label","firstName","lastName","company","address","apartment","city","state","zipCode","country","phoneNumber"],Oe=["label",["firstName","lastName"],"company","address","apartment",["city","state","zipCode","country"],"phoneNumber"];function M({flag:a,title:d,info:t,status:s}){const o=a==="info"?ke:Oe,[r]=Y(),i=v(),c=s==="Draft"?"Please add ".concat(a==="Billing"?"billing":"shipping"," address "):"No ".concat(a==="Billing"?"billing":"shipping"," address"),b=a!=="info"?Pe.some(f=>t&&!!t[f]):!1,y=a==="info"||r?0:"10px";return e.jsxs(u,{sx:{width:r||a==="info"?"100%":"33.3%",paddingLeft:y},children:[e.jsx(m,{sx:{fontWeight:400,fontSize:"24px",height:"32px"},children:d}),e.jsxs(u,{sx:{p:"15px 0"},children:[(b||a==="info")&&JSON.stringify(t)!=="{}"&&o.map(f=>f==="quoteTitle"?s==="Draft"?e.jsx(m,{sx:{wordBreak:"break-all"},variant:"body1",children:"".concat(i("quoteDraft.quoteInfo.quoteTitle")).concat(t[f]||"")},f):"":typeof f=="string"?e.jsx(m,{variant:"body1",children:t&&t[f]||""},f):e.jsx(m,{variant:"body1",children:f.map((x,p)=>p===f.length-1?t[x]||"":x==="firstName"?"".concat(t[x]||""," "):t[x]?"".concat(t[x]||"",", "):"")},"".concat(f))),!b&&a!=="info"&&e.jsx(u,{children:c})]})]})}function tt({quoteAndExtraFieldsInfo:a,contactInfo:d,shippingAddress:t,billingAddress:s,handleEditInfoClick:o,status:r}){const i=v(),[c]=Y();return e.jsxs(Qe,{flexDirection:"column",xs:{boxShadow:"0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px rgba(0, 0, 0, 0.14), 0px 1px 3px rgba(0, 0, 0, 0.12)",borderRadius:"4px"},children:[e.jsxs(u,{sx:{width:"100%",display:"flex",justifyContent:"space-between",flexDirection:c?"column":"row"},children:[e.jsxs(u,{sx:{width:c?"100%":"33.3%"},children:[e.jsx(M,{title:i("quoteDraft.contactInfo.contact"),flag:"info",status:r,info:d}),e.jsx(Re,{status:r,quoteInfo:a})]}),e.jsx(M,{title:i("global.quoteInfo.billing"),flag:"Billing",status:r,info:s}),e.jsx(M,{title:i("global.quoteInfo.shipping"),flag:"Shipping",status:r,info:t})]}),o&&e.jsx(je,{sx:{mt:"10px",mb:"15px"},onClick:o,variant:"outlined",children:i("global.quoteInfo.editInfo")})]})}function at(a){const d=v(),{quoteStatus:t,quoteNotes:s=""}=a,[o,r]=g.useState(""),[i,c]=g.useState(!1),b=N(ye),y=N(qe),f=b?y.quotesCreateActionsPermission:!0,x=p=>{r((p==null?void 0:p.target.value)||""),_.dispatch(W((p==null?void 0:p.target.value)||""))};return g.useEffect(()=>{const p=_.getState().quoteInfo.draftQuoteInfo.note||"";r(p)},[]),g.useEffect(()=>{_.dispatch(W(o||""))},[o]),g.useEffect(()=>{s&&c(!0)},[s]),e.jsx(G,{children:e.jsx(V,{sx:{p:"16px !important"},children:e.jsx(ee,{title:d(t&&t==="Draft"?"global.quoteNote.message":"global.quoteNote.notes"),defaultOpen:i,children:e.jsxs(u,{sx:{padding:"16px 0"},children:[t&&t==="Draft"&&e.jsx(u,{sx:{fontSize:"16px",color:"rgba(0, 0, 0, 0.38)",mb:"16px"},children:d("global.quoteNote.messageNote")}),s?e.jsx(m,{variant:"body1",style:{whiteSpace:"pre-line",maxHeight:"400px",overflow:"auto"},children:s}):e.jsx(u,{children:f?e.jsx(ie,{multiline:!0,fullWidth:!0,rows:5,value:o,onChange:x,label:d("global.quoteNote.typeMessage"),size:"small",variant:"filled",sx:{"& .MuiFormLabel-root":{color:"rgba(0, 0, 0, 0.38)"}}}):null})]})})})})}const He=a=>a.map(t=>{const{listOfValue:s}=t,o={isExtraFields:!0,name:t.fieldName||"",label:t.labelName||"",required:t.isRequired,default:t.defaultValue||"",fieldType:t.fieldCategory||"",xs:6,variant:"filled",size:"small",id:t.id};switch(t.fieldCategory){case"dropdown":if(s){const r=s==null?void 0:s.map(i=>({label:i,value:i}));r.length>0&&(o.options=r)}break;case"number":o.max=t.maximumValue||"";break;case"multiline":o.rows=t.numberOfRows||"";break;default:o.maxLength=t.maximumLength||"";break}return o}
1),ot=async()=>{let a=[];try{const{quoteExtraFieldsConfig:d}=await ve(),t=d.filter(o=>o.visibleToEnduser);a=He(t)}catch(d){Fe.error(d)}return a};export{ee as B,Qe as C,tt as Q,at as a,et as b,ot as g};
2//# sourceMappingURL=getQuoteExtraFields-Cao--eJ1.js.map

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.