1import{j as n,b as T,c as Fe,l as c,T as $,L as C,n as k,m as w,x as d,U as m,$ as G,bW as Re,y as Q,z as Ue,e as Ie,k as Te}from"./index-Dfn_Lcrw.js";import{P as $e}from"./index-DpNUEpSf.js";import{A as K,s as Ce}from"./index-vou-BVb2.js";import{U as Ee}from"./UserSoloIcon-Cx0NZ_c5.js";import{a as te}from"./CrossIcon-Dc0ScbFs.js";import{D as S}from"./index-C8d98Y9L.js";import{E as O}from"./EllipsisVerticalIcon-BmAVuCxI.js";import{I as Ke}from"./index-CM74g51D.js";import{I as z}from"./index-DGBMb_5y.js";import{P as M}from"./PlugIcon-B37YG65G.js";import{C as Z,J as L,R as Ne,N as De,H as Pe}from"./HtmlIcon-B7cJQzi7.js";import{C as ne}from"./index-BdcbULFc.js";import{T as ze}from"./TrayArrowOutIcon-Bl71xh4g.js";import{U as _e}from"./UserGroupIcon-DA6BDulZ.js";import{R as Be}from"./index-C6rHGP1c.js";import{a as Le}from"./index-Bp3DVH2W.js";import{a as He}from"./CopyIcon-JHZgigam.js";import{l as ae}from"./lineClamp-COuvdLmP.js";import{A as Ve}from"./ArrowStepUpIcon-2NKmRkTe.js";import{S as Oe}from"./SparklesIcon-52vQLcLo.js";import{B as re}from"./BookOpenedIcon-Wda_VlOL.js";import{f as We}from"./formatLabel-C4hRo8fN.js";import{E as Me}from"./EmailIcon-4BDTgX6J.js";import{L as X}from"./index-DmUGF7rW.js";import{P as Je}from"./PointerActionIcon-1qn4gO2H.js";import"./index-CAG7uXH_.js";import"./cache-Gjjj90P_.js";import"./useEffectOnce-CAtJ0vhH.js";import"./useUpdateEffect-DpRzLXGI.js";import"./index-BamBtAWL.js";import"./menu-DqY64vl3.js";import"./WJWRXAE2-yp30YUY7.js";import"./NA6K3SI7-DsxNIOmq.js";import"./7BWVJDM5-B5SPSFz7.js";import"./XOGGS4JT-B145iad0.js";import"./ZXXHG5BK-BcKRnyK3.js";import"./S5ZSEKI4-DBX3d1KE.js";import"./index-DUXrkEwn.js";import"./util-9DzFDDMP.js";import"./useMeasure-DnDCvNLW.js";import"./useTimeoutFn-DjBpwTFq.js";import"./index-BXPuadBa.js";import"./useLocalStorage-BiuFuDNo.js";import"./index-vKyjOKYt.js";import"./dialog-C0LjA-Jg.js";import"./5EKYTDKF-CKOcePcy.js";import"./index-W0E0i1oE.js";import"./index-BjiaaNNe.js";import"./index-Cc3U2QIv.js";import"./EyeIcon-CGJsXnEU.js";import"./EyeStrikeIcon-BpoLKZrF.js";import"./index-rNzQ5C9e.js";import"./index-CoR1rjHq.js";import"./CheckIcon--YCLvNgS.js";import"./queueMicrotask-CB6DvF5l.js";import"./index-Cdp8mErw.js";import"./useTheme-DpnuMcId.js";import"./utils-tzx-sBBq.js";import"./index-DhhSyKqn.js";import"./index-BclioYJ1.js";import"./index-BSJFkDl3.js";import"./index-BJ55rUaj.js";import"./index-DsfNRLJm.js";import"./index-BHlYalrW.js";import"./colors-Dy6RmWIP.js";import"./index-_dgsuOr1.js";import"./index-DeeOzUqx.js";import"./useIsomorphicLayoutEffect-D6SpqBFH.js";import"./index-BoF2SZMZ.js";const se=function(){var a={defaultValue:null,kind:"LocalArgument",name:"endUserId"},t={defaultValue:null,kind:"LocalArgument",name:"organizationSlug"},r={defaultValue:null,kind:"LocalArgument",name:"workspaceSlug"}
1,s=[{kind:"Variable",name:"slug",variableName:"organizationSlug"}],i=[{kind:"Variable",name:"slug",variableName:"workspaceSlug"}],e=[{kind:"Variable",name:"id",variableName:"endUserId"}],o={alias:null,args:null,kind:"ScalarField",name:"firstName",storageKey:null},l={alias:null,args:null,kind:"ScalarField",name:"lastName",storageKey:null},u={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:[a,t,r],kind:"Fragment",metadata:null,name:"pageUserProfileAttributesResourceQuery",selections:[{kind:"RequiredField",field:{alias:null,args:s,concreteType:"Organization",kind:"LinkedField",name:"organization",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:i,concreteType:"Workspace",kind:"LinkedField",name:"workspace",plural:!1,selections:[{kind:"RequiredField",field:{alias:null,args:e,concreteType:"EndUser",kind:"LinkedField",name:"endUser",plural:!1,selections:[o,l,{args:null,kind:"FragmentSpread",name:"PersonalInformationSectionFragment"},{args:null,kind:"FragmentSpread",name:"ContactInfoSectionFragment"},{args:null,kind:"FragmentSpread",name:"EngagementSectionFragment"},{args:null,kind:"FragmentSpread",name:"StatisticsSectionFragment"},{args:null,kind:"FragmentSpread",name:"CustomAttributesSectionFragment"}],storageKey:null},action:"THROW"}],storageKey:null},action:"THROW"}],storageKey:null},action:"THROW"}],type:"Query",abstractKey:null},kind:"Request",operation:{argumentDefinitions:[t,r,a],kind:"Operation",name:"pageUserProfileAttributesResourceQuery",selections:[{alias:null,args:s,concreteType:"Organization",kind:"LinkedField",name:"organization",plural:!1,selections:[{alias:null,args:i,concreteType:"Workspace",kind:"LinkedField",name:"workspace",plural:!1,selections:[{alias:null,args:e,concreteType:"EndUser",kind:"LinkedField",name:"endUser",plural:!1,selections:[o,l,u,{alias:null,args:null,kind:"ScalarField",name:"externalUserId",storageKey:null},{alias:null,args:null,concreteType:"Address",kind:"LinkedField",name:"address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"district",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postalCode",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"birthDate",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"gender",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"jobTitle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"company",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"companyUrl",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"alternateEmail",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"phone",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"alternatePhone",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"interests",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"activities",storageKey:null},{alias:null,args:null,concreteType:"Stats",kind:"LinkedField",name:"stats",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"sessions",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"orders",storageKey:null}],storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"customAttributes",storageKey:null}],storageKey:null},u],storageKey:null},u],storageKey:null}]},params:{cacheID:"e7b1ac088c3ccb5ce4b420f6b9cb545a",id:null,metadata:{},name:"pageUserProfileAttributesResourceQuery",operationKind:"query",text:`query pageUserProfileAttributesResourceQuery( 2 $organizationSlug: ReadableId! 3 $workspaceSlug: ReadableId! 4 $endUserId: EndUserId! 5) { 6 organization(slug: $organizationSlug) { 7 workspace(slug: $workspaceSlug) { 8 endUser(id: $endUserId) { 9 firstName 10 lastName 11 ...PersonalInformationSectionFragment 12 ...ContactInfoSectionFragment 13 ...EngagementSectionFragment 14 ...StatisticsSectionFragment 15 ...CustomAttributesSectionFragment 16 id 17 } 18 id 19 } 20 id 21 } 22} 23 24fragment ActivitiesAttributeRowFragment on EndUser { 25 activities 26} 27 28fragment AddressAttributeRowFragment on EndUser { 29 address { 30 street 31 district 32 city 33 region 34 country 35 postalCode 36 } 37} 38 39fragment AgeAttributeRowFragment on EndUser { 40 birthDate 41} 42 43fragment BirthdayAttributeRowFragment on EndUser { 44 birthDate 45} 46 47fragment ContactInfoSectionFragment on EndUser { 48 ...EmailAttributeRowFragment 49 ...PhoneAttributeRowFragment 50} 51 52fragment CustomAttributesSectionFragment on EndUser { 53 customAttributes 54} 55 56fragment EmailAttributeRowFragment on EndUser { 57 email 58 alternateEmail 59} 60 61fragment EngagementSectionFragment on EndUser { 62 ...InterestsAttributeRowFragment 63 ...ActivitiesAttributeRowFragment 64} 65 66fragment GenderAttributeRowFragment on EndUser { 67 gender 68} 69 70fragment InterestsAttributeRowFragment on EndUser { 71 interests 72} 73 74fragment NameAttributeRowFragment on EndUser { 75 firstName 76 lastName 77} 78 79fragment OrdersAttributeRowFragment on EndUser { 80 stats { 81 orders 82 } 83} 84 85fragment PersonalInformationSectionFragment on EndUser { 86 ...NameAttributeRowFragment 87 ...UserIdAttributeRowFragment 88 ...AddressAttributeRowFragment 89 ...AgeAttributeRowFragment 90 ...BirthdayAttributeRowFragment 91 ...GenderAttributeRowFragment 92 ...WorkInfoAttributeRowFragment 93} 94 95fragment PhoneAttributeRowFragment on EndUser { 96 phone 97 alternatePhone 98} 99 100fragment SessionsAttributeRowFragment on EndUser { 101 stats { 102 sessions 103 } 104} 105 106fragment StatisticsSectionFragment on EndUser { 107 ...SessionsAttributeRowFragment 108 ...OrdersAttributeRowFragment 109} 110 111fragment UserIdAttributeRowFragment on EndUser { 112 id 113 externalUserId 114} 115 116fragment WorkInfoAttributeRowFragment on EndUser { 117 jobTitle 118 company 119 companyUrl 120} 121`}}}();se.hash="13c487daeede01398aab1984c6624f3d";const qe="admin:module.user.page.userProfileAttributesPage",ie={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"PersonalInformationSectionFragment",selections:[{args:null,kind:"FragmentSpread",name:"NameAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"UserIdAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"AddressAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"AgeAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"BirthdayAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"GenderAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"WorkInfoAttributeRowFragment"}],type:"EndUser",abstractKey:null};ie.hash="16f51a46e9cd476b501af80f766e94ac";const Ye="admin:module.user.component.personalInformationSection",oe={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"NameAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"firstName",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"lastName",storageKey:null}],type:"EndUser",abstractKey:null};oe.hash="0b630476bafb2d3e511e04d802b4259e";const Ge="admin:module.user.component.attributeCard.attributeDropdown";var J={};
121Object.defineProperty(J,"__esModule",{value:!0});var W=J.TypeScriptIcon=void 0;const N=n,Qe=T,Ze=Fe;W=J.TypeScriptIcon=(0,Qe.forwardRef)((a,t)=>(0,N.jsxs)(Ze.SvgIcon,Object.assign({ref:t},a,{children:[(0,N.jsx)("path",{d:"M0 3.33333C0 1.49238 1.49238 0 3.33333 0H16.6667C18.5076 0 20 1.49238 20 3.33333V16.6667C20 18.5076 18.5076 20 16.6667 20H3.33333C1.49238 20 0 18.5076 0 16.6667V3.33333Z",fill:"#007ACC"}),(0,N.jsx)("path",{d:"M11.4286 9.16667V10.6667H9.03571V18.2024H7.53571V10.6667H5V9.16667H11.4286Z",fill:"white"}),(0,N.jsx)("path",{d:"M12.3202 9.9512C12.8226 9.44887 13.5039 9.16667 14.2143 9.16667H15.7147C17.0752 9.16667 18.1786 10.27 18.1786 11.6305V11.8452H16.6786V11.6305C16.6786 11.0985 16.2468 10.6667 15.7147 10.6667H14.2143C13.9017 10.6667 13.6019 10.7908 13.3809 11.0119C13.2448 11.148 13.1729 11.3668 13.1729 11.8452C13.1729 12.3237 13.2448 12.5425 13.3809 12.6786C13.6019 12.8996 13.9017 13.0238 14.2143 13.0238H15.5C16.2104 13.0238 16.8917 13.306 17.394 13.8083C17.8964 14.3107 18.1786 14.992 18.1786 15.7024C18.1786 16.4128 17.8964 17.0941 17.394 17.5964C16.8917 18.0987 16.2104 18.381 15.5 18.381H14.2143C13.5039 18.381 12.8226 18.0987 12.3202 17.5964C11.7249 17.0011 11.6729 16.159 11.6729 15.6378H13.1729C13.1729 16.1396 13.2529 16.4077 13.3809 16.5358C13.6019 16.7568 13.9017 16.881 14.2143 16.881H15.5C15.8126 16.881 16.1124 16.7568 16.3334 16.5358C16.5544 16.3147 16.6786 16.015 16.6786 15.7024C16.6786 15.3898 16.5544 15.09 16.3334 14.869C16.1124 14.648 15.8126 14.5238 15.5 14.5238H14.2143C13.5039 14.5238 12.8226 14.2416 12.3202 13.7393C11.733 13.152 11.6729 12.3898 11.6729 11.8452C11.6729 11.3007 11.733 10.5384 12.3202 9.9512Z",fill:"white"})]})));const Xe="/chunks/tracking-banner-Bbyi1CVw.png",ee="admin:module.user.component.trackAttributeModal",et={textAlign:"left"},le=a=>{const{state:t,attributeName:r,link:s,code:i}=a,{t:e}=c(ee);return n.jsx(z.IllustratedModal,{state:t,title:e("title",{attributeName:r}),description:e("description"),...s!==void 0&&{footnote:n.jsx($,{i18nKey:`${ee}.footnote`,children:n.jsx(C,{target:"_blank",appearance:"emphasized",href:s,children:n.jsx(ze,{size:"xs"})})})},content:n.jsx(k,{style:et,children:n.jsx(Z.CodeBlockSwitcher,{title:e("codeBlock.title"),groups:[{id:"javascript",icon:L,label:"Javascript"},{id:"react",label:"React",icon:Ne,subgroups:[{id:"javascript",icon:L,label:"JavaScript"},{id:"typescript",icon:W,label:"TypeScript"}]},{id:"next",label:"Next",icon:De,subgroups:[{id:"javascript",icon:L,label:"JavaScript"},{id:"typescript",icon:W,label:"TypeScript"}]},{id:"html",icon:Pe,label:"Html"}],children:Object.entries(i).map(([o,{code:l,language:u}])=>n.jsx(Z.CodeBlockGroup,{id:o,children:n.jsx(ne,{maxHeight:40,language:u,code:l})},o))})}),illustration:{src:Xe,description:e("illustration.description")}})},tt="admin:module.user.component.attributeCard.attributeDropdown.trackAttributeItem",nt=a=>{const{attributeName:t,code:r,link:s}=a,{t:i}=c(tt),e=z.useModalState();return n.jsxs(T.Fragment,{children:[n.jsx(S.DropdownItem,{preventAutoClose:!0,label:i("label"),prefixAddon:n.jsx(M,{size:"sm"}),onClick:e.show}),n.jsx(le,{attributeName:t,state:e,code:r,link:s})]})},at="admin:module.user.component.attributeCard.attributeDropdown.targetAudienceItem",rt=a=>{const{link:t}=a,{t:r}=c(at);return n.jsx(S.DropdownItem,{as:Be,label:r("label"),prefixAddon:n.jsx(_e,{size:"sm"}),to:t,target:"_blank"})},st="admin:module.user.component.attributeCard.attributeDropdown.copyAttributeItem",it=a=>{const{value:t}=a,{t:r}=c(st),s=S.useDropdownMenu();return n.jsx(Le,{value:t,showDelay:300,tooltipPlacement:"left",onHideFeedback:s.hide,children:n.jsx(S.DropdownItem,{preventAutoClose:!0,label:r("label"),prefixAddon:n.jsx(He,{size:"sm"})})})},ot={height:5,display:"flex",alignItems:"center"},_=a=>{const{name:t,tracking:r,audience:s,copy:i,code:e=!1}=a,{t:o}=c(Ge),l=()=>{const u=[];return i!==void 0&&u.push(n.jsx(it,{value:i.value},"copy")),s!==void 0&&u.push(n.jsx(rt,{...s},"audience")),r!==void 0&&u.push(n.jsx(nt,{attributeName:r.attributeName,code:r.code,link:r.link},"tracking")),u};return n.jsx(S.DropdownMenu,{"aria-label":o("actions",{attribute:t}),placement:"bottom-end",disclosure:u=>e?n.jsx("div",{children:n.jsx(Ke,{...u,size:"sm",appearance:"neutral",icon:O,"aria-label":o("label",{attribute:t})})}):n.jsx(k,{style:ot,children:n.jsx(te,{...u,size:"sm",appearance:"neutral",icon:O,"aria-label":o("label",{attribute:t})})}),children:l()})},H="admin.module.user.component.attributeCard.textAttributeRow",lt={display:"flex",gap:w({_:2,sm:4}),padding:2,borderRadius:4,fontSize:2,lineHeight:"normal",alignItems:"start","&:hover":{backgroundColor:`${H}.backgroundHover`},"& > .label":{width:"100%",maxWidth:w({_:18,sm:30}),color:`${H}.label`,fontWeight:"medium",overflowWrap:"anywhere"},"& > .value":{width:"100%",color:`${H}.text`,...ae(2)}},D="admin.module.user.component.attributeCard.emptyAttributeRow",ct={display:"flex",gap:w({_:2,sm:4}),padding:2,borderRadius:4,fontSize:2,lineHeight:"normal",alignItems:"start","&:hover":{backgroundColor:`${D}.backgroundHover`},"& > .label":{width:"100%",maxWidth:w({_:18,sm:30}),color:`${D}.label`,fontWeight:"medium",overflowWrap:"anywhere"},"& > .value":{width:"100%",fontStyle:"italic","& > .empty":{color:`${D}.empty`},"& > .nullable":{color:`${D}.null`}}},ut="admin:module.user.component.attributeCard.emptyAttributeRow",q=a=>{const{label:t,value:r,menu:s}=a,{t:i}=c(ut);return n.jsxs(k,{style:ct,children:[n.jsx("dt",{className:"label",children:t}),n.jsx("dd",{className:"value",children:r===void 0?n.jsx("span",{className:"empty",children:i("empty")}):n.jsx("span",{className:"nullable",children:i("nullable")})}
121),s!==void 0&&n.jsx(_,{name:t,tracking:s.tracking,audience:s.audience})]})},x=a=>{const{label:t,value:r,menu:s}=a;return r==null?n.jsx(q,{value:r,label:t,menu:s}):n.jsxs(k,{style:lt,children:[n.jsx("dt",{className:"label",children:t}),n.jsx("dd",{className:"value",children:r}),s!==void 0&&n.jsx(_,{name:t,tracking:s.tracking,audience:s.audience,copy:s.copy})]})};function g(a,t){return`<!DOCTYPE html> 122<html> 123 <head> 124 <title>My awesome application</title> 125 <script src="https://cdn.croct.io/js/v1/lib/plug.js"><\/script> 126 <script>croct.plug({appId: 'APPLICATION_ID'});<\/script> 127 </head> 128 <body> 129 <script> 130 function updateProfile() { 131 croct.user.edit() 132 .set('${a}', '${t}') 133 .save(); 134 } 135 <\/script> 136 <button onclick="updateProfile()">Trigger</button> 137 </body> 138</html>`}function p(a,t){return`import croct from '@croct/plug'; 139 140async function updateProfile() { 141 await croct.user.edit() 142 .set('${a}', '${t}') 143 .save(); 144} 145 146updateProfile();`}function b(a,t){return`import {useCroct} from '@croct/plug-next'; 147 148export function Example() { 149 const croct = useCroct(); 150 151 function updateProfile() { 152 croct.user.edit() 153 .set('${a}', '${t}') 154 .save(); 155 } 156 157 return (<button onClick={updateProfile}>Trigger</button>); 158}`}function f(a,t){return`import {useCroct} from '@croct/plug-next'; 159import type {ReactElement} from 'react'; 160 161export function Example(): ReactElement { 162 const croct = useCroct(); 163 164 function updateProfile() { 165 croct.user.edit() 166 .set('${a}', '${t}') 167 .save(); 168 } 169 170 return (<button onClick={updateProfile}>Trigger</button>); 171}`}function h(a,t){return`import {useCroct} from '@croct/plug-react'; 172 173export function Example() { 174 const croct = useCroct(); 175 176 function updateProfile() { 177 croct.user.edit() 178 .set('${a}', '${t}') 179 .save(); 180 } 181 182 return (<button onClick={updateProfile}>Trigger</button>); 183}`}function y(a,t){return`import {useCroct} from '@croct/plug-react'; 184import type {ReactElement} from 'react'; 185 186export function Example(): ReactElement { 187 const croct = useCroct(); 188 189 function updateProfile() { 190 croct.user.edit() 191 .set('${a}', '${t}') 192 .save(); 193 } 194 195 return (<button onClick={updateProfile}>Trigger</button>); 196}`}const dt="admin:module.user.component.personalInformationSection.nameAttributeRow",v="Joe Doe",mt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(dt),{firstName:e,lastName:o}=d.useFragment(oe,s),l=e!==null&&o!==null?`${e} ${o}`:e??o??void 0;return n.jsx(x,{label:i("label"),value:l,menu:{...l!==void 0&&{copy:{value:l}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:{...l!==void 0?{name:"Users with known name",id:"users-with-known-name",criteria:`user's name is "${l}"`}:{name:"Users with unknown name",id:"users-with-unknown-name",criteria:"user's name is empty"}}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("firstName",l??v),language:"html"},javascript:{code:p("firstName",l??v),language:"javascript"},"react-javascript":{code:h("firstName",l??v),language:"jsx"},"react-typescript":{code:y("firstName",l??v),language:"tsx"},"next-javascript":{code:b("firstName",l??v),language:"jsx"},"next-typescript":{code:f("firstName",l??v),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})},ce={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"UserIdAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"externalUserId",storageKey:null}],type:"EndUser",abstractKey:null};ce.hash="a65d9856b23500e9e04a196cfaacce86";const gt="admin:module.user.component.personalInformationSection.userIdAttributeRow",pt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(gt),{externalUserId:e}=d.useFragment(ce,s),o=T.useId();return n.jsx(x,{label:i("label"),value:e??void 0,menu:{...e!==null&&{copy:{value:e}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:{...e!==null?{name:"Identified users",id:"identified-users",criteria:"user is identified"}:{name:"Anonymous users",id:"anonymous-users",criteria:"user is anonymous"}}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("userId",e??o),language:"html"},javascript:{code:p("userId",e??o),language:"javascript"},"react-javascript":{code:h("userId",e??o),language:"jsx"},"react-typescript":{code:y("userId",e??o),language:"tsx"},"next-javascript":{code:b("userId",e??o),language:"jsx"},"next-typescript":{code:f("userId",e??o),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})},ue={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"AddressAttributeRowFragment",selections:[{alias:null,args:null,concreteType:"Address",kind:"LinkedField",name:"address",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"street",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"district",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"city",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"region",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"country",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"postalCode",storageKey:null}],storageKey:null}],type:"EndUser",abstractKey:null};ue.hash="48a2d6f327b87b04fee54bd066f0771c";const bt="admin:module.user.component.personalInformationSection.addressAttributeRow",A="Brazil",ft=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(bt),{address:e}=d.useFragment(ue,s),o=ht(e);return n.jsx(x,{label:i("label"),value:o??void 0,menu:{...o!==null&&{copy:{value:o}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:yt(e)}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("address",e.country??A),language:"html"},javascript:{code:p("address",e.country??A),language:"javascript"},"react-javascript":{code:h("address",e.country??A),language:"jsx"},"react-typescript":{code:y("address",e.country??A),language:"tsx"},"next-javascript":{code:b("address",e.country??A),language:"jsx"},"next-typescript":{code:f("address",e.country??A),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function ht(a){const t=[];return a.street!==null&&t.push(a.street),a.district!==null&&t.push(a.district),a.city!==null&&t.push(a.city),a.region!==null&&t.push(a.region),a.country!==null&&t.push(a.country),a.postalCode!==null&&t.push(a.postalCode),t.length===0?null:t.join(", ")}function yt(a){const r=Object.entries(a).find(([,e])=>e!==null);if(r===void 0)return{name:"Users with unknown address",id:"users-with-unknown-address",criteria:"user's address's country is empty"};const[s,i]=r;return{name:"Users with known address",id:"users-with-known-address",criteria:`user's address' ${s} is "${i}"`}}const de={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"AgeAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"birthDate",storageKey:null}],type:"EndUser",abstractKey:null};de.hash="efdcc2dae5fac5e95fd0ff7cfe9019f8";const kt="admin:module.user.component.personalInformationSection.ageAttributeRow",j="20",xt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(kt),{birthDate:e}=d.useFragment(de,s),o=wt(e);return n.jsx(x,{label:i("label"),value:o??void 0,menu:{...o!==null&&{copy:{value:o}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:o!==null?{name:"Users with known age",id:"users-with-known-age",criteria:`user's age is ${o}`}:{name:"Users with unknown age",id:"users-with-unknown-age",criteria:"user's age is empty"}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("age",o??j),language:"html"},javascript:{code:p("age",o??j),language:"javascript"},"react-javascript":{code:h("age",o??j),language:"jsx"},"react-typescript":{code:y("age",o??j),language:"tsx"},"next-javascript":{code:b("age",o??j),language:"jsx"},"next-typescript":{code:f("age",o??j),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function wt(a){return a===null?null:G.LocalDate.parse(a).until(G.LocalDateTime.now().getLocalDate()).getYears().toString()}const me={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"BirthdayAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"birthDate",storageKey:null}],type:"EndUser",abstractKey:null};me.hash="222ab5e44f918f3edd05d6f51558e99b";const St="admin:module.user.component.personalInformationSection.birthdayAttributeRow",F="2000-01-01",vt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(St),{birthDate:e}=d.useFragment(me,s);return n.jsx(x,{label:i("label"),value:e??void 0,menu:{...e!==null&&{copy:{value:e}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e!==null?{name:"Users with known birthdate",id:"users-with-known-birthdate",criteria:`user's birthday is equal to "${e}" as date`}:{name:"Users with unknown birthdate",id:"users-with-unknown-birthdate",criteria:"user's birthday is empty"}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("birthDate",e??F),language:"html"},javascript:{code:p("birthDate",e??F),language:"javascript"},"react-javascript":{code:h("birthDate",e??F),language:"jsx"},"react-typescript":{code:y("birthDate",e??F),language:"tsx"},"next-javascript":{code:b("birthDate",e??F),language:"jsx"},"next-typescript":{code:f("birthDate",e??F),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})},ge={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"GenderAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"gender",storageKey:null}],type:"EndUser",abstractKey:null};ge.hash="365b8f01d2f961a8eb676f7e7f444108";const At="admin:module.user.component.personalInformationSection.genderAttributeRow",jt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(At),{gender:e}=d.useFragment(ge,s);return n.jsx(x,{label:i("label"),value:i(`genders.${e}`),menu:{copy:{value:e},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e!=="UNKNOWN"?{name:"Users with declared gender",id:"users-with-declared-gender",criteria:`user's gender is "${e.toLowerCase()}"`}:{name:"Users with undeclared gender",id:"users-with-undeclared-gender",criteria:`user's gender is "unknown"`}}},tracking:{attributeName:i("trackAttributeTitle"),link:m.STANDARD_ATTRIBUTES,code:{html:{code:g("gender",e),language:"html"},javascript:{code:p("gender",e),language:"javascript"},"react-javascript":{code:h("gender",e),language:"jsx"},"react-typescript":{code:y("gender",e),language:"tsx"},"next-javascript":{code:b("gender",e),language:"jsx"},"next-typescript":{code:f("gender",e),language:"tsx"}}}}})},pe={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"WorkInfoAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"jobTitle",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"company",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"companyUrl",storageKey:null}],type:"EndUser",abstractKey:null};pe.hash="d888b7371e951b0da95ebf8c045682ac";const E="admin:module.user.component.personalInformationSection.workInfoAttributeRow",R="Softw
196are engineer",Ft=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(E),e=d.useFragment(pe,s),{jobTitle:o}=e,l=T.useMemo(()=>Rt(e,i),[e,i]);return n.jsx(x,{label:i("label"),value:l==null?void 0:l.value,menu:{...(l==null?void 0:l.copyValue)!==void 0&&{copy:{value:l.copyValue}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:Ut(e)}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("workInfo",o??R),language:"html"},javascript:{code:p("workInfo",o??R),language:"javascript"},"react-javascript":{code:h("workInfo",o??R),language:"jsx"},"react-typescript":{code:y("workInfo",o??R),language:"tsx"},"next-javascript":{code:b("workInfo",o??R),language:"jsx"},"next-typescript":{code:f("workInfo",o??R),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function Rt(a,t){const{jobTitle:r,company:s,companyUrl:i}=a,e=r!==null,o=s!==null,l=i!==null;if(!(!e&&!o&&!l))return l?o&&e?{value:n.jsx($,{i18nKey:`${E}.workInfo.full`,values:{jobTitle:r,company:s},children:n.jsx(C,{appearance:"emphasized",href:i,target:"_blank"})}),copyValue:t("workInfo.copy.full",{jobTitle:r,company:s,companyUrl:i})}:o?{value:n.jsx($,{i18nKey:`${E}.workInfo.missingJobTitle`,values:{company:s},children:n.jsx(C,{appearance:"emphasized",href:i,target:"_blank"})}),copyValue:t("workInfo.copy.missingJobTitle",{company:s,companyUrl:i})}:e?{value:n.jsx($,{i18nKey:`${E}.workInfo.missingCompany`,values:{jobTitle:r,companyUrl:i},children:n.jsx(C,{appearance:"emphasized",href:i,target:"_blank"})}),copyValue:t("workInfo.copy.missingCompany",{jobTitle:r,companyUrl:i})}:{value:n.jsx(C,{appearance:"emphasized",href:i,target:"_blank",children:i}),copyValue:i}:o&&e?{value:n.jsx($,{i18nKey:`${E}.workInfo.missingCompanyUrl`,values:{jobTitle:r,company:s}}),copyValue:t("workInfo.copy.missingCompanyUrl",{jobTitle:r,company:s})}:{value:r??s??void 0,copyValue:r??s??void 0}}function Ut(a){const r=Object.entries(a).find(([,e])=>e!==null);if(r===void 0)return{name:"Users with unknown work info",id:"users-with-unknown-work-info",criteria:"user's company is empty"};const[s,i]=r;return{name:"Users with known work info",id:"users-with-known-work-info",criteria:`user's ${s} is "${i}"`}}const It=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(Ye),e=d.useFragment(ie,s);return n.jsxs(K,{title:i("title"),icon:n.jsx(Ee,{size:"xs"}),children:[n.jsx(mt,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(pt,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(ft,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(xt,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(vt,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(jt,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(Ft,{organizationSlug:t,workspaceSlug:r,endUserRef:e})]})},be={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"StatisticsSectionFragment",selections:[{args:null,kind:"FragmentSpread",name:"SessionsAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"OrdersAttributeRowFragment"}],type:"EndUser",abstractKey:null};be.hash="468cbd39ae845e7338002af0233c4202";const Tt="admin:module.user.component.statisticsSection",fe={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"SessionsAttributeRowFragment",selections:[{alias:null,args:null,concreteType:"Stats",kind:"LinkedField",name:"stats",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"sessions",storageKey:null}],storageKey:null}],type:"EndUser",abstractKey:null};fe.hash="6bac375e4fcbadc93d96ce748519f67e";const $t="admin:module.user.component.statisticsSection.sessionsAttributeRow",Ct=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c($t),{stats:{sessions:e}}=d.useFragment(fe,s);return n.jsx(x,{label:i("label"),value:e,menu:{copy:{value:e.toString()},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e>0?{name:`Users with ${e}+ sessions`,id:"users-with-many-sessions",criteria:`user's stats' sessions >= ${e}`}:{name:"Users with no sessions",id:"users-with-no-sessions",criteria:"user's stats' sessions is 0"}}}}})},he={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"OrdersAttributeRowFragment",selections:[{alias:null,args:null,concreteType:"Stats",kind:"LinkedField",name:"stats",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"orders",storageKey:null}],storageKey:null}],type:"EndUser",abstractKey:null};he.hash="c00ce33ef4c6160d087fe8b723c0fca4";const Et="admin:module.user.component.statisticsSection.ordersAttributeRow",Kt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(Et),{stats:{orders:e}}=d.useFragment(he,s);return n.jsx(x,{label:i("label"),value:e,menu:{copy:{value:e.toString()},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e>0?{name:`Users with ${e}+ orders`,id:"users-with-many-orders",criteria:`user's stats' orders >= ${e}`}:{name:"Users with no orders",id:"users-with-no-orders",criteria:"user's stats' orders is 0"}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("orders",e.toString()),language:"html"},javascript:{code:p("orders",e.toString()),language:"javascript"},"react-javascript":{code:h("orders",e.toString()),language:"jsx"},"react-typescript":{code:y("orders",e.toString()),language:"tsx"},"next-javascript":{code:b("orders",e.toString()),language:"jsx"},"next-typescript":{code:f("orders",e.toString()),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})},Nt=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}
196=c(Tt),e=d.useFragment(be,s);return n.jsxs(K,{title:i("title"),icon:n.jsx(Ve,{size:"xs"}),children:[n.jsx(Ct,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(Kt,{organizationSlug:t,workspaceSlug:r,endUserRef:e})]})},ye={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"CustomAttributesSectionFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"customAttributes",storageKey:null}],type:"EndUser",abstractKey:null};ye.hash="d9895469e5c45a511e8208b9d9009b23";const V="admin.module.user.component.attributeCard.codeAttributeRow",Dt={display:"flex",gap:4,flexDirection:w({_:"column",sm:"row"}),padding:2,borderRadius:4,fontSize:2,lineHeight:"normal",alignItems:"start","&:hover":{backgroundColor:`${V}.backgroundHover`},"& > .label":{width:"100%",maxWidth:w({_:"unset",sm:30}),color:`${V}.label`,fontWeight:"medium",overflowWrap:"anywhere"},"& > .value":{width:"100%",minWidth:0,"& > .text":{width:"100%",color:`${V}.text`,...ae(2)}}},Pt=a=>{const{label:t,value:r,menu:s}=a;return r==null?n.jsx(q,{value:r,label:t,menu:s}):n.jsxs(k,{style:Dt,children:[n.jsx("dt",{className:"label",children:t}),n.jsx("dd",{className:"value",children:n.jsx(ne,{code:r,hideLineNumber:!0,language:"cql",action:s!==void 0&&n.jsx(_,{name:t,tracking:s.tracking,audience:s.audience,copy:s.copy,code:!0})})})]})},zt={marginX:2,marginTop:-2,"& > .label":{color:Re.palette.gray[500],fontSize:2,lineHeight:"normal"},"& > .actions":{marginTop:5,display:"flex",gap:4}};function _t(){return`<!DOCTYPE html> 197<html> 198 <head> 199 <title>My awesome application</title> 200 <script src="https://cdn.croct.io/js/v1/lib/plug.js"><\/script> 201 <script>croct.plug({appId: 'APPLICATION_ID'});<\/script> 202 </head> 203 <body> 204 <script> 205 function updateProfile() { 206 croct.user.edit() 207 // You define both attribute names and values 208 .set('custom.plan', 'pro') 209 .set('custom.lastPurchaseValue', 89.9) 210 .set('custom.notificationsEnabled', false) 211 // Add a value to a list attribute (created automatically if needed) 212 .add('custom.wishlist', 'laptop') 213 .save(); 214 } 215 <\/script> 216 <button onclick="updateProfile()">Trigger</button> 217 </body> 218</html>`}function Bt(){return`import croct from '@croct/plug'; 219 220async function updateProfile() { 221 await croct.user.edit() 222 // You define both attribute names and values 223 .set('custom.plan', 'pro') 224 .set('custom.lastPurchaseValue', 89.9) 225 .set('custom.notificationsEnabled', false) 226 // Add a value to a list attribute (created automatically if needed) 227 .add('custom.wishlist', 'laptop') 228 .save(); 229} 230 231updateProfile();`}function Lt(){return`import {useCroct} from '@croct/plug-next'; 232 233export function Example() { 234 const croct = useCroct(); 235 236 function updateProfile() { 237 croct.user.edit() 238 // You define both attribute names and values 239 .set('custom.plan', 'pro') 240 .set('custom.lastPurchaseValue', 89.9) 241 .set('custom.notificationsEnabled', false) 242 // Add a value to a list attribute (created automatically if needed) 243 .add('custom.wishlist', 'laptop') 244 .save(); 245 } 246 247 return (<button onClick={updateProfile}>Trigger</button>); 248}`}function Ht(){return`import {useCroct} from '@croct/plug-next'; 249import type {ReactElement} from 'react'; 250 251export function Example(): ReactElement { 252 const croct = useCroct(); 253 254 function updateProfile() { 255 croct.user.edit() 256 // You define both attribute names and values 257 .set('custom.plan', 'pro') 258 .set('custom.lastPurchaseValue', 89.9) 259 .set('custom.notificationsEnabled', false) 260 // Add a value to a list attribute (created automatically if needed) 261 .add('custom.wishlist', 'laptop') 262 .save(); 263 } 264 265 return (<button onClick={updateProfile}>Trigger</button>); 266}`}function Vt(){return`import {useCroct} from '@croct/plug-react'; 267 268export function Example() { 269 const croct = useCroct(); 270 271 function updateProfile() { 272 croct.user.edit() 273 // You define both attribute names and values 274 .set('custom.plan', 'pro') 275 .set('custom.lastPurchaseValue', 89.9) 276 .set('custom.notificationsEnabled', false) 277 // Add a value to a list attribute (created automatically if needed) 278 .add('custom.wishlist', 'laptop') 279 .save(); 280 } 281 282 return (<button onClick={updateProfile}>Trigger</button>); 283}`}function Ot(){return`import {useCroct} from '@croct/plug-react'; 284import type {ReactElement} from 'react'; 285 286export function Example(): ReactElement { 287 const croct = useCroct(); 288 289 function updateProfile() { 290 croct.user.edit() 291 // You define both attribute names and values 292 .set('custom.plan', 'pro') 293 .set('custom.lastPurchaseValue', 89.9) 294 .set('custom.notificationsEnabled', false) 295 // Add a value to a list attribute (created automatically if needed) 296 .add('custom.wishlist', 'laptop') 297 .save(); 298 } 299 300 return (<button onClick={updateProfile}>Trigger</button>); 301}`}const Wt="admin:module.user.component.customAttributesSection.trackNewAttributeModal",ke=a=>{const{state:t}=a,{t:r}=c(Wt);return n.jsx(le,{attributeName:r("name"),state:t,link:m.STANDARD_ATTRIBUTES,code:{html:{language:"html",code:_t()},javascript:{language:"javascript",code:Bt()},"react-javascript":{language:"jsx",code:Vt()},"react-typescript":{language:"tsx",code:Ot()},"next-javascript":{language:"jsx",code:Lt()},"next-typescript":{language:"tsx",code:Ht()}}})},Mt="admin:module.user.component.customAttributesSection.emptyCustomAttributes",Jt=()=>{const a=z.useModalState(),{t}=c(Mt);return n.jsxs(T.Fragment,{children:[n.jsxs(k,{style:zt,children:[n.jsx("p",{className:"label",children:t("label")}),n.jsxs("div",{className:"actions",children:[n.jsx(Q,{size:"sm",variant:"primary",label:t("action.tracking"),icon:M,onClick:a.show}),n.jsx(Q,{as:"a",href:m.CUSTOM_ATTRIBUTES,rel:"noopener noreferrer",target:"_blank",size:"sm",variant:"secondary",label:t("action.documentation"),icon:re})]})]}),n.jsx(ke,{state:a})]})},qt={height:5,display:"flex",alignItems:"center"},Yt="admin:module.user.component.customAttributesSection.customAttributesDropdown.documentationItem",Gt=a=>{const{link:t}=a,{t:r}=c(Yt);return n.jsx(S.DropdownItem,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",label:r("label"),prefixAddon:n.jsx(re,{size:"sm"})})},Qt="admin:module.user.component.customAttributesSection.customAttributesDropdown.trackNewAttributeItem",Zt=()=>{const a=z.useModalState(),{t}=c(Qt);return n.jsxs(T.Fragment,{children:[n.jsx(S.DropdownItem,{preventAutoClose:!0,label:t("label"),prefixAddon:n.jsx(M,{size:"sm"}),onClick:a.show}),n.jsx(ke,{state:a})]})},Xt="admin:module.user.component.customAttributesSection.customAttributesDropdown",en=()=>{const{t:a}=c(Xt);return n.jsxs(S.DropdownMenu,{disclosure:t=>n.jsx(k,{style:qt,children:n.jsx(te,{...t,size:"sm",appearance:"neutral",icon:O,"aria-label":a("label")})}),children:[n.jsx(Zt,{}),n.jsx(Gt,{link:m.CUSTOM_ATTRIBUTES})]})},tn="admin:module.user.component.customAttributesSection",nn=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(tn),{customAttributes:e}=d.useFragment(ye,s),o=Object.keys(e).length>0;return n.jsx(K,{title:i("title"),icon:n.jsx(Oe,{size:"xs"}),...o&&{action:n.jsx(en,{})},children:o?Object.entries(e).map(([l,u])=>n.jsx(Pt,{label:We(l),value:JSON.stringify(u,null,2),menu:{audie
301nce:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:{name:"Users with custom attribute",id:"users-with-custom-attribute",criteria:typeof u=="object"?`user's ${l} is defined`:`user's ${l} is ${JSON.stringify(u)}`}}}}},l)):n.jsx(Jt,{})})},xe={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ContactInfoSectionFragment",selections:[{args:null,kind:"FragmentSpread",name:"EmailAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"PhoneAttributeRowFragment"}],type:"EndUser",abstractKey:null};xe.hash="3fd2318bb687fc66c38cf0265a7b0216";const an="admin:module.user.component.contactInfoSection",we={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"EmailAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"email",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"alternateEmail",storageKey:null}],type:"EndUser",abstractKey:null};we.hash="24b61a27551102051af58c7060f5cb82";const P="admin.module.user.component.attributeCard.listAttributeRow",rn={display:"flex",gap:w({_:2,sm:4}),padding:2,borderRadius:4,fontSize:2,lineHeight:"normal",alignItems:"start","&[data-focus-visible]":{borderColor:"transparent",...Ue("emphasized")},"&:hover":{backgroundColor:`${P}.backgroundHover`},"& > .label":{width:"100%",maxWidth:w({_:18,sm:30}),color:`${P}.label`,fontWeight:"medium",overflowWrap:"anywhere"},"& > .value":{width:"100%",overflowWrap:"anywhere","& > .empty-list, & .empty-text":{fontStyle:"italic",color:`${P}.empty`},"& .list-item":{color:`${P}.text`}}},sn="admin:module.user.component.attributeCard.listAttributeRow",B=a=>{const{label:t,value:r,menu:s}=a,{t:i}=c(sn);return r===void 0?n.jsx(q,{value:r,label:t,menu:s}):n.jsxs(k,{style:rn,children:[n.jsx("dt",{className:"label",children:t}),n.jsx("dd",{className:"value",children:r.length===0?n.jsx("span",{className:"empty-list",children:i("emptyList")}):n.jsx(X.UnorderedList,{size:"sm",children:r.map(e=>n.jsx(X.ListItem,{children:e!==""?n.jsx("span",{className:"list-item",children:e}):n.jsx("span",{className:"empty-text",children:i("emptyString")})},e))})}),s!==void 0&&n.jsx(_,{name:t,tracking:s.tracking,audience:s.audience,copy:s.copy})]})},on="admin:module.user.component.contactInfoSection.emailAttributeRow",U="[email protected]",ln=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(on),{email:e,alternateEmail:o}=d.useFragment(we,s),l=cn([e,o]),u=e!==null&&o!==null?`${e}, ${o}`:e??o??void 0;return n.jsx(B,{label:i("label"),value:l??void 0,menu:{...u!==void 0&&{copy:{value:u}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:{...e!==null?{name:"Users with known email",id:"users-with-known-email",criteria:`user's email ends with "${`@${e.split("@")[1]}`}"`}:{name:"Users with unknown email",id:"users-with-unknown-email",criteria:"user's email is empty"}}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("email",e??U),language:"html"},javascript:{code:p("email",e??U),language:"javascript"},"react-javascript":{code:h("email",e??U),language:"jsx"},"react-typescript":{code:y("email",e??U),language:"tsx"},"next-javascript":{code:b("email",e??U),language:"jsx"},"next-typescript":{code:f("email",e??U),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function cn(a){const t=a.filter(r=>r!==null);return t.length>0?t:null}const Se={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"PhoneAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"phone",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"alternatePhone",storageKey:null}],type:"EndUser",abstractKey:null};Se.hash="530109bf93e4ccafdb5290d3966ec2e9";const un="admin:module.user.component.contactInfoSection.phoneAttributeRow",I="(212) 555-0147",dn="+1",mn=a=>{var Y;const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(un),{phone:e,alternatePhone:o}=d.useFragment(Se,s),l=gn([e,o]),u=e!==null&&o!==null?`${e}, ${o}`:e??o??void 0;return n.jsx(B,{label:i("label"),value:l??void 0,menu:{...u!==void 0&&{copy:{value:u}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:{...e!==null?{name:"Users with known phone",id:"users-with-known-phone",criteria:`user's phone starts with "${((Y=e.match(/^\+?\d{1,3}/))==null?void 0:Y[0])??dn}"`}:{name:"Users with unknown phone",id:"users-with-unknown-phone",criteria:"user's phone is empty"}}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("phone",e??I),language:"html"},javascript:{code:p("phone",e??I),language:"javascript"},"react-javascript":{code:h("phone",e??I),language:"jsx"},"react-typescript":{code:y("phone",e??I),language:"tsx"},"next-javascript":{code:b("phone",e??I),language:"jsx"},"next-typescript":{code:f("phone",e??I),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function gn(a){const t=a.filter(r=>r!==null);return t.length>0?t:null}const pn=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(an),e=d.useFragment(xe,s);return n.jsxs(K,{title:i("title"),icon:n.jsx(Me,{size:"xs"}),children:[n.jsx(ln,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(mn,{organizationSlug:t,workspaceSlug:r,endUserRef:e})]})},ve={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"EngagementSectionFragment",selections:[{args:null,kind:"FragmentSpread",name:"InterestsAttributeRowFragment"},{args:null,kind:"FragmentSpread",name:"ActivitiesAttributeRowFragment"}],type:"EndUser",abstractKey:null};ve.hash="b8447fd0cecf1df7bed79a3230b81065";const bn="admin:module.user.component.engagementSection",Ae={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"InterestsAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"interests",storageKey:null}],type:"EndUser",abstractKey:null};Ae.hash="c4a88362d8d256e86439db5287f5e411";const fn="admin:module.user.component.engagementSection.interestsAttributeRow",hn="sneakers",yn=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(fn),{interests:e}=d.useFragment(Ae,s),o=e.length>0?e[0]:hn;return n.jsx(B,{label:i("label"),value:e.length>0?e:void 0,menu:{...e.length>0&&{copy:{value:e.join(", ")}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e.length>0?{name:"Users with known interests",id:"users-with-known-interests",criteria:`user's interests include either ${kn(e)}`}:{name:"Users with unknown interests",id:"users-with-unknown-interests",criteria:"user's interests is empty"}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("interests",o),language:"html"},javascript:{code:p("interests",o),language:"javascript"},"react-javascript":{code:h("interests",o),language:"jsx"},"react-typescript":{code:y("interests",o),language:"tsx"},"next-javascript":{code:b("interests",o),language:"jsx"},"next-typescript":{code:f("interests",o),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function kn(a){return JSON.stringify(a).replace(/,/g,", ")}const je={argumentDefinitions:[],kind:"Fragment",metadata:null,name:"ActivitiesAttributeRowFragment",selections:[{alias:null,args:null,kind:"ScalarField",name:"activities",storageKey:null}],type:"EndUser",abstractKey:null};je.hash="bb2eb2d1a3577820eab7ea748195463a";const xn="admin:module.user.component.engagementSection.activitiesAttributeRow",wn="sign-up",Sn=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(xn),{activities:e}=d.useFragment(je,s),o=e.length>0?e[0]:wn;return n.jsx(B,{label:i("label"),value:e.length>0?e:void 0,menu:{...e.length>0&&{copy:{value:e.join(", ")}},audience:{link:{path:"personalization.audiences.new",params:{organizationSlug:t,workspaceSlug:r},search:e.length>0?{name:"Users with known activities",id:"users-with-known-activities",criteria:`user's activities include either ${vn(e)}`}:{name:"Users with unknown activities",id:"users-with-unknown-activities",criteria:"user's activities is empty"}}},tracking:{attributeName:i("trackAttributeTitle"),code:{html:{code:g("activities",o),language:"html"},javascript:{code:p("activities",o),language:"javascript"},"react-javascript":{code:h("activities",o),language:"jsx"},"react-typescript":{code:y("activities",o),language:"tsx"},"next-javascript":{code:b("activities",o),language:"jsx"},"next-typescript":{code:f("activities",o),language:"tsx"}},link:m.STANDARD_ATTRIBUTES}}})};function vn(a){return JSON.stringify(a).replace(/,/g,", ")}const An=a=>{const{organizationSlug:t,workspaceSlug:r,endUserRef:s}=a,{t:i}=c(bn),e=d.useFragment(ve,s);return n.jsxs(K,{title:i("title"),icon:n.jsx(Je,{size:"xs"}),children:[n.jsx(yn,{organizationSlug:t,workspaceSlug:r,endUserRef:e}),n.jsx(Sn,{organizationSlug:t,workspaceSlug:r,endUserRef:e})]})},La=()=>{const{organizationSlug:a,workspaceSlug:t,userId:r}=Ie(),{t:s}=c(qe),i=Te.useLazyLoadQuery(se,{organizationSlug:a,workspaceSlug:t,endUserId:r},{fetchPolicy:"store-and-network"}),{endUser:e}=i.organization.workspace,{firstName:o,lastName:l}=e;return n.jsx($e,{title:jn(s,o,l),children:n.jsxs(k,{style:Ce,children:[n.jsx(It,{organizationSlug:a,workspaceSlug:t,endUserRef:e}),n.jsx(pn,{organizationSlug:a,workspaceSlug:t,endUserRef:e}),n.jsx(An,{organizationSlug:a,workspaceSlug:t,endUserRef:e}),n.jsx(Nt,{organizationSlug:a,workspaceSlug:t,endUserRef:e}),n.jsx(nn,{organizationSlug:a,workspaceSlug:t,endUserRef:e})]})})};function jn(a,t,r){return t!==null&&r!==null?a("title.identified",{firstName:t,lastName:r}):a("title.fallback")}export{La as Page};
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.