1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6082],{4109:(e,t,s)=>{"use strict";s.d(t,{z:()=>a});var l=s(4930),i=s(68396);let n=e=>{if(e>=1e6){let t=e/1e6;return"".concat(t%1==0?t.toFixed(0):t.toFixed(1),"M")}if(e>=1e3){let t=e/1e3;return"".concat(t%1==0?t.toFixed(0):t.toFixed(1),"K")}return e.toString()};function a(e){let{current:t,total:s,showCount:a=!0,showPercentage:r=!1,textPosition:c="next",className:d="",barClassName:o="",countClassName:x=""}=e,h=s>0?t/s*100:0;return(0,l.jsxs)("div",{className:"below"===c?"flex flex-col gap-1 ".concat(d," items-center"):"flex items-center gap-2 ".concat(d),children:[(0,l.jsx)("div",{className:(0,i.cn)("w-24 h-2 rounded-full overflow-hidden bg-white-08 ".concat(o)),children:(0,l.jsx)("div",{className:"h-full bg-gradient-to-r from-blue-400 to-[#2956B4] rounded-full transition-all duration-300 ease-out",style:{width:"".concat(h,"%")}})}),(a||r)&&(0,l.jsx)("span",{className:"text-xs text-white-60 font-medium ".concat(x),children:a&&r?"".concat(n(t),"/").concat(n(s)," (").concat(Math.round(h),"%)"):r?"".concat(Math.round(h),"%"):"".concat(n(t),"/").concat(n(s))})]})}},9817:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ej});var l=s(4930),i=s(37826),n=s(85713),a=s(51998),r=s(15066),c=s(42497),d=s(14100),o=s(55647),x=s(68396),h=s(51680),u=s(56809),m=s(36513),f=s(18642),j=s(23725),w=s(68984),p=s(86441);function v(){return(0,l.jsx)("div",{className:"text-[#999999]",children:(0,l.jsx)("span",{children:"0%"})})}function N(e){let{children:t}=e;return(0,l.jsxs)("div",{className:"flex items-center text-green-400",children:[(0,l.jsx)(j.A,{className:"w-4 h-4 fill-current",strokeWidth:1}),(0,l.jsxs)("span",{children:[t,"%"]})]})}function g(e){let{children:t}=e;return(0,l.jsxs)("div",{className:"flex items-center text-red-400",children:[(0,l.jsx)(w.A,{className:"w-4 h-4 fill-current",strokeWidth:1}),(0,l.jsxs)("span",{children:[t,"%"]})]})}function y(e){let{title:t,value:s,percentChange:i,icon:n,className:a,isLoading:r,showTrend:c=!0,variant:d="default"}=e,o=i?i>0?(0,l.jsx)(N,{children:i}):i<0?(0,l.jsx)(g,{children:i}):(0,l.jsx)(v,{}):(0,l.jsx)(v,{});return(0,l.jsxs)("div",{className:(0,x.cn)("relative flex flex-col space-y-2 px-6 py-4 backdrop-blur-[1px]","studio"===d?"rounded-2xl border border-white/8 bg-white-06":"rounded-4xl bg-white-06",a),children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("h3",{className:"text-white text-sm font-light",children:t}),n&&(0,l.jsx)("div",{className:"flex items-center justify-center",children:n})]}),(0,l.jsxs)("div",{className:"flex justify-between items-center sm:flex-col sm:items-start sm:space-y-2",children:[(0,l.jsx)("div",{className:"text-xl text-white",children:r?(0,l.jsx)(p.E,{className:"w-20 h-4"}):s}),c&&(0,l.jsx)("div",{className:"flex items-center text-sm",children:r?(0,l.jsx)(p.E,{className:"w-48 h-4"}):(0,l.jsxs)(l.Fragment,{children:[o,(0,l.jsx)("span",{className:"ml-1 text-white font-light",children:"from last week"})]})})]})]})}function b(e){var t,s;let{isSidebarOpen:i,variant:n="default"}=e,{selectedIdentityId:a}=(0,c.G)(),{data:r,isLoading:d}=o.F.engagementAnalytics.uniqueInteractedUsers.useQuery({identityId:null!=a?a:""},{enabled:!!a}),{data:j,isLoading:w}=o.F.engagementAnalytics.timeSpentStats.useQuery({identityId:null!=a?a:""},{enabled:!!a}),p=d||w;return(0,l.jsxs)("div",{className:(0,x.cn)("w-full grid grid-cols-1 xl:grid-cols-2 gap-4",i?"md:grid-cols-1":"md:grid-cols-1 lg:grid-cols-2"),children:[(0,l.jsx)(y,{title:"Unique Interacted Users",value:null!=(t=null==r?void 0:r.thisWeek)?t:0,icon:(0,l.jsx)(h.A,{className:"w-6 h-6 text-white fill-current",strokeWidth:1}),percentChange:null==r?void 0:r.percentChange,isLoading:p,variant:n}),(0,l.jsx)(y,{title:"Total Conversations",value:null!=(s=null==j?void 0:j.totalConversations.thisWeek)?s:0,icon:(0,l.jsx)(u.A,{className:"w-6 h-6 text-white fill-current",strokeWidth:1}),percentChange:null==j?void 0:j.totalConversations.percentChange,isLoading:p,variant:n}),(0,l.jsx)(y,{title:"Avg. Conversation Time",value:S(null==j?void 0:j.averageSecondsPerConversation.thisWeek),icon:(0,l.jsx)(m.A,{className:"w-6 h-6 text-white"}),percentChange:null==j?void 0:j.averageSecondsPerConversation.percentChange,isLoading:p,variant:n}),(0,l.jsx)(y,{title:"Total Conversation Time",value:S(null==j?void 0:j.secondsSpoken.thisWeek),icon:(0,l.jsx)(f.A,{className:"w-6 h-6 text-white"}),percentChange:null==j?void 0:j.secondsSpoken.percentChange,isLoading:p,variant:n})]})}function S(e){if(!e)return"0s";let t=Math.round(e);if(t<60)return"".concat(t,"s");if(t<3600){let e=Math.floor(t/60);
1return"".concat(e,"m ").concat((t%60).toString().padStart(2,"0"),"s")}{let e=Math.floor(t/3600),s=Math.floor(t%3600/60);return"".concat(e,"h ").concat(s.toString().padStart(2,"0"),"m ").concat((t%60).toString().padStart(2,"0"),"s")}}var A=s(39724);function k(){let{variant:e="default"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selectedIdentityId:t}=(0,c.G)(),{data:s,isLoading:i}=o.F.engagementAnalytics.chatsLast7Days.useQuery({identityId:null!=t?t:""},{enabled:!!t}),n=(s||[]).map(e=>({day:e.date.toLocaleDateString("en-US",{weekday:"short"}),conversations:e.count})),a=function(e){let t=e.reduce((e,t)=>Math.max(e,t.conversations),0);if(0===t)return[0];if(t<=10)return[0,t];if(t<=100){let e=10*Math.ceil(t/10);return Array.from({length:4},(t,s)=>Math.round(e/4*s)).concat(e)}let s=10*Math.ceil(t/10),l=10*Math.ceil(s/5/10),i=Array.from({length:5},(e,t)=>t*l);return i.push(s),i}(n),r=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"mb-6 flex h-6 items-center",children:[(0,l.jsx)("span",{className:"mr-2 inline-block h-2 w-2 rounded-full bg-brand-blue"}),(0,l.jsx)("span",{className:"text-sm font-light text-white/70",children:"Total Conversations"})]}),(0,l.jsx)("div",{className:"flex flex-1",children:(0,l.jsx)("div",{className:"min-h-[170px] flex-1",children:i?(0,l.jsx)("div",{className:"flex h-full w-full items-end justify-between gap-2",children:Array.from({length:7}).map((e,t)=>(0,l.jsx)(p.E,{style:{animationDelay:"".concat(.3*t,"s")},className:"h-[90%] w-[calc(100%/7-20px)] animate-pulse rounded-2xl"},t))}):(0,l.jsx)(A.ED,{data:n,keys:["conversations"],indexBy:"day",margin:{top:10,right:0,bottom:24,left:30},padding:.3,colors:["#2956B4"],borderRadius:16,axisLeft:{tickSize:0,tickPadding:8,tickRotation:0,legend:"",legendPosition:"middle",legendOffset:32,tickValues:a},axisRight:null,axisTop:null,axisBottom:{tickSize:0,tickPadding:8,tickRotation:0,legend:"",legendPosition:"middle",legendOffset:32},enableGridY:!1,enableLabel:!1,theme:{background:"transparent",text:{fill:"#d1d5db",fontSize:14},axis:{ticks:{text:{fill:"#d1d5db",fontSize:14}}},tooltip:{container:{background:"#23243a",color:"#fff",fontSize:14,borderRadius:8}}},animate:!0,motionConfig:"wobbly",tooltip:e=>{let{value:t,indexValue:s}=e;return(0,l.jsxs)("div",{className:"rounded-lg bg-[#1d2332] px-3 py-2 text-sm whitespace-nowrap",children:[s,": ",t]})}})})})]});return"studio"===e?(0,l.jsx)("div",{className:"w-full flex-1 flex flex-col",children:r}):(0,l.jsxs)("div",{className:"flex w-full flex-1 flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsx)("span",{className:"text-xl",children:"Persona Engagement"}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),r]})}var T=s(10912),C=s(31761);function I(){let{open:e}=(0,T.cL)();return(0,l.jsx)(C._T,{title:"Engagement overview",description:"Weekly activity and conversation trends for your persona.",children:(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(b,{isSidebarOpen:e,variant:"studio"}),(0,l.jsx)("div",{className:(0,x.cn)("hidden xl:flex",e?"md:hidden":"lg:flex"),children:(0,l.jsx)(k,{variant:"studio"})}),(0,l.jsx)("div",{className:(0,x.cn)("flex xl:hidden",e?"md:flex":"lg:hidden"),children:(0,l.jsx)(k,{variant:"studio"})})]})})}var O=s(5218),E=s(43185),R=s(4123);function U(e){let{item:t}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-white-06 px-6 py-4 backdrop-blur-[1px] flex h-full flex-col",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between mb-3 flex-1",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h3",{className:"text-sm font-medium truncate text-white",children:t.title}),t.description&&(0,l.jsx)("p",{className:"text-xs mt-1 line-clamp-2 text-white/60",children:t.description})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 ml-2 flex-shrink-0",children:(0,l.jsx)("a",{href:t.url,target:"_blank",rel:"noopener noreferrer","aria-label":"Open ".concat(t.title),title:"Open ".concat(t.title),children:(0,l.jsx)(O.A,{className:"w-4 h-4 text-white/60 hover:text-white transition-colors"})})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3 mt-auto",children:[(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(E.A,{className:"w-4 h-4 text-white/60"})}),(0,l.jsx)("div",{className:"text-lg font-medium text-white",children:t.totalMentions}),(0,l.jsx)("div",{className:"text-xs text-white/60",children:"Mentions"})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(R.A,{className:"w-4 h-4 text-white/60"})}),(0,l.jsx)("div",{className:"text-lg font-medium text-white",children:t.totalClicks}),(0,l.jsx)("div",{className:"text-xs text-white/60",children:"Clicks"})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)("div",{className:"w-4 h-4 rounded-full bg-white/20 flex items-center justify-center",children:(0,l.jsx)("span",{className:"text-xs text-white",children:"%"})})}),(0,l.jsxs)("div",{className:"text-lg font-medium text-white",children:[t.clickThroughRate,"%"]}),(0,l.jsx)("div",{className:"text-xs text-white/60",children:"CTR"})]})]})]})}function _(e){let{item:t}=e;return(0,l.jsxs)("div",{className:"rounded-2xl border border-white/8 bg-white-06 px-6 py-4 backdrop-blur-[1px] flex h-full flex-col",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between mb-3 flex-1",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("h3",{className:"text-sm font-medium truncate text-white/50",children:t.title}),t.description&&(0,l.jsx)("p",{className:"text-xs mt-1 line-clamp-2 text-white/30",children:t.description})]}),(0,l.jsx)("div",{className:"flex items-center gap-2 ml-2 flex-shrink-0",children:(0,l.jsx)("span",{className:"text-xs text-red-400 bg-red-400/10 px-2 py-1 rounded-full",children:"Deleted"})})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3 mt-auto",children:[(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(E.A,{className:"w-4 h-4 text-white/30"})}),(0,l.jsx)("div",{className:"text-lg font-medium text-white/50",children:t.totalMentions}),(0,l.jsx)("div",{className:"text-xs text-white/30",children:"Mentions"})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(R.A,{className:"w-4 h-4 text-white/30"})}),(0,l.jsx)("div",{className:"text-lg font-medium text-white/50",children:t.totalClicks}),(0,l.jsx)("div",{className:"text-xs text-white/30",children:"Clicks"})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)("div",{className:"w-4 h-4 rounded-full bg-white/20 flex items-center justify-center",children:(0,l.jsx)("span",{className:"text-xs text-white/50",children:"%"})})}),(0,l.jsxs)("div",{className:"text-lg font-medium text-white/50",children:[t.clickThroughRate,"%"]}),(0,l.jsx)("div",{className:"text-xs text-white/30",children:"CTR"})]})]})]})}function D(e){let{identityId:t,variant:s="default"}=e,{data:i,isLoading:n}=o.F.promotionalContentAnalytics.getAnalytics.useQuery({identityId:t}),a=n?(0,l.jsx)("div",{className:"flex h-full w-full flex-col gap-3",children:Array.from({length:3}).map((e,t)=>(0,l.jsx)(p.E,{className:"h-[120px] w-full rounded-2xl"},t))}):(null==i?void 0:i.length)===0?(0,l.jsx)("div",{className:"flex h-32 items-center justify-center text-white/50",children:(0,l.jsx)("p",{className:"text-sm",children:"No promotional content interactions yet"})}):(0,l.jsx)("div",{className:"grid w-full grid-cols-1 gap-3 lg:grid-cols-2 xl:grid-cols-3",children:null==i?void 0:i.map(e=>(0,l.jsx)("div",{className:"h-full",children:e.isDeleted?(0,l.jsx)(_,{item:e}):(0,l.jsx)(U,{item:e})},e.id))});return"studio"===s?(0,l.jsx)("div",{className:"w-full",children:a}):(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex h-full w-full flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsx)("span",{className:"text-xl",children:"Promotional Content"})}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),a]})})}function M(e){let{identityId:t}=e;return(0,l.jsx)(C._T,{title:"Promotional content",description:"Mentions, clicks, and click-through rates for links your persona shares in chat.",children:(0,l.jsx)(D,{identityId:t,variant:"studio"})})}var F=s(56242),L=s(65162),P=s(56444),z=s(23091),W=s(23542),V=s(73841);let Q={active:{text:"text-white",textSecondary:"text-white/60",textMuted:"text-white/60",icon:"text-white/60"},disabled:{text:"text-white/50",textSecondary:"text-white/30",textMuted:"text-white/30",icon:"text-white/30"}};function q(e){let{item:t}=e,s=t.isDeleted?Q.disabled:Q.active;return(0,l.jsxs)("div",{className:"bg-white-06 rounded-4xl px-6 py-4 backdrop-blur-[1px]",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,l.jsx)(V.A,{resourceType:t.resourceType,className:"".concat(s.icon," flex-shrink-0")}),(0,l.jsx)("span",{className:"text-xs ".concat(s.textMuted," capitalize"),children:t.resourceType.replace(/([A-Z])/g," $1").trim()})]}),(0,l.jsx)("h3",{className:"text-sm font-medium truncate ".concat(s.text),children:t.title})]}),t.isDeleted?(0,l.jsx)("span",{className:"text-xs text-red-400 bg-red-400/10 px-2 py-1 rounded-full flex-shrink-0",children:"Reference Deleted"}):(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)("span",{className:"text-xs text-gray-400",children:"Show as Reference"}),(0,l.jsxs)("span",{className:"text-xs px-2 py-1 rounded-full flex-shrink-0 flex items-center gap-1 ".concat(t.showAsReference?"text-green-400 bg-green-400/10":"text-orange-400 bg-orange-400/10"),
1children:[t.showAsReference?(0,l.jsx)(z.A,{className:"w-3 h-3"}):(0,l.jsx)(W.A,{className:"w-3 h-3"}),t.showAsReference?"ON":"OFF"]})]})]}),(0,l.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(E.A,{className:"w-4 h-4 ".concat(s.icon)})}),(0,l.jsx)("div",{className:"text-lg font-medium ".concat(s.text),children:t.totalMentions}),(0,l.jsx)("div",{className:"text-xs ".concat(s.textMuted),children:"Used as Reference"})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(u.A,{className:"w-4 h-4 ".concat(s.icon)})}),(0,l.jsx)("div",{className:"text-lg font-medium ".concat(s.text),children:t.uniqueConversations}),(0,l.jsxs)("div",{className:"text-xs ".concat(s.textMuted),children:[" ","Unique Conversations"]})]}),(0,l.jsxs)("div",{className:"text-center",children:[(0,l.jsx)("div",{className:"flex items-center justify-center mb-1",children:(0,l.jsx)(h.A,{className:"w-4 h-4 ".concat(s.icon)})}),(0,l.jsx)("div",{className:"text-lg font-medium ".concat(s.text),children:t.uniqueUsers}),(0,l.jsx)("div",{className:"text-xs ".concat(s.textMuted),children:"Unique Users"})]})]})]})}function B(e){let{identityId:t,variant:s="default"}=e,[i,n]=(0,L.useState)(!1),{data:a,isLoading:r}=o.F.engagementAnalytics.getReferenceAnalytics.useQuery({identityId:t}),c=i?a:null==a?void 0:a.slice(0,6),d=a&&a.length>6,x=r?(0,l.jsx)("div",{className:"flex h-full w-full flex-col gap-3",children:Array.from({length:3}).map((e,t)=>(0,l.jsx)(p.E,{className:"h-[120px] w-full rounded-2xl"},t))}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"grid w-full grid-cols-1 gap-3 lg:grid-cols-2",children:null==c?void 0:c.map(e=>(0,l.jsx)(q,{item:e},"".concat(e.id,"-").concat(e.resourceType)))}),d?(0,l.jsx)("div",{className:"mt-4 flex justify-center",children:(0,l.jsxs)(P.$,{variant:"ghost",size:"sm",onClick:()=>n(!i),className:"text-white/70 hover:text-white",children:[i?"Show Less":"Show More",(0,l.jsx)(F.A,{className:"ml-1 h-4 w-4 transition-transform ".concat(i?"rotate-180":"")})]})}):null]});return"studio"===s?(0,l.jsx)("div",{className:"w-full",children:x}):(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex h-full w-full flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsx)("span",{className:"text-xl",children:"Knowledge References"})}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),x]})})}function G(e){let{identityId:t}=e;return(0,l.jsx)(C._T,{title:"Knowledge references",description:"Which knowledge sources your persona cites most often in conversations.",children:(0,l.jsx)(B,{identityId:t,variant:"studio"})})}var K=s(53320),$=s.n(K),Y=s(27113),Z=s(78169),X=s(4109);function H(e){let{title:t,value:s,total:i,icon:n,className:a,isLoading:r}=e;return(0,l.jsxs)("div",{className:(0,x.cn)("relative bg-white-06 rounded-4xl px-6 py-4 backdrop-blur-[1px] flex flex-col space-y-2",a),children:[(0,l.jsxs)("div",{className:"flex justify-between items-center",children:[(0,l.jsx)("h3",{className:"text-white text-sm font-light",children:t}),n&&(0,l.jsx)("div",{className:"flex items-center justify-center",children:n})]}),(0,l.jsxs)("div",{className:"w-full flex justify-between items-center sm:flex-col sm:items-start sm:space-y-2",children:[(0,l.jsx)("div",{className:"text-xl text-white",children:r?(0,l.jsx)(p.E,{className:"w-20 h-4"}):"".concat(s,"%")}),(0,l.jsx)(X.z,{current:s,total:i,showCount:!1,className:"w-full",barClassName:"min-w-full"})]})]})}function J(e){let{identityId:t,variant:s="default"}=e,{data:i,isLoading:n}=o.F.survey.getUniqueUsersCount.useQuery({identityId:t}),{data:a,isLoading:r}=o.F.survey.getCompletionRate.useQuery({identityId:t}),c=n||r?(0,l.jsx)("div",{className:"flex h-full w-full flex-col gap-3",children:Array.from({length:2}).map((e,t)=>(0,l.jsx)(p.E,{className:"h-[56px] w-full rounded-2xl"},t))}):(0,l.jsxs)("div",{className:"flex h-full w-full flex-col gap-3 overflow-auto sm:grid sm:grid-cols-2",children:[(0,l.jsx)(y,{title:"Total User Answered Survey",value:null!=i?i:0,icon:(0,l.jsx)(h.A,{className:"h-6 w-6 fill-current text-white",strokeWidth:1}),isLoading:n,showTrend:!1,variant:s}),(0,l.jsx)(H,{icon:(0,l.jsx)(Z.A,{}),title:"Answers Completion Rate",value:null!=a?a:0,total:100})]});return"studio"===s?(0,l.jsx)("div",{className:"w-full",children:c}):(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex h-full w-full flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsx)("span",{className:"text-xl",children:"Survey"})}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),c]})})}var ee=s(48374);function et(e){let{identityId:t}=e;return(0,l.jsx)(C._T,{title:"Survey",description:"How many users answered your pre-chat questions and how completely they responded.",headerAction:(0,l.jsx)(P.$,{asChild:!0,variant:"ghost",size:"sm",className:"shrink-0 text-white/70 hover:text-white",children:(0,l.jsxs)($(),{href:ee.bw.STUDIO_SURVEY_RESPONSES,children:[(0,l.jsx)(Y.A,{className:"mr-2 h-4 w-4"}),"View all in Survey responses"]})}),children:(0,l.jsx)(J,{identityId:t,variant:"studio"})})}var es=s(6608),el=s(9244),ei=s(50278);function en(e){let{identityId:t,variant:s="default"}=e,{isPending:i,data:n}=o.F.chat.getChatsByCount.useQuery({identityId:t,count:4},{enabled:!!t,refetchOnWindowFocus:!1}),a=i?(0,l.jsx)("div",{className:"flex h-full w-full flex-col gap-2.5",children:Array.from({length:3}).map((e,t)=>(0,l.jsx)(p.E,{className:(0,x.cn)("w-full","studio"===s?"h-11 rounded-xl":"h-[56px] rounded-2xl")},t))}):(0,l.jsx)("div",{className:(0,x.cn)("flex h-full w-full flex-col overflow-auto","studio"===s?"gap-2.5":"gap-3"),children:n&&n.length>0?n.map((e,t)=>(0,l.jsx)(er,{conversation:e,variant:s},t)):(0,l.jsx)(ea,{variant:s})});return"studio"===s?(0,l.jsxs)("div",{className:"w-full space-y-3",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-white/70",children:"Recent chats"}),a]}):(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex h-full w-full flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("span",{className:"text-xl",children:"Last Conversations"}),(null!=n?n:[]).length>0&&(0,l.jsx)($(),{href:ee.bw.STUDIO_CONVERSATIONS,children:(0,l.jsx)(P.$,{variant:"ghost",size:"sm",className:"p-0 text-white",children:"View More"})})]}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),a]})})}let ea=e=>{let{variant:t}=e;return"studio"===t?(0,l.jsx)(ei.P,{className:"px-4 py-8",icon:(0,l.jsx)(es.A,{className:"h-5 w-5 text-white/50"}),title:"No conversations yet",description:"Start chatting to see your conversation history here."}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,l.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-white/8",children:(0,l.jsx)(es.A,{className:"h-6 w-6 text-white/50"})}),(0,l.jsx)("h3",{className:"mb-1 text-base font-medium text-white",children:"No conversations yet"}),(0,l.jsx)("p",{className:"max-w-sm text-xs text-white/50",children:"Start chatting to see your conversation history here."})]})},er=e=>{var t;let{conversation:s,variant:i}=e,n="studio"===i;return(0,l.jsxs)("div",{className:(0,x.cn)("flex w-full items-center justify-between border border-white/8 bg-white/4 text-white",n?"rounded-xl px-4 py-3 text-sm":"rounded-2xl p-4 text-sm font-light xl:text-base"),children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,l.jsx)("div",{className:(0,x.cn)("min-w-0 truncate",n&&"font-medium"),children:null!=(t=s.title)?t:"New Chat"}),(0,l.jsxs)("div",{className:(0,x.cn)("min-w-0 items-center gap-1 text-white/45",n?"hidden truncate text-xs lg:flex":"hidden xl:flex"),children:[(0,l.jsx)("span",{children:"with"}),(0,l.jsx)("span",{className:"truncate",children:(()=>{var e,t;let l=null==(e=s.interactedUserDisplayName)?void 0:e.trim(),i=null==(t=s.interactedUserEmail)?void 0:t.trim();return l&&i?"".concat(l," (").concat(i,")"):l||i||"Unknown User"})()})]})]}),(0,l.jsx)("div",{className:(0,x.cn)("shrink-0 whitespace-nowrap text-white/45",n?"ml-3 text-xs":"text-xs xl:text-sm"),children:(0,el.A)(s.createdAt)})]})};var ec=s(43700);function ed(e){let{identityId:t,variant:s="default"}=e,{data:i,isLoading:n}=o.F.engagementAnalytics.mostPopularTopics.useQuery({identityId:t}),a=n?(0,l.jsx)("div",{className:"flex h-full w-full flex-col gap-2.5",children:Array.from({length:3}).map((e,t)=>(0,l.jsx)(p.E,{className:(0,x.cn)("w-full","studio"===s?"h-11 rounded-xl":"h-[56px] rounded-2xl")},t))}):(0,l.jsx)("div",{className:(0,x.cn)("flex h-full w-full flex-col overflow-auto","studio"===s?"gap-2.5":"gap-3"),children:i&&i.length>0?i.slice(0,4).map((e,t)=>(0,l.jsx)(eo,{topic:e,variant:s},t)):(0,l.jsx)(ex,{variant:s})});return"studio"===s?(0,l.jsxs)("div",{className:"w-full space-y-3",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-white/70",children:"Top topics"}),a]}):(0,l.jsx)("div",{className:"w-full",children:(0,l.jsxs)("div",{className:"flex h-full w-full flex-col rounded-4xl bg-white-06 p-6 text-white",children:[(0,l.jsx)("span",{className:"text-xl",children:"Top Topics"}),(0,l.jsx)("div",{className:"my-4 h-[1px] w-full bg-white-06"}),a]})})}let eo=e=>{let{topic:{name:t,count:s},variant:i}=e,n="studio"===i;return(0,l.jsxs)("div",{className:(0,x.cn)("flex w-full items-center justify-between border border-white/8 bg-white/4 text-white",n?"rounded-xl px-4 py-3 text-sm":"rounded-2xl p-4 text-sm font-light xl:text-base"),children:[(0,l.jsx)("div",{className:(0,x.cn)("min-w-0 truncate",n&&"font-medium"),children:t}),(0,l.jsxs)("div",{className:(0,x.cn)("shrink-0 whitespace-nowrap text-white/45",n?"ml-3 text-xs":"text-xs xl:text-sm"),children:[s," ",1===s?"mention":"mentions"]})]})},ex=e=>{let{variant:t}=e;return"studio"===t?(0,l.jsx)(ei.P,{className:"px-4 py-8",icon:(0,l.jsx)(ec.A,{className:"h-5 w-5 text-white/50"}),title:"No topics yet",description:"Start chatting to see popular topics from your conversations."}):(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 text-center",children:[(0,l.jsx)("div",{className:"mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-white/8",children:(0,l.jsx)(ec.A,{className:"h-6 w-6 text-white/50"})}),(0,l.jsx)("h3",{className:"mb-1 text-base font-medium text-white",children:"No topics yet"}),(0,l.jsx)("p",{className:"max-w-sm text-xs text-white/50",children:"Start chatting to see popular topics from your conversations."})]})};function eh(e){let{identityId:t}=e,{open:s}=(0,T.cL)();return(0,l.jsx)(C._T,{title:"Topics & Conversations",description:"What users are talking about and your most recent chats.",headerAction:(0,l.jsx)(P.$,{asChild:!0,variant:"ghost",size:"sm",className:"h-auto shrink-0 px-2.5 py-1.5 text-xs text-white/60 hover:text-white",children:(0,l.jsxs)($(),{href:ee.bw.STUDIO_CONVERSATIONS,children:[(0,l.jsx)(es.A,{className:"mr-1.5 h-3.5 w-3.5"}),"View all"]})}),children:(0,l.jsxs)("div",{className:(0,x.cn)("grid grid-cols-1 gap-6 sm:grid-cols-2",s?"sm:grid-cols-1 lg:grid-cols-2":"md:grid-cols-2"),children:[(0,l.jsx)(ed,{identityId:t,variant:"studio"}),(0,l.jsx)(en,{identityId:t,variant:"studio"})]})})}function eu(e){let{identityId:t}=e,{data:s}=o.F.survey.getQuestions.useQuery({identityId:t}),{data:i}=o.F.promotionalContent.getByIdentityId.useQuery({identityId:t}),{data:n}=o.F.engagementAnalytics.getReferenceAnalytics.useQuery({identityId:t}),a=s&&s.length>0,r=i&&i.length>0,c=n&&n.length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,l.jsx)(I,{}),(0,l.jsx)(eh,{identityId:t}),a?(0,l.jsx)(et,{identityId:t}):null,r?(0,l.jsx)(M,{identityId:t}):null,c?(0,l.jsx)(G,{identityId:t}):null]})}var em=s(38388),ef=s(79214);function ej(){let{user:e,isSignedIn:t}=(0,n.u)(),{selectedIdentity:s,isIdentityLoading:o,isSettingDefault:x,isPersonasLoading:h}=(0,c.G)(),{canAccessStudio:u}=(0,d.u)();if(!t||!e||!u&&!h)return null;if(h||o)return(0,l.jsx)(i.A,{children:(0,l.jsx)("div",{className:"flex min-h-100 items-center justify-center",children:(0,l.jsx)(a.T,{})})});if(!s)return(0,l.jsx)(i.A,{children:(0,l.jsx)(r.R,{})});let m=ef.Z[ee.bw.STUDIO_OVERVIEW];return(0,l.jsx)(i.A,{children:(0,l.jsxs)("div",{className:"relative flex h-full min-h-0 flex-col",children:[x?(0,l.jsx)("div",{className:"absolute inset-0 z-50 flex items-center justify-center rounded-4xl backdrop-blur-xs"}):null,(0,l.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-y-auto pb-4",children:[m?(0,l.jsx)(em.D,{title:m.label,description:m.description}):null,(0,l.jsx)(eu,{identityId:s.id})]})]})})}},15066:(e,t,s)=>{"use strict";s.d(t,{R:()=>o});var l=s(4930),i=s(10523),n=s(56444),a=s(21333),r=s(31761),c=s(55647),d=s(85713);function o(){let e=c.F.useUtils(),{user:t}=(0,d.u)(),{mutateAsync:s,isPending:o}=c.F.user.initIdentity.useMutation({onSuccess:()=>
1{e.onboarding.checkOnboarding.invalidate(),e.user.getUser.invalidate(),e.user.getUserPersona.invalidate(),e.user.getUserPersonas.invalidate()}}),x=async()=>{if(t)try{await s()}catch(e){i.oR.error("Failed to create persona. Please try again.")}};return(0,l.jsx)("div",{className:"mx-auto max-w-lg",children:(0,l.jsx)(r._T,{title:"Welcome to your creator studio",description:"This is where you build and manage your personas â profile, knowledge, chat experience, and more.",children:(0,l.jsxs)("div",{className:"flex flex-col items-center gap-6 text-center",children:[(0,l.jsx)("p",{className:"text-sm leading-relaxed text-white/50",children:"You're verified and ready to go. Create your first persona to start your journey â it only takes a few minutes."}),(0,l.jsxs)(n.$,{onClick:()=>void x(),disabled:o,className:"px-8",children:["Create persona",o?(0,l.jsx)(a.A,{className:"ml-2"}):null]})]})})})}},38388:(e,t,s)=>{"use strict";s.d(t,{D:()=>i});var l=s(4930);function i(e){let{title:t,description:s}=e;return t?(0,l.jsxs)("header",{className:"flex flex-col gap-1",children:[(0,l.jsx)("h1",{className:"text-2xl font-medium text-white",children:t}),s?(0,l.jsx)("p",{className:"max-w-3xl text-sm leading-relaxed text-white/60",children:s}):null]}):null}},50278:(e,t,s)=>{"use strict";s.d(t,{P:()=>n});var l=s(4930),i=s(68396);function n(e){let{title:t,description:s,icon:n,className:a}=e;return(0,l.jsxs)("div",{className:(0,i.cn)("flex flex-col items-center gap-3 rounded-2xl border border-dashed border-white/10 px-6 py-10 text-center",a),children:[(0,l.jsx)("div",{className:"flex size-10 items-center justify-center rounded-full bg-white/5",children:n}),(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-white/70",children:t}),(0,l.jsx)("p",{className:"text-sm text-white/40",children:s})]})]})}},57433:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/main/studio/overview",function(){return s(9817)}])},73841:(e,t,s)=>{"use strict";s.d(t,{A:()=>x});var l=s(4930),i=s(72522),n=s(32540),a=s(84024),r=s(15138),c=s(17293),d=s(4329),o=s(28464);function x(e){let{resourceType:t,size:s=16,className:x}=e;switch(t){case"tikTokVideo":return(0,l.jsx)(d.BsT,{fontSize:s,className:x});case"instagramVideo":return(0,l.jsx)(c.ao$,{fontSize:s,className:x});case"youtubeVideo":return(0,l.jsx)(o.SI,{fontSize:s,className:x});case"file":return(0,l.jsx)(i.A,{size:s,className:x});case"additionalKnowledgeText":return(0,l.jsx)(n.A,{size:s,className:x});case"webLink":return(0,l.jsx)(a.A,{size:s,className:x});default:return(0,l.jsx)(r.A,{size:s,className:x})}}},79214:(e,t,s)=>{"use strict";s.d(t,{Z:()=>i});var l=s(48374);let i={[l.bw.STUDIO_OVERVIEW]:{label:"Overview",description:"Track engagement, conversation trends, and how users interact with your persona."},[l.bw.STUDIO_GETTING_STARTED]:{label:"Getting started",description:"A simple path for new creators: set up the five essentials that matter most before you go deeper."},[l.bw.STUDIO_PROFILE]:{label:"Profile",description:"Set how your persona appears when people discover it in Explore."},[l.bw.STUDIO_PERSONALITY]:{label:"Personality",description:"Shape how your persona presents itself â its backstory, communication style, and voice."},[l.bw.STUDIO_KNOWLEDGE]:{label:"Knowledge",description:"Teach your persona what it knows â add web pages, social videos, files, and personal notes, or use the Knowledge Wizard to capture expertise through conversation."},[l.bw.STUDIO_VISIBILITY]:{label:"Visibility",description:"Control who can see, discover, and interact with your persona."},[l.bw.STUDIO_COLLABORATORS]:{label:"Collaborators",description:"Invite team members to help you build and manage your persona."},[l.bw.STUDIO_MONETIZATION]:{label:"Monetization",description:"Add products, courses, and services your persona can recommend during conversations."},[l.bw.STUDIO_WELCOME]:{label:"Welcome",description:"Shape the first impression when someone opens a chat with your persona. Visitors see your video first, then your greeting message, starter questions, and optional survey questions before they begin."},[l.bw.STUDIO_RULES]:{label:"Rules",description:"Shape how your persona responds â set fixed answers for key topics, steer conversations toward your expertise, fine-tune behavior, and fix answers from real chats."},[l.bw.STUDIO_MODES]:{label:"Modes",description:"Control how users communicate with your persona. Text chat is always available â enable voice or video when you're ready to offer richer interactions."},[l.bw.STUDIO_CONVERSATIONS]:{label:"Conversations",description:"Browse chat history with your persona â read full threads, spot recurring topics, and find gaps in your knowledge base."},[l.bw.STUDIO_SURVEY_RESPONSES]:{label:"Survey responses",description:"Review answers to your survey questions and understand what users are sharing before they chat."}}}},e=>{e.O(0,[2566,6344,9132,7215,3271,3606,420,851,5998,9519,3941,6544,3410,872,7301,7609,6414,7826,636,6593,8792],()=>e(e.s=57433)),_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.