PageSourceSearch

https://concept-print-frontend-prod-49aoz.ondigitalocean.app/_next…/account/sub-roles-6920c2319343fc33.js

js concept-print-frontend-prod-49aoz.ondigitalocean.app collected 2026-10-03 14:57:00 UTC 16,966 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8191],{82990:function(e,a,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/account/sub-roles",function(){return n(41554)}])},73930:function(e,a,n){"use strict";n.d(a,{s:function(){return i}});let i={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SubRoles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"customer"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"sub_roles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"role_id"}},{kind:"Field",name:{kind:"Name",value:"role_name"}},{kind:"Field",name:{kind:"Name",value:"role_type"}},{kind:"Field",name:{kind:"Name",value:"max_order_amount"}},{kind:"Field",name:{kind:"Name",value:"order_per_day"}}]}}]}}]}}]}},56558:function(e,a,n){"use strict";n.d(a,{C9:function(){return s},IK:function(){return c},K3:function(){return t},Pv:function(){return o},au:function(){return r},hO:function(){return u},lv:function(){return d}});var i=n(60607),l=n(2005);let t=(0,l.ZP)(i.Z)({backgroundColor:"#2196F3",color:"#FFFFFF","&:hover":{backgroundColor:"#0069d9"}});(0,l.ZP)(i.Z)({backgroundColor:"#680BC5",color:"#FFFFFF","&:hover":{backgroundColor:"#53089D"}}),(0,l.ZP)(i.Z)({backgroundColor:"#F2FF5B33",color:"#000000","&:hover":{backgroundColor:"#F2FF5B80"}});let r=(0,l.ZP)(i.Z)({backgroundColor:"#FFD630",color:"#000000",textTransform:"uppercase",fontWeight:500,fontSize:"13px",padding:"4px 10px","&:disabled":{backgroundColor:"#D1D3D4"},"&:hover":{backgroundColor:"#DCAE12"}}),o=(0,l.ZP)(i.Z)({backgroundColor:"#2e7d32",color:"#FFFFFF",textTransform:"uppercase",fontWeight:500,fontSize:"13px",padding:"4px 10px","&:hover":{backgroundColor:"#1b5e20"}}),d=(0,l.ZP)(i.Z)({backgroundColor:"#D32F2F",color:"#FFFFFF",textTransform:"uppercase",fontWeight:500,fontSize:"13px",padding:"4px 10px","&:hover":{backgroundColor:"#CC3333"}});(0,l.ZP)(i.Z)({fontSize:16,fontWeight:500,padding:"8px 16px",lineHeight:"24px",backgroundColor:"#FFFFFF",color:"#2196F3",boxShadow:"0px 3px 1px -2px rgba(0,0,0,0.2)",borderRadius:"2px","&:hover":{backgroundColor:"#FFFFFF",boxShadow:"0px 1px 5px 0px rgba(0,0,0,0.14)"}});let s=(0,l.ZP)(i.Z)({fontWeight:500,fontSize:"13px",padding:"3px 9px",backgroundColor:"#F2F2F2",color:"#000000",boxShadow:"0px 3px 1px -2px rgba(0,0,0,0.2)","&:hover":{backgroundColor:"#FFFFFF",boxShadow:"0px 1px 5px 0px rgba(0,0,0,0.14)"}}),c=(0,l.ZP)(i.Z)({fontWeight:500,fontSize:"13px",padding:"3px 9px",borderColor:"#000000",backgroundColor:"#FFFFFF",color:"#000000",boxShadow:"0px 3px 1px -2px rgba(0,0,0,0.2)","&:hover":{backgroundColor:"#F2F2F2",boxShadow:"0px 1px 5px 0px rgba(0,0,0,0.14)",borderColor:"#000000"}}),u=(0,l.ZP)(i.Z)({fontWeight:500,fontSize:"13px",padding:"3px 9px",borderColor:"#000000",backgroundColor:"#000000",color:"#FFFFFF",boxShadow:"0px 3px 1px -2px rgba(0,0,0,0.2)","&:hover":{backgroundColor:"#2F2F2F",boxShadow:"0px 1px 5px 0px rgba(0,0,0,0.14)",borderColor:"#2F2F2F"}})},84440:function(e,a,n){"use strict";n.d(a,{N:function(){return l}});var i=n(35944);function l(e){let{className:a,title:n,withHorizontalDivider:l=!0,withNoBottomMargin:t}=e;return(0,i.BX)("div",{className:`${a}`,children:[(0,i.tZ)("span",{className:"Type-XXL-Regular w-full ",children:n}),l&&(0,i.tZ)("hr",{className:`${t?"":"mb-7"}  mt-2 text-20-grey`})]})}},58115:function(e,a,n){"use strict";n.d(a,{J:function(){return l}});var i=n(35944);let l=e=>{let{name:a,className:n="",...l}=e;return(0,i.tZ)("span",{className:`material-symbols-outlined ${n}`,...l,children:a})}},42480:function(e,a,n){"use strict";n.d(a,{o:function(){return r}});var i=n(35944),l=n(4361),t=n(58115);function r(e){let{title:a,subText:n,icon:r,onClose:o,className:d,titleClassName:s,withHorizontalMargin:c,withLeftPadding:u}=e;return(0,i.BX)("div",{className:`mx-5 flex flex-col gap-2 ${u?"mt-[10px]":"my-5 "} ${d}`,children:[(0,i.BX)("div",{className:"sticky top-0 z-20 flex items-center justify-between text-60-grey",children:[(0,i.BX)("span",{className:`Type-XXL-Bold flex items-center gap-[10px] ${u?"pl-3":""} ${s}`,children:[r&&(0,i.tZ)(t.J,{name:r,className:"text-[32px]"}),(0,i.tZ)(l.cC,{id:a}),(0,i.tZ)("span",{className:"Type-XXL-Bold text-",children:n})]}),o&&(0,i.tZ)("button",{type:"button",className:"flex cursor-pointer items-center justify-center",onClick:()=>o(),children:(0,i.tZ)(t.J,{name:"close",className:"text-[24px] text-tight-black"})})]}),c&&(0,i.tZ)("hr",{className:"text-20-grey"})]})}},50511:function(e,a,n){"use strict";n.d(a,{E:function(){return s}});var i=n(35944),l=n(89555),t=n(56776),r=n(87301),o=n(56558),d=n(42480);function s(e){let{title:a,message:n,isDisplayed:s,setIsDisplayed:c,setResponse:u,callback:m,callbackArgs:p}=e,x=()=>c(!1),f=e=>{u(e),m&&(p instanceof Array?m(e,...p):p?m(e,p):m(e)),x()};return(0,i.tZ)(t.Z,{className:"z-100",open:s,onClose:x,children:(0,i.BX)("div",{className:"z-100 absolute left-[5vw] top-[20vh] flex h-auto w-[90vw] flex-col items-center rounded-[4px] bg-pure-white shadow-md md:left-[30vw] md:w-[40vw]",children:[(0,i.tZ)(d.o,{title:a,className:"mb-[20px] w-full rounded-t-[4px]",titleClassName:"Type-XXL-Bold",withLeftPadding:!0,withHorizontalMargin:!0}),(0,i.tZ)("p",{className:"mb-[40px] px-[20px]",children:n}),(0,i.BX)("div",{className:"mb-[40px] flex w-[90%] max-w-[350px] flex-col items-center justify-center gap-y-5 md:w-[35%] md:max-w-none md:flex-row md:justify-between",children:[(0,i.tZ)(r.Z,{color:"primary",className:"w-full bg-pure-white uppercase md:w-auto",variant:"outlined",onClick:()=>f(!1),size:"small",children:l.ag._("No")}),(0,i.tZ)(o.K3,{type:"button",variant:"contained",size:"small",className:"w-full bg-material-ui-blue uppercase md:w-auto ",onClick:()=>f(!0),children:l.ag._("Yes")})]})]})})}},15263:function(e,a,n){"use strict";n.d(a,{P:function(){return t}});var i=n(35944),l=n(21851);function t(){return(0,i.tZ)("div",{className:"flex w-full flex-col items-center justify-center",children:(0,i.BX)("div",{className:"flex w-[80%] flex-col gap-y-5",children:[(0,i.BX)("div",{className:"flex w-full gap-4",children:[(0,i.tZ)(l.Z,{variant:"circular",height:60,width:60,sx:{minWidth:"60px"},animation:"pulse"}),(0,i.tZ)(l.Z,{variant:"rounded",height:60,sx:{width:"100%"},animation:"pulse"})]}),(0,i.BX)("div",{className:"flex gap-4",children:[(0,i.tZ)(l.Z,{variant:"circular",height:60,width:60,sx:{minWidth:"60px"},animation:"pulse"}),(0,i.tZ)(l.Z,{variant:"rounded",height:60,sx:{width:"100%"},animation:"pulse"})]}),(0,i.BX)("div",{className:"flex gap-4",children:[(0,i.tZ)(l.Z,{variant:"circular",height:60,width:60,animation:"pulse",sx:{minWidth:"60px"}}),(0,i.tZ)(l.Z,{variant:"rounded",height:60,sx:{width:"100%"},animation:"pulse"})]})]})})}},39476:function(e,a,n){"use strict";n.d(a,{$:function(){return t}});var i=n(35944),l=n(32561);
1function t(e){let{color:a="purple",className:n="",size:t=19}=e;return(0,i.tZ)(l.Z,{style:{color:a},size:t,className:n})}},8771:function(e,a,n){"use strict";n.d(a,{$:function(){return t}});var i=n(2005),l=n(65592);let t=(0,i.ZP)(l.Z)(e=>({fontSize:16,"&.MuiTextField-root":{outline:"none","& fieldset":{borderColor:"rgba(0,0,0,0.3)"},height:"40px"},"& .MuiFormLabel-root":{fontSize:"14px",color:"#656565"},"& .MuiOutlinedInput-input":{height:"40px",paddingTop:0,paddingBottom:0,backgroundColor:"none"},"MuiOutlinedInput-root":{outline:"none",fontSize:"14px"},"& .MuiInputLabel-outlined.Mui-focused":{outline:"none"},"& .MuiOutlinedInput-root.Mui-focused .MuiOutlinedInput-input":{outline:"none"},"& .MuiOutlinedInput-notchedOutline":{paddingLeft:"4px"}}))},41554:function(e,a,n){"use strict";n.r(a),n.d(a,{default:function(){return S}});var i=n(35944),l=n(24901),t=n(64160),r=n(89555),o=n(66252),d=n(4361),s=n(6284),c=n(87301),u=n(56776),m=n(67294),p=n(56558),x=n(84440),f=n(50511),h=n(15263),b=n(39476);let v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteSubRole"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roleId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bssCompanyAccountDeleteRole"},arguments:[{kind:"Argument",name:{kind:"Name",value:"role_id"},value:{kind:"Variable",name:{kind:"Name",value:"roleId"}}}]}]}}]};var k=n(71494),g=n(31625),N=n(39639),y=n(8771);let w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SaveSubRole"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roleId"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}
1,{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roleName"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roleType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"maxOrderAmount"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"orderPerDay"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"bssCompanyAccountSaveRole"},arguments:[{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"role_id"},value:{kind:"Variable",name:{kind:"Name",value:"roleId"}}},{kind:"ObjectField",name:{kind:"Name",value:"role_name"},value:{kind:"Variable",name:{kind:"Name",value:"roleName"}}},{kind:"ObjectField",name:{kind:"Name",value:"role_type"},value:{kind:"Variable",name:{kind:"Name",value:"roleType"}}},{kind:"ObjectField",name:{kind:"Name",value:"max_order_amount"},value:{kind:"Variable",name:{kind:"Name",value:"maxOrderAmount"}}},{kind:"ObjectField",name:{kind:"Name",value:"order_per_day"},value:{kind:"Variable",name:{kind:"Name",value:"orderPerDay"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"role_id"}},{kind:"Field",name:{kind:"Name",value:"role_name"}},{kind:"Field",name:{kind:"Name",value:"role_type"}},{kind:"Field",name:{kind:"Name",value:"max_order_amount"}},{kind:"Field",name:{kind:"Name",value:"order_per_day"}}]}}]}}]},F=[{id:1,label:"View Account Dashboard",description:"Can see their account dashboard"},{id:4,label:"View And Add Address Book",description:"Can view and add Account Address"},{id:5,label:"View Stored Payment Method",description:"Can view the Stored Payment Methods like Credit Cards"},{id:6,label:"Manage Users and Roles",description:"Can manage company Users and Roles"},{id:7,label:"View All Orders",description:"Either can see all orders of the company, of only the orders made by current user."},{id:11,label:"Place Order",description:"Can go through the Checkout Process and Place Order"},{id:14,label:"Receive Order Emails",description:"Will receive order confirmation and order status update emails"}];function Z(e){let{onComplete:a,onError:n,onSuccess:l,onCancel:t,role:o}=e,[s,u]=(0,m.useState)(o?.role_type?o.role_type?.split(",").map(e=>parseInt(e)):[1,7]),x=(0,g.IB)(w,{defaultValues:{roleId:o?.role_id,roleName:o?.role_name||"",orderPerDay:1e5,maxOrderAmount:1e5,roleType:o?.role_type||"1,7,12"},onBeforeSubmit:e=>({...e,roleType:s.join(",")}),onComplete:e=>{let{errors:i,data:t}=e;i?.length?n&&n(i):l&&l(t?.bssCompanyAccountSaveRole),a&&a()}},{errorPolicy:"all"}),{handleSubmit:f,formState:h,required:b,error:v,register:Z,watch:C}=x,_=f((e,a)=>{h.errors||a?.target.reset()});return(0,i.BX)(i.HY,{children:[(0,i.BX)("form",{onSubmit:_,noValidate:!0,className:"customer-address-form grid grid-cols-1 gap-x-5 gap-y-6 md:grid-cols-2",children:[(0,i.tZ)(y.$,{type:"text",label:(0,i.tZ)(d.cC,{id:"Role Name"}),variant:"outlined",color:"primary",required:!0,className:"w-[260px] max-w-[260px]",size:"small",error:!!h.errors.roleName,...Z("roleName",{required:!0})}),(0,i.tZ)("div",{}),(0,i.BX)("div",{className:"col-span-2",children:[(0,i.tZ)("h4",{className:"Type-XXL-Medium mb-6",children:(0,i.tZ)(d.cC,{id:"Permissions"})}),F.map(e=>(0,i.BX)("div",{className:"mb-[15px] grid grid-cols-[10fr_90fr]",children:[(0,i.tZ)(N.Z,{onClick:()=>{s.includes(e.id)?u([...s.filter(a=>a!==e.id)]):u([...s,e.id])},checked:s.includes(e.id)}),(0,i.tZ)("div",{className:"flex items-center gap-[5px]",children:(0,i.tZ)("span",{children:e.label})}),(0,i.tZ)("div",{}),(0,i.tZ)("span",{className:"text-[12px]",children:e.description})]}))]}),(0,i.BX)("div",{className:"mb-[40px] mt-6 flex flex-col items-center justify-start gap-6 gap-y-5 md:flex-row",children:[(0,i.tZ)(p.K3,{type:"submit",className:"w-full max-w-[350px] bg-material-ui-blue uppercase md:w-auto",variant:"contained",loading:h.isSubmitting,size:"small",children:r.ag._("Add new role")}),(0,i.tZ)(c.Z,{color:"primary",className:"w-full max-w-[350px] bg-pure-white uppercase md:w-auto",variant:"outlined",onClick:t,size:"small",children:r.ag._("Cancel")})]})]}),(0,i.tZ)(k._,{error:v})]})}function C(e){let{roles:a=[],loading:n,refetch:l}=e,t=(0,o.x)(),[k,g]=(0,m.useState)(null),[N,y]=(0,m.useState)(!1),[w,F]=(0,m.useState)(!1),[C,_]=(0,m.useState)(!1),[S,X]=(0,m.useState)(),B=e=>{g(e),y(!0)},D=e=>{g(e),_(!0)},P=(0,m.useCallback)(async(e,a)=>{if(e)try{F(a),await t.mutate({mutation:v,variables:{roleId:a}}),F(!1),l()}catch(e){F(!1)}},[t,l]);return n?(0,i.tZ)("div",{className:"w-full",children:(0,i.BX)(s.Z,{elevation:3,className:"md:px-15 p-10 md:py-8",children:[(0,i.tZ)("span",{className:"Type-XXL-Regular w-full",children:"Manage roles"}),(0,i.tZ)("hr",{className:"mb-10 mt-2 text-20-grey"}),(0,i.tZ)(h.P,{})]})}):(0,i.BX)(s.Z,{elevation:3,className:"md:px-15 w-full p-10 md:w-[80%] md:py-8",children:[(0,i.tZ)("span",{className:"Type-XXL-Regular w-full ",children:"Manage roles"}),(0,i.tZ)("hr",{className:"mb-[40px] text-20-grey"}),(0,i.BX)("div",{children:[(0,i.BX)("div",{className:"flex flex-col",children:[(a&&0===a.length||!a)&&(0,i.tZ)("div",{children:(0,i.tZ)(d.cC,{id:"You have no roles saved yet"})}),a&&a.length>=1&&(0,i.tZ)("div",{children:a?.map(e=>e&&"number"==typeof e.role_id?i.BX("div",{className:"min-h-13 flex flex-col items-center justify-between gap-5 border-b-[1px] border-b-20-grey py-[14px] md:flex-row",children:[i.BX("div",{className:"flex w-full items-center justify-start gap-2 md:w-auto md:justify-center md:gap-5",children:[i.tZ("span",{className:"Type-XXL-Regular w-full capitalize",children:e.role_name}),w===e.role_id&&i.tZ(b.$,{})]}),i.BX("div",{className:"grid w-full grid-cols-2 items-center justify-center gap-5 md:flex md:w-auto",children:[i.tZ(c.Z,{color:"primary",className:"max-w-[350px] bg-pure-white uppercase",variant:"outlined",onClick:()=>B(Number(e.role_id)),children:r.ag._("Edit")}),i.tZ(c.Z,{color:"primary",className:"max-w-[350px] bg-pure-white uppercase",variant:"outlined",onClick:()=>D(Number(e.role_id)),children:r.ag._("Delete")})]})]}):null)})]}),(0,i.tZ)("div",{className:"mt-11 flex w-full flex-col items-center justify-center gap-[30px] md:flex-row md:justify-start",children:(0,i.tZ)(p.K3,{type:"button",className:"w-full max-w-[350px] bg-material-ui-blue uppercase md:w-auto",variant:"contained",onClick:()=>{g(null),y(!0)},size:"small",children:r.ag._("Add New Role")})})]}),(0,i.tZ)(u.Z,{onClose:()=>y(!1),open:!!N,className:"z-10",children:(0,i.BX)("div",{className:"absolute left-[5vw] top-[5vh] w-[90vw] overflow-auto rounded-md border-solid bg-pure-white lg:left-[25vw] lg:w-[50vw]",children:[k&&a&&a.find(e=>e?.role_id===k)?(0,i.BX)("div",{className:"max-h-[500px] overflow-y-auto p-10 px-10 py-6",children:[(0,i.tZ)(x.N,{title:"Edit Role"}),(0,i.tZ)(Z,{role:a.find(e=>e?.role_id===k),onSuccess:()=>{y(!1),l()},onCancel:()=>y(!1)})]}):null,!k&&(0,i.BX)("div",{className:"max-h-[500px] overflow-y-auto p-10 px-10 py-6",children:[(0,i.tZ)(x.N,{title:"Add new role"}),(0,i.tZ)(Z,{onSuccess:()=>{y(!1),l()},onComplete:()=>{},onCancel:()=>y(!1)})]})]})}),(0,i.tZ)(f.E,{title:r.ag._("Delete Role"),message:r.ag._("Are you sure that you want to delete this role?"),isDisplayed:C,setIsDisplayed:_,setResponse:X,callback:P,callbackArgs:k})]})}var _=n(73930),S=function(){let e=(0,l.k)(_.s,{fetchPolicy:"cache-and-network"}
1),a=e.data?.customer?.sub_roles;return(0,i.BX)("div",{className:"w-full",children:[(0,i.tZ)(t.V,{title:r.ag._("Manage Roles"),metaRobots:["noindex"]}),(0,i.tZ)("div",{className:"w-full",children:(0,i.tZ)(C,{roles:a||[],refetch:e.refetch,loading:e.loading})})]})}}},function(e){e.O(0,[7671,1291,7536,3636,8954,6709,9187,7802,9774,2888,179],function(){return e(e.s=82990)}),_N_E=e.O()}]);
2//# sourceMappingURL=sub-roles-6920c2319343fc33.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.