PageSourceSearch

https://platform.shoffi.app/_next/static/chunks/pages/team-20068b229f79ebb7.js

js shoffi.app collected 2026-10-02 16:40:50 UTC 16,936 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9038],{9344:function(e,t,n){"use strict";n.d(t,{m:function(){return i}});var a=n(7294),r=n(9815);let i=(0,a.memo)(function({message:e,saveAction:t,discardAction:n,alignContentFlush:i,fullWidth:o,contextControl:l,secondaryMenu:s}){let{setContextualSaveBar:c,removeContextualSaveBar:u}=(0,r.x)();return(0,a.useEffect)(()=>{c({message:e,saveAction:t,discardAction:n,alignContentFlush:i,fullWidth:o,contextControl:l,secondaryMenu:s})},[e,t,n,i,c,o,l,s]),(0,a.useEffect)(()=>u,[u]),null})},1241:function(e,t,n){"use strict";n.d(t,{u:function(){return m}});var a=n(7294),r=n(3697),i={ImageContainer:"Polaris-EmptyState__ImageContainer",Image:"Polaris-EmptyState__Image",loaded:"Polaris-EmptyState--loaded",imageContained:"Polaris-EmptyState--imageContained",SkeletonImageContainer:"Polaris-EmptyState__SkeletonImageContainer",SkeletonImage:"Polaris-EmptyState__SkeletonImage"},o=n(1821),l=n(6731),s=n(9072),c=n(8369),u=n(3879),d=n(6147);function m({children:e,heading:t,image:n,largeImage:m,imageContained:p,fullWidth:S=!1,action:h,secondaryAction:g,footerContent:f}){let[E,x]=(0,a.useState)(!1),b=(0,a.useCallback)(()=>{x(!0)},[]),v=(0,r.AK)(i.Image,E&&i.loaded,p&&i.imageContained),y=m?a.createElement(c.E,{alt:"",role:"presentation",source:m,className:v,sourceSet:[{source:n,descriptor:"568w"},{source:m,descriptor:"1136w"}],sizes:"(max-width: 568px) 60vw",onLoad:b}):a.createElement(c.E,{alt:"",role:"presentation",className:v,source:n,onLoad:b}),I=(0,r.AK)(i.SkeletonImage,E&&i.loaded),P=(0,r.AK)(i.ImageContainer,!E&&i.SkeletonImageContainer),j=a.createElement("div",{className:P},y,a.createElement("div",{className:I})),A=g?(0,o.h)(g,{}):null,w=f?a.createElement(l.x,{paddingBlockStart:"400"},a.createElement(u.x,{as:"span",alignment:"center",variant:"bodySm"},f)):null,C=h?(0,o.h)(h,{variant:"primary",size:"medium"}):null,_=t?a.createElement(l.x,{paddingBlockEnd:"150"},a.createElement(u.x,{variant:"headingMd",as:"p",alignment:"center"},t)):null,N=e?a.createElement(u.x,{as:"span",alignment:"center",variant:"bodySm"},e):null,T=_||e?a.createElement(l.x,{paddingBlockEnd:"400"},_,N):null,k=C||A?a.createElement(d.g,{align:"center",gap:"200"},A,C):null,O=T||k||w?a.createElement(l.x,{maxWidth:S?"100%":"400px"},a.createElement(s.E,{inlineAlign:"center"},T,k,w)):null;return a.createElement(l.x,{paddingInlineStart:"0",paddingInlineEnd:"0",paddingBlockStart:"500",paddingBlockEnd:"1600"},a.createElement(s.E,{inlineAlign:"center"},j,O))}},5587:function(e,t,n){"use strict";n.d(t,{l:function(){return p}});var a=n(7294),r=n(3999),i=n(3697),o={Item:"Polaris-FormLayout__Item",grouped:"Polaris-FormLayout--grouped",condensed:"Polaris-FormLayout--condensed"};function l({children:e,condensed:t=!1}){let n=(0,i.AK)(o.Item,t?o.condensed:o.grouped);return e?a.createElement("div",{className:n},e):null}var s=n(9072),c=n(6147),u=n(6731),d=n(3879);function m({children:e,condensed:t,title:n,helpText:i}){let o,m;let p=(0,a.useId)(),S=null,h=null;i&&(o=`${p}HelpText`,S=a.createElement(u.x,{id:o,color:"text-secondary"},i)),n&&(m=`${p}Title`,h=a.createElement(d.x,{id:m,as:"p"},n));let g=a.Children.map(e,e=>(0,r.oh)(e,l,{condensed:t}));return a.createElement(s.E,{role:"group",gap:"200","aria-labelledby":m,"aria-describedby":o},h,a.createElement(c.g,{gap:"300"},g),S)}let p=(0,a.memo)(function({children:e}){return a.createElement(s.E,{gap:"400"},a.Children.map(e,S))});function S(e,t){return(0,r.Mc)(e,m)?e:(0,r.oh)(e,l,{key:t})}p.Group=m},3835:function(e,t,n){"use strict";n.d(t,{P:function(){return m}});var a=n(7294),r=n(248),i=n(3697),o=n(4327),l={Select:"Polaris-Select",disabled:"Polaris-Select--disabled",error:"Polaris-Select--error",Backdrop:"Polaris-Select__Backdrop",Input:"Polaris-Select__Input",Content:"Polaris-Select__Content",InlineLabel:"Polaris-Select__InlineLabel",Icon:"Polaris-Select__Icon",SelectedOption:"Polaris-Select__SelectedOption",Prefix:"Polaris-Select__Prefix",hover:"Polaris-Select--hover",toneMagic:"Polaris-Select--toneMagic"},s=n(2795),c=n(8515),u=n(6731),d=n(3879);function m({options:e,label:t,labelAction:n,labelHidden:m,labelInline:p,disabled:h,helpText:f,placeholder:x,id:b,name:v,value:y="",error:I,onChange:P,onFocus:j,onBlur:A,requiredIndicator:w,tone:C}){let{value:_,toggle:N}=(0,o.O)(!1),T=(0,a.useId)(),k=b??T,O=(0,i.AK)(l.Select,I&&l.error,C&&l[(0,i.OZ)("tone",C)],h&&l.disabled),M=(0,a.useCallback)(e=>{N(),j?.(e)},[j,N]),z=(0,a.useCallback)(e=>{N(),A?.(e)},[A,N]),R=P?e=>P(e.currentTarget.value,k):void 0,Z=[];f&&Z.push((0,c.Nh)(k)),I&&Z.push(`${k}Error`);let B=(e||[]).map(g);
1x&&(B=[{label:x,value:"",disabled:!0},...B]);let D=p&&a.createElement(u.x,{paddingInlineEnd:"100"},a.createElement(d.x,{as:"span",variant:"bodyMd",tone:C&&"magic"===C&&!_?"magic-subdued":"subdued",truncate:!0},t)),F=function(e,t){let n;let a=(n=[],e.forEach(e=>{S(e)?n=n.concat(e.options):n.push(e)}),n),r=a.find(e=>t===e.value);return void 0===r&&(r=a.find(e=>!e.hidden)),r||{value:"",label:""}}(B,y),L=F.prefix&&a.createElement("div",{className:l.Prefix},F.prefix),U=a.createElement("div",{className:l.Content,"aria-hidden":!0,"aria-disabled":h},D,L,a.createElement("span",{className:l.SelectedOption},F.label),a.createElement("span",{className:l.Icon},a.createElement(s.J,{source:r.S}))),Y=B.map(E);return a.createElement(c.jN,{id:k,label:t,error:I,action:n,labelHidden:!!p||m,helpText:f,requiredIndicator:w,disabled:h},a.createElement("div",{className:O},a.createElement("select",{id:k,name:v,value:y,className:l.Input,disabled:h,onFocus:M,onBlur:z,onChange:R,"aria-invalid":!!I,"aria-describedby":Z.length?Z.join(" "):void 0,"aria-required":w},Y),U,a.createElement("div",{className:l.Backdrop})))}function p(e){return"string"==typeof e}function S(e){return"object"==typeof e&&"options"in e&&null!=e.options}function h(e){return{label:e,value:e}}function g(e){if(p(e))return h(e);if(S(e)){let{title:t,options:n}=e;return{title:t,options:n.map(e=>p(e)?h(e):e)}}return e}function f(e){let{value:t,label:n,prefix:r,key:i,...o}=e;return a.createElement("option",Object.assign({key:i??t,value:t},o),n)}function E(e){if(S(e)){let{title:t,options:n}=e;return a.createElement("optgroup",{label:t,key:t},n.map(f))}return f(e)}},4787:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var a=n(7294),r=n(697),i=n(9815);let o=(0,a.memo)(function(e){let t=(0,a.useId)(),{showToast:n,hideToast:o}=(0,i.x)();return(0,r.H)(()=>(n({id:t,...e}),()=>{o({id:t})}),[e]),null})},7015:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/team",function(){return n(73)}])},9213:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(5893),r=n(7294),i=n(5253),o=n(3346);function l(e){let{title:t,sectioned:n,subdued:l,role:s,columnContentTypes:c,headings:u,rows:d,totals:m,sortable:p,defaultSortDirection:S,initialSortColumnIndex:h,actions:g,pageLimit:f=0,truncate:E=!0,onSort:x=null,serverMode:b=!1,total:v=0,page:y=1,onPageChange:I=null}=e,[P,j]=(0,r.useState)(null),[A,w]=(0,r.useState)(1),C=b?y||1:A,_=b?f>0?Math.ceil((v||0)/f):1:f>0?Math.ceil(d.length/f):1,N=b?d||[]:f>0?(P||d).slice((A-1)*f,A*f):P||d,T=(0,r.useCallback)((e,t)=>{if(x){x(e,t);return}j("text"===c[e]?(0,o.IS)(d,e,t):(0,o.IW)(d,e,t))},[d,c,x]);(0,r.useEffect)(()=>{if(b){j(null);return}w(1),j(null)},[d,b]);var k={truncate:E,columnContentTypes:c,headings:u,rows:N,totals:m||[],sortable:p,defaultSortDirection:S,initialSortColumnIndex:h,onSort:x||T,hideScrollIndicator:!0};return f>0&&(k.pagination={hasNext:C<_,hasPrevious:C>1,onNext:()=>{if(b){I&&C<_&&I(C+1);return}A<_&&w(A+1)},onPrevious:()=>{if(b){I&&C>1&&I(C-1);return}A>1&&w(A-1)}}),(0,a.jsx)(i.w,{...k})}},3346:function(e,t,n){"use strict";function a(e){if(null==e)return"";if("object"!=typeof e)return String(e);for(var t=e,n=0;null!=t&&"object"==typeof t&&null!=t.props&&n<6;)t=t.props.children,n++;return null==t?"":String(t)}function r(e){var t=parseFloat(a(e).replace(/[$,%]/g,"").trim());return isNaN(t)?0:t}function i(e,t,n){return[...e].sort((e,r)=>{var i=a(e[t]),o=a(r[t]);return i===o?0:"descending"===n?o>i?-1:1:i>o?-1:1})}function o(e,t,n){return[...e].sort((e,a)=>{var i=r(e[t]),o=r(a[t]);return"descending"===n?o-i:i-o})}n.d(t,{IS:function(){return i},IW:function(){return o}})},73:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return O},default:function(){return M}});var a=n(5893),r=n(7294),i=n(8512),o=n(7210),l=n(1783),s=n(142),c=n(2818),u=n(2222),d=n(9561),m=n(9344),p=n(433),S=n(1241),h=n(5587),g=n(7444),f=n(4787),E=n(1163),x=n.n(E),b=n(4473),v=n(7702),y=n.n(v),I=n(8614),P=n(6849),j=n(3835),A=n(4746),w=n(9998);function C(e){let{isOpen:t,accountId:n,handleClose:o,handleApplicationSent:l}=e,[s,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(""),[m,p]=(0,r.useState)(null),[S,h]=(0,r.useState)(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,20}$/),[f,E]=(0,r.useState)(y().PERMISSIONS_TYPES.READ),[x,v]=(0,r.useState)("Users assigned to the Viewer role have the ability to explore your account data and access detailed information regarding your affiliates, referrals, and payouts. However, they will not have permissions to perform any actions within the account. This role is ideal for those focused on marketing and analytics."),C=(0,r.useCallback)(e=>
1{d(e),p(S.test(e)?null:"This email is not valid")}),_=(0,r.useCallback)(e=>{E(e),v(e==y().PERMISSIONS_TYPES.READ?"Users assigned to the Viewer role have the ability to explore your account data and access detailed information regarding your affiliates, referrals, and payouts. However, they will not have permissions to perform any actions within the account. This role is ideal for those focused on marketing and analytics.":"Users with the Editor role can navigate your account data and have full visibility of your affiliates, referrals, and payouts. They can perform all operational actions available in the application, except for inviting new team members and modifying the subscription plan for Shoffi. This role is ideal for senior team members who require comprehensive access to manage daily operations.")}),N=(0,r.useCallback)(()=>{c(!0);var e=w.Z.getOrgScopeIdForApi(window),t=e?"user/addPermissionByAppOwner?userId=".concat(encodeURIComponent(e)):"user/addPermissionByAppOwner";b.Z.post(t,{email:u.toLowerCase(),permissionType:f}).then(e=>{c(!1),e.ans?l(!0,null):l(!1,e.err)}).catch(e=>{(0,i.logClientError)("Error:",e)})});return(0,a.jsx)("div",{style:{height:"500px"},children:(0,a.jsx)(I.u,{open:t,onClose:o,title:"Invite new team member",primaryAction:{content:"Send Invite",onAction:N,loading:s,disabled:m},secondaryActions:[{content:"Cancel",onAction:o}],children:(0,a.jsx)(I.u.Section,{children:(0,a.jsxs)(P.D,{vertical:!0,children:[(0,a.jsx)(g.n,{label:"Enter your team member email",type:"email",inputMode:"email",error:m,value:u,onChange:C}),(0,a.jsx)(j.P,{label:"Team Member type",options:[{label:"Viewer",value:y().PERMISSIONS_TYPES.READ},{label:"Editor",value:y().PERMISSIONS_TYPES.WRITE}],value:f,onChange:_}),(0,a.jsx)(A.l,{children:(0,a.jsx)("p",{children:x})})]})})})})}var _=n(9213);function N(e){let{teamMemberId:t,teamMemberName:n,isOpen:o,handleClose:l,handleAction:s}=e,c=(0,r.useCallback)(()=>{d(!0),p(!0);var e=w.Z.getOrgScopeIdForApi(window),n=e?"user/deletePermission?userId="+encodeURIComponent(e):"user/deletePermission";b.Z.post(n,{teamMemberId:t}).then(e=>{s(e.err)}).catch(e=>{(0,i.logClientError)("Error:",e)})}),[u,d]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!0);return(0,a.jsx)("div",{style:{height:"500px"},children:(0,a.jsx)(I.u,{open:o,onClose:l,title:"Are you sure you want to remove "+n+"?",primaryAction:{content:"Remove team member",onAction:c,loading:u},secondaryActions:[{content:"Go back",onAction:l}],children:(0,a.jsx)(I.u.Section,{children:(0,a.jsx)(P.D,{children:(0,a.jsx)(P.D.Item,{children:(0,a.jsx)(A.l,{children:(0,a.jsxs)("p",{children:["Removing a member will revoke any access the member had to your business.",(0,a.jsx)("br",{}),(0,a.jsx)("b",{children:"This action can't be undone."})]})})})})})})})}var T=n(6512);let k=()=>{let[e,t]=(0,r.useState)(!0),[n,E]=(0,r.useState)(!1),[v,I]=(0,r.useState)({role:"none",subscription:{type:"",status:""}}),[P,j]=(0,r.useState)(!1),[A,T]=(0,r.useState)(!1),[k,O]=(0,r.useState)(""),[M,z]=(0,r.useState)([]),[R,Z]=(0,r.useState)([]),[B,D]=(0,r.useState)(null),[F,L]=(0,r.useState)([]),[U,Y]=(0,r.useState)("descending"),[V,$]=(0,r.useState)(0),[H,q]=(0,r.useState)(!1),[K,W]=(0,r.useState)(!1),[G,X]=(0,r.useState)(y().PERMISSIONS_TYPES.NONE),[J,Q]=(0,r.useState)(!1),[ee,et]=(0,r.useState)([]),[en,ea]=(0,r.useState)(""),[er,ei]=(0,r.useState)(null),[eo,el]=(0,r.useState)(!1),[es,ec]=(0,r.useState)(!1),[eu,ed]=(0,r.useState)(""),[em,ep]=(0,r.useState)(""),eS=(e,t)=>{ed(e),ep(t),ec(!0)},eh=()=>{ec(!1)},eg=e=>{e?(O("Member removal failed. Please try again later or contact support."),T(!0),j(!P),ec(!n)):(O("Team member removed successfully"),j(!P),ec(!1),E(!n))},ef=(e,t)=>{Q(!1),j(!0),T(!e),O(e?"Invitation email was sent successfully to team member":t||"Something went wrong. Please try again later."),E(!n)},eE=async()=>{ea(v.subscription.organizationName),el(!1),ei(null)},ex=async()=>{var e=w.Z.getOrgScopeIdForApi(window),t=e?"user/updateOrganizationName?userId="+encodeURIComponent(e):"user/updateOrganizationName";await b.Z.post(t,{organizationName:en}).then(e=>{e.active&&(O("Changes saved"),j(!P),el(!1))}).catch(e=>{(0,i.logClientError)("Error:",e)})},eb=e=>{var t=[];for(let n=0;n<e.length;n++){let r=e[n].memberName?e[n].memberName:"Pending";t.push([r,e[n].email,e[n].permissionType==y().PERMISSIONS_TYPES.READ?"Viewer":"Editor",(0,a.jsx)(o.C,{tone:e[n].status==y().MEMBER_STATUS.INVITED?"info":"success",children:e[n].status}),(0,a.jsx)(l.z,{primary:!1,onClick:()=>eS(e[n].memberId,r),children:"Remove Member"})])}return t},ev=async e=>{let n=await b.Z.getAll(e);if(!n||!n.user){w.Z.redirectToLogin(window);return}var{user:a,permissionType:r,rows:i}=n;if((a.subscription.status!=y().SUBSCRIPTION_STATUS.ACTIVE||!a.subscription.isTeamFeature)&&r!=y().PERMISSIONS_TYPES.ADMIN){x().push("/subscription");return}if(r==y().PERMISSIONS_TYPES.READ||r==y().PERMISSIONS_TYPES.WRITE){x().push("/");return}w.Z.isAdminViewAs(r)?$crisp.push(["do","chat:hide"]):w.Z.setCrispSession(a,"",!1,r),I(a),ea(a.subscription.organizationName?a.subscription.organizationName:a.firstName+" "+a.lastName),et(eb(i||[])),z(["text","text","text","text","text"]),Z(["Member Name","Email","Permission Type","Status","Remove Member"]),D(null),L([!0,!0,!0,!0,!0]),Y("descending"),$(1),t(!1),r&&X(r)};return((0,r.useEffect)(()=>{let e=w.Z.buildPagePath(window,"team");try{ev(e)}catch(t){(0,i.logClientError)("Error from "+e+":",t)}},[n]),e)?(0,a.jsx)(s.y,{title:"Team",children:(0,a.jsxs)(c.A,{children:[(0,a.jsx)(c.A.Section,{children:(0,a.jsx)(u.z,{children:(0,a.jsx)(u.z.Section,{children:(0,a.jsx)(d.j,{lines:6})})})}),(0,a.jsx)(c.A.AnnotatedSection,{title:"Organization",children:(0,a.jsx)(u.z,{sectioned:!0,children:(0,a.jsx)(d.j,{lines:2})})})]})}):(0,a.jsxs)(a.Fragment,{children:[eo?(0,a.jsx)(m.m,{message:"Unsaved changes",saveAction:{onAction:()=>ex(),disabled:!/^[a-zA-Z0-9 ,.'-]+$/i.test(en)||en.length>40},discardAction:{onAction:()=>eE()}}):null,(0,a.jsxs)(p.T,{title:"Team",primaryAction:{content:"Invite team member",onAction:()=>Q(!0),disabled:ee.length>=5},children:[(0,a.jsxs)(c.A,{sectioned:!0,children:[(0,a.jsx)(u.z,{children:(0,a.jsx)(u.z.Section,{children:(0,a.jsx)(c.A,{sectioned:!0,children:0===ee.length?(0,a.jsx)(S.u,{imageContained:!0,heading:"Invite your team to Shoffi",action:{content:"Invite team member",onAction:()=>Q(!0),external:!1},secondaryAction:null,image:"/emptyStateImages/ESTeams.svg",children:(0,a.jsxs)("p",{children:["This is where you will manage your team members accounts and permissions."," "]})}):(0,a.jsx)(_.Z,{sectioned:!0,subdued:!0,role:v.role,columnContentTypes:M,headings:R,rows:ee,totals:B,sortable:F,defaultSortDirection:U,initialSortColumnIndex:V})})})}),(0,a.jsx)(c.A.AnnotatedSection,{id:"organizationSettings",title:"Organization settings",description:"This is how new team members will view your organization",children:(0,a.jsx)(u.z,{sectioned:!0,children:(0,a.jsx)(c.A,{sectioned:!0,children:(0,a.jsx)(u.z.Section,{children:(0,a.jsx)(h.l,{sectioned:!0,children:(0,a.jsx)(g.n,{label:"Organization name",autoComplete:"off",type:"text",inputMode:"text",value:en,error:er,onCh
1ange:e=>{let t=null;e.length||(t="Organization name is required"),e.length>=40&&(t="Organization name requires maximum 40 characters"),el(en!=e),ea(e),ei(t)}})})})})})})]}),P?(0,a.jsx)(f.F,{content:k,onDismiss:()=>{j(!P)},error:A}):null]}),J?(0,a.jsx)(C,{isOpen:J,user:v,handleApplicationSent:(e,t)=>ef(e,t),handleClose:()=>Q(!1)}):null,es?(0,a.jsx)(N,{isOpen:es,teamMemberId:eu,teamMemberName:em,handleAction:e=>{eg(e)},handleClose:()=>{eh()}}):null]})};k.getLayout=e=>(0,a.jsx)(T.Z,{children:e});var O=!0,M=k}},function(e){e.O(0,[5821,9620,2888,9774,179],function(){return e(e.s=7015)}),_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.