PageSourceSearch

https://www.customerlift.ai/_next/static/chunks/pages/profile/users-984c543cbb0bf703.js

js customerlift.ai collected 2026-10-05 15:31:30 UTC 6,873 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[750],{1326:function(e,t,s){"use strict";var l,r=s(7294);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(e[l]=s[l])}return e}).apply(this,arguments)}t.Z=function(e){return r.createElement("svg",i({width:"1em",height:"1em",viewBox:"0 0 14 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),l||(l=r.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m9.5 0 1 1H14v2H0V1h3.5l1-1h5ZM1 16c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V4H1v12ZM3 6h8v10H3V6Z",fill:"#000"})))}},6396:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/profile/users",function(){return s(4989)}])},6884:function(e,t,s){"use strict";var l=s(5893),r=s(5187);t.Z=e=>{let{errorMsg:t}=e;return(0,l.jsx)("div",{className:"grow flex items-center justify-center",children:t||(0,l.jsx)(r.Z,{height:90,width:90})})}},8707:function(e,t,s){"use strict";s.d(t,{Z:function(){return o}});var l=s(5893),r=s(1664),i=s.n(r);let n=[{text:"Profile Info",href:"/profile/info"},{text:"Users",href:"/profile/users"},{text:"Store Settings",href:"/profile/store-settings"},{text:"Metrics Definitions",href:"/profile/metrics-definitions"},{text:"Billing",href:"/profile/billing"}],a=e=>{let{children:t,href:s,isActive:r}=e;return(0,l.jsx)("li",{className:"".concat(r&&"border-b-2 pb-0.5 border-myPaleBlue border-0.5 md:font-bold"),children:(0,l.jsx)(i(),{href:s,legacyBehavior:!0,children:t})})};var c=e=>{let{activeLink:t}=e;return(0,l.jsx)("div",{className:"md:px-6 py-4 md:pt-10 border-b md:border-r border-black ",style:{minWidth:200},children:(0,l.jsx)("ul",{className:"flex mx-auto items-center max-w-[640px] px-4 md:px-0 md:items-start md:flex-col gap-10 whitespace-nowrap md:whitespace-normal overflow-auto",children:n.map(e=>(0,l.jsx)(a,{href:e.href,isActive:t===e.text,children:e.text},e.href))})})},o=e=>{let{children:t,activeNavLink:s}=e;return(0,l.jsxs)("div",{className:"flex flex-col md:flex-row grow",children:[(0,l.jsx)(c,{activeLink:s}),(0,l.jsx)("div",{className:"px-6 container pt-11 md:pt-14 md:px-20 pb-20",children:t})]})}},8133:function(e,t,s){"use strict";var l=s(7294),r=s(4965);t.Z=e=>{let t=(0,l.useContext)(r.z);(0,l.useEffect)(()=>(t&&t.updatePage(e),()=>null==t?void 0:t.updatePage("")),[t,e])}},4989:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return k}});var l=s(5893),r=s(7294),i=s(8707),n=s(1326),a=s(2484),c=s(6884),o=s(9669),d=s.n(o),h=s(9580),m=s(8133),x=s(1664),u=s.n(x),f=s(7195),p=s(4202),g=s(9048),j=s(4871),b=function(e){let{text:t,btnText:s,handleDelete:r,btnSvg:i,idToDelete:n,nameToDelete:a,isOpen:c,setIsOpen:o}=e;return(0,l.jsxs)(g.V,{open:c,onClose:()=>o(!1),className:"relative z-50",children:[(0,l.jsx)("div",{className:"fixed inset-0 bg-black/30","aria-hidden":"true"}),(0,l.jsx)("div",{className:"fixed inset-0 flex items-center justify-center p-4",children:(0,l.jsxs)(g.V.Panel,{className:"mx-auto max-w-xs md:max-w-lg rounded bg-white p-4 lg:p-6",children:[(0,l.jsxs)(g.V.Title,{className:"mb-5",children:["Are you sure you want to delete"," ",(0,l.jsx)("span",{className:"break-words",children:a}),"?"]}),(0,l.jsx)("p",{children:t}),(0,l.jsx)(j.Z,{onClick:()=>r(n),size:"sm",type:"button",bg:"danger",Svg:i,myClasses:"mt-7",children:s})]})})]})},v=s(9008),w=s.n(v),N=s(5811);let y=e=>{let{name:t,email:s,role:r,handleDeleteUser:i}=e;return(0,l.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4 bg-white border border-black mb-6 px-6 py-5 break-words",children:[(0,l.jsx)("p",{className:"font-bold",children:t}),(0,l.jsx)("p",{children:s}),(0,l.jsx)("p",{className:"text-end",children:r}),(0,l.jsx)("div",{className:"flex justify-end gap-6",children:(0,l.jsx)("button",{type:"button",onClick:()=>i(s),children:(0,l.jsx)(n.Z,{height:18,width:14})})})]})},Z=e=>{let{name:t,email:s,role:r,handleDeleteUser:i}=e;return(0,l.jsxs)("div",{className:"bg-white border border-black py-5 px-6 mb-4 break-words",children:[(0,l.jsx)("p",{className:"font-bold",children:t}),(0,l.jsx)("p",{className:"p-small text-myGray mt-0.5",children:r}),(0,l.jsx)("p",{className:"p-small text-myGray mt-4",children:s}),(0,l.jsx)("div",{className:"flex gap-6 mt-4",children:(0,l.jsx)("button",{type:"button",onClick:()=>i(s),children:(0,l.jsx)(n.Z,{height:18,width:14})})})]})};var k=()=>{let{user:e,isLoading:t,errorMsg:s}=(0,f.Z)(!0);(0,m.Z)("profile");let[o,x]=(0,r.useState)(null),[g,j]=(0,r.useState)(""),[v,k]=(0,r.useState)(""),[_,C]=(0,r.useState)(""),[S,E]=(0,r.useState)(!1),[O,P]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=async()=>{let e=await d().get("".concat(h.z0,"/api/user/get-all-store-users"),{withCredentials:!0});console.log(e.data),x(e.data)};try{e()}catch(e){j("Whoops, there was an error fetching users associated with this store.")}},[]);let D=e=>{x(t=>t?t.filter(t=>t.email!==e):null)},T=e=>{C(""),k(""),E(!0),P(e)},U=async e=>{try{await (0,p.z)();let t=await d().delete("".concat(h.z0,"/api/user/delete/").concat(e),{withCredentials:!0});console.log(t),k(t.data.message),D(e)}catch(e){var t,s;console.log(e),(0,N.I)(e)&&(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(t=s.data)||void 0===t?void 0:t.message)?C(e.response.data.message):C("Whoops, something went wrong.")}E(!1)};return!e||t?(0,l.jsx)(c.Z,{errorMsg:s}):(0,l.jsxs)(i.Z,{activeNavLink:"Users",children:[(0,l.jsx)(w(),{children:(0,l.jsxs)("title",{children:["Store Users | ",h.iC]})}),(0,l.jsx)(b,{btnText:"Delete",btnSvg:n.Z,handleDelete:U,idToDelete:O,nameToDelete:O,title:"Are you sure you want to delete this user?",text:"This user will no longer be able to view this 
1store's data in CustomerLift.",isOpen:S,setIsOpen:E}),(0,l.jsxs)("div",{className:"flex flex-col lg:flex-row lg:justify-between lg:items-start",children:[(0,l.jsx)("h1",{className:"mb-7",children:"Users"}),(0,l.jsx)(u(),{href:"/profile/add-user",legacyBehavior:!0,children:(0,l.jsxs)("div",{className:"flex items-center gap-3 lg:mt-2 hover:cursor-pointer mb-7 lg:mb-0",children:["Add User",(0,l.jsx)(a.Z,{fill:"#FEB094",height:12,width:12})]})})]}),(0,l.jsxs)("div",{className:"mb-4",children:[(0,l.jsx)("p",{className:"p-small text-green-600",children:v}),(0,l.jsx)("p",{className:"p-small text-red-500",children:_})]}),(0,l.jsx)("div",{className:"hidden lg:block",children:null!==o?o.map(e=>(0,l.jsx)(y,{email:e.email,name:"".concat(e.first_name," ").concat(e.last_name),role:e.role,handleDeleteUser:T},e.email)):(0,l.jsx)(c.Z,{errorMsg:g})}),(0,l.jsx)("div",{className:"lg:hidden",children:null!==o?o.map(e=>(0,l.jsx)(Z,{email:e.email,name:"".concat(e.first_name," ").concat(e.last_name),role:e.role,handleDeleteUser:T},e.email)):(0,l.jsx)(c.Z,{errorMsg:g})})]})}},9008:function(e,t,s){e.exports=s(7828)}},function(e){e.O(0,[888,774,179],function(){return e(e.s=6396)}),_N_E=e.O()}]);

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.