Sindbad~EG File Manager

Current Path : /home/infinitibizsol/public_html/auction-sync.com/static/js/
Upload File :
Current File : /home/infinitibizsol/public_html/auction-sync.com/static/js/829.02bb8ba8.chunk.js

"use strict";(self.webpackChunk_minimal_material_kit_react=self.webpackChunk_minimal_material_kit_react||[]).push([[829],{3829:(e,s,i)=>{i.r(s),i.d(s,{default:()=>S});var n=i(2791),a=i(7689),l=i(1614),t=i(3767),o=i(890),d=i(4518),r=i(3044),c=i(1889),u=i(1209),m=i(4554),h=i(5078),v=i(9709),b=(i(3609),i(5985)),p=i(4600),x=i(9434),j=i(9596),g=i(6934),f=i(9113),_=i(3240),w=i(2664),Z=i(184);const P={position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:400,bgcolor:"background.paper",border:"2px solid black",borderRadius:2,boxShadow:24,p:4},y=(0,g.ZP)("input")({clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,overflow:"hidden",position:"absolute",bottom:0,left:0,whiteSpace:"nowrap",width:1});function S(){const[e,s]=(0,n.useState)({}),[i,g]=(0,n.useState)("/assets/images/avatars/avatar_placeholder.png"),[S,N]=(0,n.useState)(!1),C=(0,a.s0)(),k=(0,x.I0)(),{userInfo:A}=(0,x.v9)((e=>e.auth)),[I,W]=(0,n.useState)(!0),[U,B]=(0,n.useState)(!1),[E,L]=(0,n.useState)(!1),[M,R]=(0,n.useState)(!1),[z,D]=(0,n.useState)(!0),O=async()=>{try{const i=await _.Z.post("".concat(f.v,"/auctioneer/get-auctioneer-profile/").concat(null===A||void 0===A?void 0:A.user_id));if(200===(null===i||void 0===i?void 0:i.status)){var e;let n=null===i||void 0===i||null===(e=i.data)||void 0===e?void 0:e.data[0];s(n),g(null!==n&&void 0!==n&&n.business_logo?"https://autocrm.infinitibizsol.com/images/"+(null===n||void 0===n?void 0:n.business_logo):"/assets/images/avatars/avatar_placeholder.png"),k((0,w.gS)({user_id:null===n||void 0===n?void 0:n.auctioneer_id,firstname:null===n||void 0===n?void 0:n.firstname,lastname:null===n||void 0===n?void 0:n.lastname,business_name:null===n||void 0===n?void 0:n.business_name,business_email:null===n||void 0===n?void 0:n.business_email,business_logo:null===n||void 0===n?void 0:n.business_logo}))}}catch(i){b.Am.error("Error while getting details")}};(0,n.useEffect)((()=>{O()}),[]);const F=e=>{if(!e)return"";const s=e.replace(/\D/g,"");if(s.length>0){var i,n,a;return null===(i=s.match(/^(\d{0,3})(\d{0,3})(\d{0,4})$/))||void 0===i||null===(n=i.slice(1))||void 0===n||null===(a=n.filter(Boolean))||void 0===a?void 0:a.join("-")}return""};return(0,Z.jsxs)(l.Z,{style:{maxHeight:"60vh"},children:[(0,Z.jsxs)(t.Z,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[(0,Z.jsx)(o.Z,{variant:"h4",sx:{mb:5},children:"Auctioner Profile"}),(0,Z.jsx)(d.Z,{variant:"contained",onClick:()=>C("/dashboard/app",{replace:!0}),children:"Back To Dashboard"})]}),(0,Z.jsxs)(t.Z,{mb:5,children:[(0,Z.jsx)("div",{className:"display-avatar",style:{marginRight:"15px"},children:(0,Z.jsx)(r.Z,{src:"object"===typeof i?URL.createObjectURL(i):i,alt:"autioneer_photo",sx:{width:120,height:120,margin:"5px auto"}})}),(0,Z.jsx)("br",{}),(0,Z.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},children:[(0,Z.jsxs)(d.Z,{component:"label",variant:"contained",tabIndex:-1,startIcon:(0,Z.jsx)(j.Z,{}),children:["Upload file",(0,Z.jsx)(y,{type:"file",accept:"image/*",onChange:e=>{const s=e.target.files[0];g(s)}})]}),(0,Z.jsx)(v.Z,{loading:M,component:"label",variant:"contained",onClick:async()=>{if("object"===typeof i){R(!0);try{const s=new FormData;s.append("business_logo",i);const n=await _.Z.patch("".concat(f.v,"/auctioneer/update-business-logo"),s);var e;if(200===(null===n||void 0===n?void 0:n.status))b.Am.success("Logo updated successfully"),k((0,w.gS)({business_logo:null===n||void 0===n||null===(e=n.data)||void 0===e?void 0:e.business_logo}))}catch(a){var s,n;b.Am.error((null===a||void 0===a||null===(s=a.response)||void 0===s||null===(n=s.data)||void 0===n?void 0:n.message)||"Error while updating logo")}R(!1)}else b.Am.warning("Please select a file")},children:"Update"})]})]}),(0,Z.jsx)(h.l0,{onSubmit:async e=>{if(e)try{B(!0);const s=await _.Z.patch("".concat(f.v,"/auctioneer/update-auctioneer-profile"),e);200===(null===s||void 0===s?void 0:s.status)&&(b.Am.success("Profile updated successfully"),B(!1),O())}catch(s){B(!1)}else b.Am.error("Invalid data!")},initialValues:{auctioneer_id:null===e||void 0===e?void 0:e.auctioneer_id,firstname:null===e||void 0===e?void 0:e.firstname,lastname:null===e||void 0===e?void 0:e.lastname,business_name:null===e||void 0===e?void 0:e.business_name,mobile_no:null===e||void 0===e?void 0:e.mobile_no,business_phone:null===e||void 0===e?void 0:e.business_phone,business_email:null===e||void 0===e?void 0:e.business_email,business_address:null===e||void 0===e?void 0:e.business_address},validate:e=>{const s={};var i;return i=e.business_email,/\S+@\S+\.\S+/.test(i)||(s.business_email="Invalid email address"),null!==e&&void 0!==e&&e.mobile_no&&12!==(null===e||void 0===e?void 0:e.mobile_no.length)&&(s.mobile_no="Invalid Mobile Number"),null!==e&&void 0!==e&&e.business_phone&&12!==(null===e||void 0===e?void 0:e.business_phone.length)&&(s.business_phone="Invalid business Phone"),s},render:e=>{let{handleSubmit:s,errors:i,form:n}=e;return(0,Z.jsxs)("form",{onSubmit:s,children:[(0,Z.jsxs)(c.ZP,{container:!0,spacing:4,children:[(0,Z.jsx)(c.ZP,{item:!0,xs:6,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"firstname",children:e=>(0,Z.jsx)(p.Z,{label:"First Name",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"lastname",children:e=>(0,Z.jsx)(p.Z,{label:"Last Name",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"business_name",children:e=>(0,Z.jsx)(p.Z,{label:"Business Name",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"business_email",children:e=>(0,Z.jsx)(p.Z,{label:"Email address",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,mt:3,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"mobile_no",format:e=>F(e),children:e=>(0,Z.jsx)(p.Z,{label:"Mobile No",type:"text",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,mt:3,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"business_phone",format:e=>F(e),children:e=>(0,Z.jsx)(p.Z,{label:"Business Phone",type:"text",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,mt:3,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"business_address",children:e=>(0,Z.jsx)(p.Z,{label:"Business Address",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:6,mt:3,children:(0,Z.jsx)(d.Z,{type:"button",variant:"outlined",onClick:()=>N(!0),children:"Change Password"})})]}),(0,Z.jsx)(c.ZP,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",m:4,children:(0,Z.jsx)(v.Z,{loading:U,size:"large",type:"submit",variant:"contained",children:"Update"})})]})}}),(0,Z.jsx)(u.Z,{open:S,onClose:()=>N(!1),"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",children:(0,Z.jsx)(m.Z,{sx:P,children:(0,Z.jsx)(h.l0,{onSubmit:async e=>{const{old_password:s,newPassword:i,confirmPassword:n}=e;if(i){if(i!==n)return void D(!1);L(!0),D(!0);try{const e=await _.Z.post("".concat(f.v,"/auctioneer/update-password"),{newPassword:i,old_password:s,auctioneer_id:null===A||void 0===A?void 0:A.user_id});200===(null===e||void 0===e?void 0:e.status)&&(b.Am.success("Password updated successfully"),N(!1))}catch(a){console.log("\ud83d\ude80 ~ changePassword ~ err:",a),b.Am.error(a.response.data.message||"Error while updating password")}L(!1)}else b.Am.warning("Password can never be empty.")},initialValues:{old_password:"",newPassword:"",confirmPassword:""},validate:e=>{const s={};return null!==e&&void 0!==e&&e.old_password||(s.old_password="Old Password is required"),s},render:e=>{let{handleSubmit:s,errors:i,form:n}=e;return(0,Z.jsx)("form",{onSubmit:s,children:(0,Z.jsxs)(c.ZP,{container:!0,spacing:4,children:[(0,Z.jsx)(c.ZP,{item:!0,xs:12,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"old_password",children:e=>(0,Z.jsx)(p.Z,{label:"Old Password",type:"text",...e})})}),(0,Z.jsx)(c.ZP,{item:!0,xs:12,children:(0,Z.jsx)(h.gN,{fullWidth:!0,name:"newPassword",children:e=>(0,Z.jsx)(p.Z,{label:"New Password",type:"text",...e})})}),(0,Z.jsxs)(c.ZP,{item:!0,xs:12,children:[(0,Z.jsx)(h.gN,{fullWidth:!0,name:"confirmPassword",children:e=>(0,Z.jsx)(p.Z,{label:"Confirm Password",type:"text",...e})}),!z&&(0,Z.jsx)(o.Z,{variant:"body2",color:"red",children:"Passwords do not match"})]}),(0,Z.jsx)(c.ZP,{item:!0,xs:12,children:(0,Z.jsx)(v.Z,{loading:E,type:"submit",variant:"contained",children:"Change Password"})})]})})}})})})]})}},9596:(e,s,i)=>{var n=i(4836);s.Z=void 0;var a=n(i(5649)),l=i(184);s.Z=(0,a.default)((0,l.jsx)("path",{d:"M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96M14 13v4h-4v-4H7l5-5 5 5z"}),"CloudUpload")}}]);
//# sourceMappingURL=829.02bb8ba8.chunk.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists