1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a38fc2d5-f6ee-4e0c-949d-69987896f728",e._sentryDebugIdIdentifier="sentry-dbid-a38fc2d5-f6ee-4e0c-949d-69987896f728")}catch(e){}}();"use strict";(globalThis.rspackChunk_clubhouse_web=globalThis.rspackChunk_clubhouse_web||[]).push([[7092],{72305(e,n,t){var r=t(54380),i=t(20820),a=t(29470),o=t(14041),l=t(41652),s=t(45108),d=t(96116);let c=(0,a.A)("span",{target:"e1pp6yot0"})({textAlign:"center",width:32,flex:"none"}),g=(0,a.A)("h3",{target:"e1pp6yot1"})({fontSize:20,margin:0}),h=(0,a.A)("div",{target:"e1pp6yot2"})(({theme:e,kind:n,size:t})=>({fontSize:15,fontWeight:400,borderRadius:6,boxSizing:"border-box",border:"1px solid transparent",margin:"20px 0",minHeight:36,gap:e.space.space1,padding:"12px 20px",position:"relative",maxWidth:620,lineHeight:"20px",..."small"===t&&{padding:"6px 10px",[`${g}`]:{margin:0,fontSize:18}},..."blue"===n&&{background:e.color.background.info,borderColor:e.color.border.focus,color:e.color.text.main,[`${c}`]:{color:e.color.info.main},...e.variations?.themeRefresh&&{background:"none",borderColor:e.color.border.secondary,[`${c}`]:{color:e.color.icon.main,width:16,borderRadius:e.radius.radius3.borderRadius}}},..."warning"===n&&{background:e.color.background.content,color:e.color.text.main,borderColor:e.color.warning.main,[`${c}`]:{color:e.color.warning.dark}},..."error"===n&&{background:e.color.error.light,borderColor:e.color.error.main,color:e.color.error.dark,[`${c}`]:{color:e.color.error.dark}}})),u=(0,a.A)(d.N,{target:"e1pp6yot3"})(({theme:e})=>({color:e.color.icon.main,fontSize:16,margin:0,position:"absolute",right:10,top:6,"&:hover":{color:e.color.icon.hover}})),p={default:"blue",info:"blue",warning:"warning",error:"error"},m={default:void 0,small:"small"},v={default:"InfoCircle",warning:"Warn",error:"RemoveCircle"},f=Object.assign(({icon:e=v.default,size:n=m.default,className:t,title:a,children:d,color:f=p.default,dismiss:b})=>{let x=(0,o.useCallback)(e=>{e.preventDefault(),"function"==typeof b&&b()},[b]);return(0,r.FD)(h,{className:t,kind:f,size:n,children:[(0,r.FD)(s.vg,{horizontally:!0,amount:"space2",align:"top",children:[(0,r.Y)(c,{children:(0,r.Y)(l.V,{icon:e,fill:"currentColor",size:"small"===n?20:28})}),(0,r.FD)(s.vg,{vertically:!0,amount:"space1",children:[a&&(0,r.Y)(g,{children:a}),d]})]}),b&&(0,r.Y)(u,{onClick:x,children:(0,r.Y)(i.In,{icon:"Close",fill:"currentColor"})})]})},{Container:h,HelpIcon:c,Title:g,icons:v,sizes:m,colors:p});t.d(n,{},{p:f})},86019(e,n,t){t.d(n,{InviteUsersPage:()=>ny});var r=t(54380),i=t(60790),a=t(14041),o=t(86090),l=t(80959),s=t(29470),d=t(21650),c=t(82240),g=t(40378),h=t(24227),u=t(94632);let p=(e,n)=>e.filter(e=>!n.includes(e)).concat(n.filter(n=>!e.includes(n)));var m=t(15355),v=t(502);let f="invitation-only",b="discoverable-and-open",x=(0,s.A)("div",{target:"eend4b0"})({maxWidth:"800px"}),Y=(0,s.A)("header",{target:"eend4b1"})({marginBottom:"24px"}),y=(0,s.A)("div",{target:"eend4b2"})({fontSize:"20px",fontWeight:"700",lineHeight:"26px",marginBottom:"10px"}),C=(0,s.A)("div",{target:"eend4b3"})({fontSize:"16px",lineHeight:"21px"}),w=(0,s.A)("section",{target:"eend4b4"})({marginBottom:"32px"}),k=(0,s.A)("div",{target:"eend4b5"})({width:"350px"}),D=(0,s.A)("span",{target:"eend4b6"})({fontWeight:"600"}),S=e=>{e.isCanceled||(0,m.z3)(e.error||e.message)},I=()=>{let[e,n]=(0,a.useState)(!1),[t,o]=(0,a.useState)(f),[l,s]=(0,a.useState)([]),[v,I]=(0,a.useState)([]),{request:A}=(0,h.b)({fn:u.n9}),{request:F}=(0,h.b)({fn:u.bw}),{request:N}=(0,h.b)({fn:u.zz}),{request:T}=(0,h.b)({fn:u.fz}),{request:z}=(0,h.b)({fn:u.Ne}),R=!!l.length,$=R?"In order to make a workspace discoverable, the domain must match the email address domain of at least one owner or admin in the workspace.":"There are no domains in this workspace that are eligible to be discoverable.";(0,a.useEffect)(()=>{let e=async()=>{try{let e=A(),t=F(),r=N(),[i,a,l]=await Promise.all([e,t,r]);i.enabled?o(b):o(f),s(a),I(l),n(!0)}catch(e){S(e)}};(0,i.c)(e())},[A,F,N]);let E=(0,a.useCallback)(async e=>{if(!t||e===t)return;let n={enabled:e===b};try{await T(n),n.enabled?(0,m.kX)("Domain matching enabled"):(0,m.kX)("Domain matching disabled"),o(e)}catch(e){S(e)}},[t,T]),_=(0,a.useCallback)(async e=>{if(v&&p(v,e).length)try{await z({domains:e}),I(n=>{let t=n.length<e.length?"enabled":"disabled",r=p(n,e)[0];return(0,m.kX)(`Domain ${t}`,{secondary:`The ${r} domain has been ${t} for auto-join.`}),e})}catch(e){S(e)}},[v,z]),M=R&&l.map(e=>({id:e,label:e}))||[];return(0,r.FD)(x,{children:[(0,r.FD)(Y,{children:[(0,r.Y)(y,{children:"Joining Worksp
1ace Permission"}),(0,r.Y)(C,{children:"Choose the Workspace signup mode."})]}),e?(0,r.FD)(r.FK,{children:[(0,r.Y)(w,{children:(0,r.Y)(c.qU,{kind:c.qU.KIND.DEFAULT,checkedValue:t,name:"domain-matching-options",onChange:(0,i.$)(E),items:[{content:(0,r.FD)(c.uz,{children:[(0,r.Y)(c.uz.Title,{children:"Invitation Only"}),(0,r.Y)(c.uz.Description,{children:"New users must be invited."})]}),value:f},{content:(0,r.FD)(c.uz,{children:[(0,r.Y)(c.uz.Title,{children:"Discoverable and open to anyone"}),(0,r.FD)(c.uz.Description,{children:["Organizations are visible and can be joined when users are signing up with email address from the domains below. (",(0,r.Y)(D,{children:"Please note:"})," The organization will be charged for any new users if you are on a paid plan.)"]})]}),value:b}]})}),t===b&&(0,r.FD)("section",{children:[(0,r.FD)(Y,{children:[(0,r.Y)(y,{children:"Your verified domains"}),(0,r.Y)(C,{children:$})]}),R&&(0,r.Y)(k,{children:(0,r.Y)(g.Dz,{onChange:(0,i.$)(_),items:M,selectedValues:v})})]})]}):(0,r.Y)(d.R,{})]})},A=({contextProps:e,...n})=>e?(0,r.Y)(v.B.Provider,{value:e,children:(0,r.Y)(I,{...n})}):(0,r.Y)(I,{...n});var F=t(7199),N=t(30038),T=t(93546),z=t(77790),R=t(35804),$=t(93864),E=t(74984),_=t(41987),M=t(72952),U=t(45250),O=t.n(U),H=t(99420),B=t.n(H),L=t(41652);let P=(0,s.A)("div",{target:"e1wgv09s0"})({cursor:"default",opacity:.5,pointerEvents:"none","a, button":{pointerEvents:"auto","&[data-on-click], &[data-on-hover]":{pointerEvents:"none"}},button:{pointerEvents:"none"}}),W=(0,s.A)("div",{target:"e1wgv09s1"})({fontSize:14,lineHeight:"20px",margin:"20px 0 18px"}),K=(0,s.A)("div",{target:"e1wgv09s2"})({margin:"18px 0",".server-message":{background:"var(--pageBackgroun
1d)",boxShadow:"0 -1px 1px rgba(0, 0, 0, 0.12) inset",boxSizing:"border-box",borderRadius:6,color:"var(--headerTextColor)",minHeight:46,maxWidth:620,padding:"12px 20px 12px 48px",position:"relative",h3:{fontWeight:700,fontSize:18,lineHeight:"24px",margin:0},"&.error":{background:"var(--errorBackground)",color:"var(--errorTextColor)","a, .server-message-icon":{color:"var(--shapes-errorMain)"}}},".server-message-icon":{fontSize:22,position:"absolute",left:16,top:14,color:"var(--fadedTextColor)"},".server-message-close":{background:"transparent",border:"none",cursor:"pointer",fontSize:18,position:"absolute",right:12,top:12,padding:4,color:"var(--fadedTextColor)",display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:"var(--headerTextColor)"}},".invite-results":{borderTop:"1px solid var(--borderColor)",margin:"6px 0 10px",paddingTop:6}}),G=(0,s.A)("div",{target:"e1wgv09s3"})({strong:{fontSize:15,lineHeight:"20px",fontWeight:600,flex:"none",width:150,paddingTop:8},".formatting-note":{marginTop:6}}),j=(0,s.A)("div",{target:"e1wgv09s4"})({display:"flex",alignItems:"flex-start",marginBottom:16}),V=(0,s.A)("div",{target:"e1wgv09s5"})({flex:1}),X=(0,s.A)("textarea",{target:"e1wgv09s6"})(({theme:e})=>({fontSize:14,lineHeight:"19px",border:"1px solid var(--borderColor)",boxShadow:"none",boxSizing:"border-box",borderRadius:4,cursor:"text",display:"block",height:160,margin:0,padding:"8px 6px",width:"100%","&:hover":{borderColor:"var(--hoverBorderColor)"},"&:focus":{borderColor:"var(--focusedElementBorderColor)",boxShadow:"0 0 3px var(--focusedElementBorderColor)",outline:"none"}})),q=(0,s.A)("div",{target:"e1wgv09s7"})({fontSize:13,lineHeight:"16px",color:"var(--fadedTextColor)",margin:0}),Z=(0,s.A)("div",{target:"e1wgv09s8"})({marginTop:8}),J=(0,s.A)("div",{target:"e1wgv09s9"})({marginTop:48,h3:{fontWeight:700,fontSize:20,lineHeight:"26px",borderBottom:"1px solid var(--shapes-borderInverted)",margin:0,padding:"0 0 8px"}}),Q=(0,s.A)("div",{target:"e1wgv09s10"})({fontSize:15,lineHeight:"16px",display:"flex",alignItems:"center",padding:"16px 4px",borderBottom:"1px solid var(--shapes-borderInverted)",gap:6,position:"relative","&:hover":{background:"var(--detailsPageBlockBackground)"}}),ee=(0,s.A)("div",{target:"e1wgv09s11"})({display:"flex",justifyContent:"center",alignItems:"center",background:"var(--shapes-backgroundTertiary)",borderRadius:30,margin:"0 5px",height:32,width:32,flexShrink:0}),en=(0,s.A)("div",{target:"e1wgv09s12"})({flex:1,overflow:"hidden",display:"flex",flexDirection:"column",minHeight:0}),et=(0,s.A)("a",{target:"e1wgv09s13"})({color:"var(--brightTextColor)",display:"block",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontSize:15,lineHeight:"20px","&:hover":{color:"var(--paragraphTextColor)"}}),er=(0,s.A)("div",{target:"e1wgv09s14"})({display:"flex",alignItems:"center",columnGap:8,rowGap:4,marginTop:8,flexWrap:"wrap"}),ei=(0,s.A)("span",{target:"e1wgv09s15"})({fontWeight:700,fontSize:12,lineHeight:"16px",background:"var(--shapes-infoMain)",borderRadius:4,color:"var(--taggedTextColor)",display:"inline-block",padding:"2px 7px",margin:"0 2px"}),ea=(0,s.A)("div",{target:"e1wgv09s16"})({fontSize:15,lineHeight:"20px",color:"var(--fadedTextColor)",fontStyle:"italic",padding:"8px 0"}),eo=(0,s.A)("span",{target:"e1wgv09s17"})({fontSize:12,lineHeight:"14px",color:"var(--fadedTextColor)",display:"block",margin:"4px 0 0"}),el=(0,s.A)("div",{target:"e1wgv09s18"})({display:"flex",alignItems:"center",gap:8,flexShrink:0}),es=(0,s.A)("a",{target:"e1wgv09s19"})({fontSize:18,padding:"4px 6px",cursor:"pointer",display:"inline-flex",alignItems:"center",color:"var(--iconGrayColor)","&:hover, &:focus":{color:"var(--iconBlueColor)"}}),ed=(0,s.A)("a",{target:"e1wgv09s20"})({fontSize:18,padding:"4px 6px",cursor:"pointer",display:"inline-flex",alignItems:"center",color:"var(--iconGrayColor)","&:hover, &:focus":{color:"var(--iconRedColor)"}}),ec=(0,s.A)("div",{target:"e1wgv09s21"})({maxWidth:600,".create-invite-link":{margin:"10px 0"}}),eg=(0,s.A)("div",{target:"e1wgv09s22"})({display:"flex",alignItems:"center",marginBottom:10,width:"100%",maxWidth:600}),eh=(0,s.A)("input",{target:"e1wgv09s23"})({fontSize:14,lineHeight:"20px",padding:6,marginTop:0,width:"100%",boxSizing:"border-box",background:"var(--shapes-backgroundTransient)",border:"1px solid var(--shapes-borderMain)",borderRadius:8,boxShadow:"0 3px 6px -2px lch(0 0 0/.022),0 1px 1px lch(0 0 0/.044)"}),eu=(0,s.A)("button",{target:"e1wgv09s24"})({fontSize:13,lineHeight:"18px",color:"var(--fadedTextColor)",background:"transparent",border:"none",padding:"4px 0",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:6,"&:hover":{color:"var(--iconRedColor)"},"&:disabled":{opacity:.5,cursor:"not-allowed"}}),ep=(0,s.A)("div",{target:"e1wgv09s25"})(({success:e})=>({fontWeight:700,fontSize:14,lineHeight:"20px",margin:"3px 0 0",position:"relative",display:"flex",alignItems:"flex-start",ga
1p:6,color:e?"var(--successTextColor)":"var(--inlineCodeTextColor)",".fa":{fontSize:18,width:18,flexShrink:0,marginTop:1,color:e?"var(--iconGreenColor)":"var(--iconRedColor)"},"> div":{flex:1,minWidth:0}})),em=(0,s.A)("div",{target:"e1wgv09s26"})({fontSize:12,lineHeight:"16px",color:"var(--shapes-errorMain)",fontWeight:400,marginTop:2}),ev=(0,s.A)("div",{target:"e1wgv09s27"})({display:"flex",alignItems:"center",gap:8,padding:"12px 16px",backgroundColor:"var(--backgroundColor-secondary, #f5f5f5)",borderRadius:4,marginBottom:16,fontSize:14}),ef=(0,s.A)("div",{target:"e1wgv09s28"})({fontSize:14,lineHeight:"18px",background:"var(--formHelpMessageBackground)",border:"var(--formHelpMessageBorder)",borderRadius:6,boxSizing:"border-box",boxShadow:"0 -1px 0 rgba(0, 0, 0, 0.12) inset",color:"var(--headerTextColor)",margin:"20px 0",minHeight:60,padding:"12px 20px",position:"relative",maxWidth:620,".fa-info-circle":{marginRight:4}}),eb=(0,s.A)("div",{target:"e1wgv09s29"})({borderBottom:"1px solid var(--shapes-borderInverted)",margin:"0 0 18px",maxWidth:800,"&::after":{content:'""',display:"table",clear:"both"}}),ex=(0,s.A)("button",{target:"e1wgv09s30"})(({isActive:e})=>({fontWeight:700,fontSize:15,lineHeight:"18px",background:"transparent",border:"1px solid transparent",borderRadius:"5px 5px 0 0",boxShadow:"none",color:e?"var(--brightTextColor)":"var(--fadedTextColor)",cursor:e?"default":"pointer",float:"left",margin:"0 -1px 0 0",outline:"none",padding:"10px 16px",position:"relative",top:1,...e&&{background:"transparent",borderColor:"var(--shapes-borderInverted)",borderBottom:"1px solid var(--shapes-backgroundContent)",boxShadow:"none",zIndex:2},...!e&&{"&:hover, &:focus":{background:"transparent",color:"var(--headerTextColor)"}}})),eY=(0,s.A)("div",{target:"e1wgv09s31"})({maxWidth:600,".form-input":{width:"100%",marginBottom:0}});function ey({invites:e,isReadOnly:n,showResendButton:t,onResend:i,onDelete:o}){let l=(0,a.useMemo)(()=>[...e].sort((e,n)=>new Date(n.created_at).getTime()-new Date(e.created_at).getTime()),[e]);return(0,r.FD)(J,{children:[(0,r.Y)("h3",{children:"Invited Users"}),n?(0,r.Y)(P,{children:(0,r.Y)(eC,{invites:l,isReadOnly:n,showResendButton:t,onResend:i,onDelete:o})}):(0,r.Y)(eC,{invites:l,isReadOnly:n,showResendButton:t,onResend:i,onDelete:o})]})}function eC({invites:e,isReadOnly:n,showResendButton:t,onResend:i,onDelete:a}){return 0===e.length?(0,r.Y)(ea,{children:"No active invites found."}):(0,r.Y)(r.FK,{children:e.map(e=>(0,r.FD)(Q,{children:[(0,r.Y)(ee,{children:(0,r.Y)(L.V,{icon:"User",size:18})}),(0,r.FD)(en,{children:[(0,r.Y)(et,{href:`mailto:${e.email}`,children:e.email}),(0,r.FD)(er,{children:[(0,r.Y)(ei,{children:O().upperFirst(e.role)}),(0,r.FD)(eo,{children:["Invited ",B()(e.created_at).fromNow()]})]})]}),!n&&(0,r.FD)(el,{children:[t&&(0,r.Y)(es,{href:"#",onClick:n=>{n.preventDefault(),i(e)},title:"Re-send invite",children:(0,r.Y)(L.V,{icon:"Sync",size:18})}),(0,r.Y)(ed,{href:"#",onClick:n=>{n.preventDefault(),a(e)},title:"Delete invite",children:(0,r.Y)(L.V,{icon:"Trash",size:18})})]})]},e.id))})}var ew=t(77450),ek=t(79716),eD=t(86426),eS=t(52189),eI=t(36450),eA=t(72305),eF=t(8059),eN=t(51668);let eT=(0,s.A)("div",{target:"e8bly4x0"})({display:"flex",alignItems:"center",position:"relative",padding:"15px 0","&:not(:last-of-type)":{borderBottom:"1px solid var(--borderColor)"}}),ez=(0,s.A)("div",{target:"e8bly4x1"})({paddingLeft:70}),eR=(0,s.A)("div",{target:"e8bly4x2"})({position:"absolute",right:10,top:"50%",transform:"translateY(-50%)"}),e$=(0,s.A)("div",{target:"e8bly4x3"})({position:"absolute",right:90,top:"50%",transform:"translateY(-50%)"}),eE=(0,s.A)("h6",{target:"e8bly4x4"})({margin:0,fontWeight:600,fontSize:15,lineHeight:"20px",color:"var(--brightTextColor)"}),e_=(0,s.A)("span",{target:"e8bly4x5"})({margin:0,color:"var(--fadedTextColor)",fontSize:13,lineHeight:"18px"}),eM=({isActive:e,isInvited:n,isRejected:t,isLoading:i,onInviteClick:a})=>e?(0,r.FD)(r.FK,{children:["Active ",(0,r.Y)("i",{className:"fa fa-check-circle"})]}):n?(0,r.FD)(r.FK,{children:["Invited ",(0,r.Y)("i",{className:"fa fa-check-circle"})]}):t?(0,r.FD)(r.FK,{children:["Rejected ",(0,r.Y)("i",{className:"fa fa-minus-circle"})]}):i?(0,r.Y)("span",{className:"fa fa-spin fa-star"}):(0,r.Y)(ek.$n,{onClick:a,size:ek.$n.SIZE.MEDIUM,fit:ek.$n.FIT.WIDE,kind:ek.$n.KIND.PRIMARY,children:"Invite"}),eU=({contact:e,isInvited:n,isActive:t,isRejected:i,isLoading:o,invite:l})=>{let[s,d]=(0,a.useState)("member");return(0,r.FD)(eT,{className:"google-contact-list-item",children:[(0,r.Y)(eF.eu,{profile:{id:e.email,mention_name:e.name,entity_type:"Profile",name:e.name,display_icon:e.ph
1oto?{url:e.photo}:void 0,email_address:e.email},size:eF.eu.SIZE.L}),(0,r.FD)(ez,{className:"google-contact-info",children:[(0,r.Y)(eE,{className:"google-contact-name",children:e.name}),(0,r.Y)(e_,{className:"google-contact-email",children:e.email})]}),!t&&!n&&(0,r.Y)(e$,{className:"google-contact-role",children:(0,r.Y)(eN._,{onItemSelected:d,value:s})}),(0,r.Y)(eR,{className:"google-contact-action",children:(0,r.Y)(eM,{isInvited:n,isActive:t,isLoading:o,isRejected:i,onInviteClick:()=>l(e,s)})})]})};var eO=t(57663),eH=t(95501);let eB=(0,s.A)(ew.M,{target:"e19rwn730"})({fontSize:18,lineHeight:"25px",letterSpacing:"0.21px",padding:"10px 0 10px 15px",maxWidth:300,display:"inline-flex",boxShadow:"0 2px 1px rgba(0,0,0,0.14), 0 0 0 1px rgba(0,0,0,0.1)",color:"var(--brightTextColor)",backgroundColor:"transparent",borderRadius:5,border:"none",boxSizing:"border-box",cursor:"pointer",justifyContent:"center",alignItems:"center",outline:"none",height:44,position:"relative",textAlign:"center",width:"100%","&:hover":{color:"var(--headerTextColor)",background:"var(--flatWhiteButtonHoverBackgroundColor)"},...(0,eO.mO)({fontWeight:500})}),eL=(0,s.A)("div",{target:"e19rwn731"})({width:50,height:"100%",position:"absolute",top:0,left:0,display:"flex",alignItems:"center",justifyContent:"center"}),eP=({href:e,text:n="Invite Google Contacts"})=>(0,r.FD)(r.FK,{children:[(0,r.Y)("style",{children:"@import url('https://fonts.googleapis.com/css?family=Roboto:500');"}),(0,r.FD)(eB,{href:e,children:[(0,r.Y)(eL,{children:(0,r.Y)(eH.N,{})}),n]})]}),eW=(0,s.A)("div",{target:"e10l40du0"})({fontSize:16,lineHeight:"21px",margin:"0 0 16px"}),eK=({email:e})=>(0,r.FD)(r.FK,{children:["Error inviting ",(0,r.Y)("b",{children:e})]}),eG=({contacts:e,canInviteObservers:n,invite:t,onClickClearInvites:i,oauthURL:o})=>{let l=(0,a.useCallback)(e=>(0,eD.C9)(e.email),[]),s=(0,a.useCallback)(e=>(0,N.EC)(e.email),[]),{invitedUsers:d,uninvitedUsers:c}=(0,a.useMemo)(()=>{let n=[],t=[];return Object.values(e).forEach(e=>{l(e)||s(e)?n.push(e):t.push(e)}),{invitedUsers:n,uninvitedUsers:t}},[e,l,s]),g=e=>({contact:e,isLoading:e.isLoading,isRejected:e.isRejected,isInvited:s(e),isActive:l(e),canInviteObservers:n,invite:t});return(0,r.FD)(r.FK,{children:[!!c.length&&(0,r.FD)("div",{className:"existing-invites",children:[(0,r.Y)("h3",{children:"Uninvited users"}),c.map(e=>(0,r.Y)(eU,{...g(e)},e.resourceName))]}),!!d.length&&(0,r.FD)("div",{className:"existing-invites",children:[(0,r.Y)("h3",{children:"Invited users"}),d.map(e=>(0,r.Y)(eU,{...g(e)},e.resourceName))]}),(0,r.Y)(eZ,{href:o,target:"_self",children:"Refresh Google Contacts"}),(0,r.Y)(eZ,{href:"#",onClick:i,children:"Clear Google Contacts"})]})},ej=({oauthURL:e})=>(0,r.FD)(r.FK,{children:[(0,r.FD)(eW,{children:["Invite teammates from your Google Contacts to ","Shortcut",". You can select which contacts to invite."," ",(0,r.Y)("a",{href:eS.e.MANAGE_INVITES,rel:"noopener noreferrer",children:"Learn more"}),"."]}),(0,r.Y)(eP,{href:e})]}),eV=(0,s.A)("div",{target:"e10l40du1"})({padding:20,paddingTop:0}),eX=(0,s.A)("div",{target:"e10l40du2"})({fontSize:14,lineHeight:"19px"}),eq=(0,s.A)("div",{target:"e10l40du3"})({display:"flex",justifyContent:"flex-end",marginTop:24,"& .clear-contacts-dialog-cta + .clear-contacts-dialog-cta":{marginLeft:16}}),eZ=(0,s.A)(ew.M,{target:"e10l40du4"})({fontSize:"var(--font-size-m)",lineHeight:"var(--line-height-m)",display:"block",textAlign:"right",margin:"10px 10px 0"}),eJ=({getContacts:e,clearContacts:n,onInvited:t,canInviteObservers:i,redirectToInviteByEmailTab:o,defaultError:l,errorTypes:s})=>{let d,c,g,h=(c=JSON.stringify({workspace:{slug:(d=(0,u.wA)()).url_slug,id:d.id}}),g=`${window.location.protocol}//${window.location.host}/oauth/contacts`,`https://accounts.google.com/o/oauth2/v2/auth?response_type=token&client_id=${window._GOOGLE_CLIENT_ID}&scope=https://www.googleapis.com/auth/contacts.readonly%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/directory.readonly&redirect_uri=${g}&state=${c}&prompt=select_account`),[p,m]=(0,a.useState)(void 0),[v,f]=(0,a.useState)(!1),[b,x]=(({getContacts:e})=>{let n=Object.fromEntries(e().map(e=>{let n=O().get(e,"photos.0.url"),t=O().get(e,"names.0.displayName",""),r=O().get(e,"emailAddresses.0.value","");return[e.resourceName,{resourceName:e.resourceName,name:t,email:r,photo:n}]}));return(0,a.useState)(n)})({getContacts:e}),Y=(0,a.useCallback)(e=>{e.preventDefault(),f(!0)},[]),{INVALID_EMAIL_ERROR_TYPE:y,NO_CONTACTS_ERROR_TYPE:C}=s,w=(0,a.useCallback)(()=>{m(void 0),x({}),n(),f(!1)},[n,x]),k=(0,a.useCallback)((e,n)=>{x({...b,[e]:{...b[e],...n}})},[b,x]),D=(0,a.useCallback)(async(e,n)=>{k(e.resourceName,{isLoading:!0});let i=[{email:e.email,role:n}];try{await (0,N.ZG)(i,{actionContext:"settings:google-contacts"}),k(e.resourceName,{isLoading:!1}),t()}catch(n){m({content:n.reason||(0,r.Y)(eK,{email:e.email})}),k(e.resourceName,{isRejected:!0,isLoading:!1})}},[t,k]);return(0,a.useEffect)(()=>{let e={[y]:{title:"Invalid email",content:"Please authenticate with Google using the default email address for your Shortcut account."},[C]:{title:"You have no contacts to import",content:(0,r.FD)("span",{children:["Add contacts to your Google account and try again or"," ",(0,r.Y)(ew.M,{href:"#",onClick:o,children:"invite by email"}),"."]})}};l&&m(e[l])},[l,y,C,o]),(0,r.FD)(r.FK,{children:[p&&(0,r.Y)(eA.p,{title:p.title,icon:eA.p.icons.error,color:eA.p.colors.error,size:eA.p.sizes.small,children:p.content}
1),Object.keys(b).length>0?(0,r.Y)(eG,{contacts:b,canInviteObservers:i,invite:D,onClickClearInvites:Y,oauthURL:h}):(0,r.Y)(ej,{oauthURL:h}),v&&(0,r.Y)(eI.l,{close:()=>f(!1),"data-perma-id":"clear-google-contacts-dialog",size:eI.l.SIZE.SMALL,showClose:!0,titleBarProps:{title:"Are You Sure You Want To Clear Your Google Contacts from Shortcut?"},children:(0,r.FD)(eV,{children:[(0,r.FD)(eX,{children:["If you proceed, your Google Contacts list will be removed from ","Shortcut",".",(0,r.Y)("br",{}),"Any invites already sent to your contacts can still be accepted."]}),(0,r.FD)(eq,{children:[(0,r.Y)(ek.$n,{className:"clear-contacts-dialog-cta",kind:ek.$n.KIND.SECONDARY,onClick:()=>f(!1),children:"Cancel"}),(0,r.Y)(ek.$n,{className:"clear-contacts-dialog-cta",kind:ek.$n.KIND.SECONDARY,onClick:w,children:"Continue"})]})]})})]})},eQ=({contextProps:e,...n})=>e?(0,r.Y)(v.B.Provider,{value:e,children:(0,r.Y)(eJ,{...n})}):(0,r.Y)(eJ,{...n});var e0=t(10227);let e1=()=>e0.A.getCurrentOrgContactsWithEmail(),e2=()=>e0.A.clearContacts();var e4=t(92831);function e6({errorType:e,onInviteSuccess:n,onSwitchToEmailTab:t}){let{paymentPlan:i}=(0,z.yl)();if(!i)return null;let a=(0,z.Xq)(i);return(0,r.Y)(eQ,{getContacts:e1,clearContacts:e2,onInvited:n,canInviteObservers:a,redirectToInviteByEmailTab:t,errorTypes:{INVALID_EMAIL_ERROR_TYPE:e4.px,NO_CONTACTS_ERROR_TYPE:e4.sx},defaultError:e})}var e9=t(12593),e8=t(96104),e5=t(98810),e3=t(45108),e7=t(83770),ne=t(57911),nn=t(77662),nt=t(20072);let nr=e=>e.filter(e=>"None"!==e),ni=()=>(0,r.Y)("span",{children:(0,r.Y)(L.V,{icon:"ChevronDown",size:16})}),na=({teamId:e})=>{let n=(0,nt.dB)({id:e});return(0,r.FD)(e3.vg,{align:"center",horizontally:!0,amount:"space2",children:[(0,r.Y)(e7.P,{iconUrl:n?.display_icon?.url}),(0,r.Y)("span",{children:n?.name})]})},no=(0,a.forwardRef)((e,n)=>{let t=nr(e.value);return(0,r.Y)(e5.Lk,{ref:n,...e,value:t,children:(0,r.Y)(ek.$n,{kind:ek.$n.KIND.SECONDARY,size:ek.$n.SIZE.MEDIUM,fit:ek.$n.FIT.MEDIUM,IconRight:ni,children:0===t.length?"None":1===t.length?(0,r.Y)(na,{teamId:t[0]}):`${t.length} Teams`})})});function nl({onChange:e,value:n}){let{groups:t}=(0,nt._i)(),[i,o]=(0,a.useState)([]),l=(0,a.useMemo)(()=>t.filter(e=>!e.archived).sort((e,n)=>e.name.toLowerCase().localeCompare(n.name.toLowerCase())),[t]),s=(0,a.useCallback)(n=>{let t=nr(n);o(t),e&&e(t.join(","))},[e]),d=l.length+1;return(0,r.Y)(ne.Ev,{users:nn.t,teams:l,selectedValues:i,onChange:s,isSearchOnly:!1,maxSelected:d,allowMultipleSelections:!0,TargetComponent:no})}var ns=t(6847),nd=t(9911),nc=t(80824),ng=t(36233),nh=t(88434);let nu=()=>nh.A.open();var np=t(10435),nm=t(13687);function nv({isReadOnly:e,onInviteSuccess:n}){let{paymentPlan:t}=(0,z.yl)(),o=t&&((0,z._P)(t)||!(0,z.cM)(t,nd.P.ROLE_CREATE_MEMBER))?"admin":"member",{control:s,handleSubmit:d,reset:c}=(0,nc.mN)({defaultValues:{emails:"",role:o,group_ids:""}}),[g,h]=(0,a.useState)(!1),[u,p]=(0,a.useState)(null);if(!t)return null;let m=(0,z.Vk)(t),v=(0,z.Yn)(t),f=(0,z.eo)(t),b=(0,z.He)(t),x=async e=>{let t=e.emails.trim();if(t){h(!0);try{let r=(0,N.tH)({emails:t,role:e.role,group_ids:e.group_ids});(0,np.aH)(new ng.HA({emails_submitted:r.invites.length,teams_submitted:r.invites[0].group_ids.length}));let a=await (0,N.ZG)(r.invites,{actionContext:"settings"});(0,i.c)((0,nm.N2)("create-invite")),p(a),n()}catch(e){Array.isArray(e)?p(e):(0,l.$U)({kind:"alert",timeout:1e4,Content:()=>(0,r.Y)(l.XM,{children:e?.message||"Unable to send invites."})})}finally{h(!1)}}};return e?(0,r.FD)(r.FK,{children:[(0,r.Y)(e8.C,{description:"Only owners and admins can invite users."}),(0,r.Y)(P,{children:(0,r.Y)(nf,{control:s,isReadOnly:!0,isProfitable:m,canInvite:v,seatsRemaining:f,planName:b,isSending:g,onSubmit:(0,i.$)(d(x))})})]}):m||v?u?(0,r.Y)(nb,{results:u,onSendMore:e=>{e.preventDefault(),p(null),c()}}):(0,r.Y)(nf,{control:s,isReadOnly:!1,isProfitable:m,canInvite:v,seatsRemaining:f,planName:b,isSending:g,onSubmit:(0,i.$)(d(x))}):(0,r.FD)(ef,{children:[(0,r.Y)("span",{className:"fa fa-info-circle"}),(0,r.FD)("span",{children:["The ",b," plan has ",f," seats remaining. Please"," ",(0,r.Y)(ek.$n,{kind:ek.$n.KIND.LINK,onClick:nu,children:"add a Credit Card"})," ","to invite additional users and upgrade Plan."]})]})}function nf({control:e,isReadOnly:n,isProfitable:t,canInvite:i,seatsRemaining:a,planName:o,isSending:l,onSubmit:s}){return i||n?(0,r.FD)(r.FK,{children:[(0,r.FD)(W,{className:"hide-on-success",children:[!t&&(0,r.FD)(r.FK,{children:["You currently have"," ",(0,r.Y)("strong",{children:(0,e9.td)({count:a,singular:"User",plural:"Users"})})," remaining on the"," ",(0,r.FD)("strong",{children:[o," Plan"]}),"."," "]}),(0,r.Y)(ns.l,{})]}),(0,r.FD)(G,{children:[(0,r.FD)(j,{className:"blurb hide-on-success invite-as-role",children:[(0,r.Y)("strong",{children:"Role"}),(0,r.Y)(V,{children:(0,r.Y)(nc.xI,{control:e,name:"role",render:({field:e})=>(0,r.Y)(eN._,{isDisabled:n,name:"role",onItemSelected:n=>e.onChange(n),value:e.value})})})]}),(0,r.FD)(j,{className:"form-input hide-on-success",children:[(0,r.Y)("strong",{children:"Email Address"}),(0,r.FD)(V,{children:[(0,r.Y)(nc.xI,{control:e,name:"emails",render:({field:e})=>(0,r.Y)(X,{name:"emails",placeholder:"[email protected]",value:e.value,onChange:e.onChange,readOnly:n,disabled:n})}),(0,r.Y)(q,{className:"hide-on-success formatting-note",children:"Please add email addresses one per line or separated by commas."})]})]}),(0,r.FD)(j,{className:"blurb hide-on-success invite-as-team",children:[(0,r.Y)("strong",{children:"Team"}),(0,r.Y)(V,{children:(0,r.Y)(nc.xI,{control:e,name:"group_ids",render:({field:e})=>(0,r.Y)(nl,{onChange:e.onChange,value:e.value})})})]}),(0,r.FD)(j,{className:"form-action hide-on-success",children:[(0,r.Y)("strong",{}),(0,r.Y)(V,{children:(0,r.Y)(Z,{children:(0,r.Y)("button",{className:`action ${n?"disabled":"green"}`,disabled:n||l,onClick:e=>{e.preventDefault(),s()},children:l?"Sending...":"Send Invites"})})})]})]})]}):null}function nb({results:e,onSendMore:n}){let t=e.filter(e=>e.created).length,i=e.length-t,a=[];return t&&a.push((0,e9.td)({count:t,singular:"invite",plural:"invites"})+" sent"),i&&a.push((0,e9.td)({count:i,singular:"invite",plural:"invites"})+" failed"),(0,r.Y)(K,{children:(0,r.FD)("div",{className:"server-message",children:[(0,r.Y)("span",{className:"server-message-icon fa fa-envelope"}),(0,r.Y)("button",{className:"server-message-close",onClick:n,"aria-label":"Dismiss",children:(0,r.Y)("span",{className:"fa fa-times"})}),(0,r.FD)("h3",{children:[a.join(", "),":"]}),(0,r.Y)("div",{className:"invite-results",children:e.map((e,n)=>(0,r.FD)(ep,{success:e.created,children:[(0,r.Y)("span",{className:`fa ${e.created?"fa-check":"fa-times"}`}),(0,r.FD)("div",{children:[e.email,!e.created&&e.reason?(0,r.Y)(em,{children:e.reason}):null]})]},n))}),(0,r.Y)(ek.$n,{kind:ek.$n.KIND.SECONDARY,size:ek.$n.SIZE.SMALL,onClick:n,children:"Send more"})]})})}function nx({isReadOnly:e}){let[n,t]=(0,a.useState)(T.C9),[o,s]=(0,a.useState)(!1),[d,c]=(0,a.useState)(null),g=async()=>{s(!0),c(null);try{let e=await (0,T.qu)();t(e)}catch(e){c(e?.message||"Unable to create an invite link."),t(void 0)}finally{s(!1)}},h=async e=>{if(e.preventDefault(),n){s(!0),c(null);
1try{await (0,T.VD)(n.id),t(void 0)}catch(e){c(e?.message||"Unable to disable invite link.")}finally{s(!1)}}},u=(0,i.$)(async()=>{n?.url&&(await navigator.clipboard.writeText(n.url),(0,l.$U)({kind:"success",timeout:3e3,Content:()=>(0,r.Y)(l.XM,{children:"Link copied to clipboard"})}))});return e?(0,r.Y)(e8.C,{description:"Only owners and admins can invite users."}):(0,r.FD)(ec,{children:[d&&(0,r.Y)(K,{children:(0,r.FD)("div",{className:"server-message error",children:[(0,r.Y)("span",{className:"fa fa-exclamation-circle"})," ",d]})}),n?(0,r.FD)(r.FK,{children:[(0,r.FD)(eg,{className:"inline-form centered",children:[(0,r.Y)("div",{className:"form-input",style:{flex:1},children:(0,r.Y)(eh,{value:n.url,readOnly:!0,placeholder:"Invite your team by sharing a link",id:"inviteLink",onClick:e=>e.target.select()})}),(0,r.Y)("div",{className:"form-action",children:(0,r.Y)(ek.$n,{kind:ek.$n.KIND.PRIMARY,onClick:u,children:"Copy"})})]}),(0,r.FD)(eu,{onClick:(0,i.$)(h),disabled:o,children:[(0,r.Y)(L.V,{icon:"Trash",size:14})," Disable invite link"]})]}):(0,r.FD)(r.FK,{children:[(0,r.Y)(ek.$n,{kind:ek.$n.KIND.PRIMARY,isDisabled:o,onClick:(0,i.$)(g),children:o?"Generating...":"Generate Link"}),(0,r.FD)(q,{children:["Create a link to quickly invite your team to ","Shortcut"," as Members."]})]})]})}function nY(){(0,_.J)({title:"Invite Users | Shortcut"});let{org:e}=(0,u.P9)(),{paymentPlan:n}=(0,z.yl)(),t=(0,o.zy)(),[s,d]=(0,a.useState)(0),c=(0,a.useMemo)(()=>new URLSearchParams(t.search),[t.search]),g=(0,a.useMemo)(()=>{let e=c.get("tab");return e&&e in e4.T2?e:e4.rA},[c]),h=c.get("error")||void 0,[p,m]=(0,a.useState)(g),v=!(0,$._t)();(0,a.useEffect)(()=>{let e=!0,n=async()=>{try{await Promise.all([(0,T.qt)(),(0,R.eN)(),(0,z.Oe)()])}catch(n){e&&(0,l.$U)({kind:"alert",timeout:1e4,Content:()=>(0,r.Y)(l.XM,{children:"Failed to load invite data. Please try refreshing."})})}};return(0,i.c)(n()),()=>{e=!1}},[]),(0,a.useEffect)(()=>{if(c.has("tab")||c.has("error")){let e=new URL(window.location.href);e.searchParams.delete("tab"),e.searchParams.delete("error"),window.history.replaceState(null,"",e.pathname)}},[c]);let f=(0,a.useCallback)(()=>{d(e=>e+1)},[]),b=(0,a.useCallback)(()=>{m(e4.rA)},[]);if(!e||!n)return null;let x=e.id,Y=(0,N.io)(x),y=(0,u.nL)(x);return(0,r.FD)(r.FK,{children:[(0,r.Y)(M.f.Header,{activeItem:"inviteUsers",breadcrumbs:[{label:"Invite New Users"}]}),(0,r.FD)(M.f.Container,{children:[e.scim_enabled&&(0,r.FD)(ev,{children:[(0,r.Y)("span",{className:"fa fa-info-circle"}),"Users in this workspace are managed through your identity provider."]}),(0,r.FD)("div",{className:v||e.scim_enabled?"read-only":"",children:[(0,r.Y)(eb,{role:"tablist",children:Object.entries(e4.T2).map(([e,n])=>(0,r.Y)(ex,{type:"button",role:"tab","aria-selected":p===e,isActive:p===e,onClick:()=>m(e),children:n.label},e))}),p===e4.rA&&(0,r.FD)(eY,{children:[(0,r.Y)(nv,{isReadOnly:v,onInviteSuccess:f}),e4.T2[e4.rA].showExistingInvites&&(0,r.Y)(ey,{invites:Y,isReadOnly:v,showResendButton:!y,onResend:(0,i.$)(async e=>{try{await (0,N.$S)(e,void 0),(0,l.$U)({kind:"success",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:"Invite re-sent."})})}
1catch(e){(0,l.$U)({kind:"alert",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:e?.message||"Unable to resend invite."})})}}),onDelete:(0,i.$)(async e=>{try{await (0,N.d9)(e,void 0),f(),(0,l.$U)({kind:"success",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:"Invite deleted."})})}catch(e){(0,l.$U)({kind:"alert",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:e?.message||"Unable to delete invite."})})}})})]}),p===e4.$D&&(0,r.FD)(eY,{children:[(0,r.Y)(nx,{isReadOnly:v}),e4.T2[e4.$D].showExistingInvites&&(0,r.Y)(ey,{invites:Y,isReadOnly:v,showResendButton:!y,onResend:(0,i.$)(async e=>{try{await (0,N.$S)(e,void 0),(0,l.$U)({kind:"success",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:"Invite re-sent."})})}catch(e){(0,l.$U)({kind:"alert",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:e?.message||"Unable to resend invite."})})}}),onDelete:(0,i.$)(async e=>{try{await (0,N.d9)(e,void 0),f(),(0,l.$U)({kind:"success",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:"Invite deleted."})})}catch(e){(0,l.$U)({kind:"alert",timeout:5e3,Content:()=>(0,r.Y)(l.XM,{children:e?.message||"Unable to delete invite."})})}})},`link-${s}`)]}),p===e4.ce&&(0,r.Y)(eY,{children:(0,r.Y)(e6,{errorType:h,onInviteSuccess:f,onSwitchToEmailTab:b})}),p===e4.bR&&(0,r.Y)(eY,{children:(0,r.Y)(A,{})})]})]})]})}function ny(){return(0,r.Y)(F.t,{pageName:E.Bi.SETTINGS_INVITE_USERS,children:(0,r.Y)(nY,{})})}}}]);
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.