1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8272],{87088:function(e,n,l){l.d(n,{Z:function(){return a}});var o=l(57437),t=l(37630),i=l(18087);let r={up:"#16A34A",down:"#DC2626",neutral:"#6B7280"};function a(e){let{label:n,value:l,sub:a,subType:s="neutral",accentColor:d}=e;return(0,o.jsxs)(t.Z,{elevation:0,sx:{border:"1px solid #E4E7EC",borderTop:d?"3px solid ".concat(d):"1px solid #E4E7EC",p:"16px 18px",borderRadius:0,height:"100%"},children:[(0,o.jsx)(i.Z,{sx:{fontSize:"11px",color:"#6B7280",fontWeight:500,mb:.5},children:n}),(0,o.jsx)(i.Z,{sx:{fontSize:"20px",fontWeight:700,color:"#1A1D23",lineHeight:1.3},children:l}),a&&(0,o.jsx)(i.Z,{sx:{fontSize:"11px",fontWeight:500,mt:.5,color:r[s]},children:a})]})}},24985:function(e,n,l){l.d(n,{Z:function(){return v}});var o=l(57437);l(2265);var t=l(29257),i=l(18087),r=l(16492),a=l(40512),s=l(49565),d=l(58129),c=l(37256),u=l(25211),x=l(30953),f=l(80403);let p={Active:{bg:"#DCFCE7",color:"#16A34A"},Paused:{bg:"#FEF3C7",color:"#D97706"},Draft:{bg:"#F3F4F6",color:"#6B7280"},Archived:{bg:"#F3F4F6",color:"#6B7280"}};function h(e){let{label:n,bg:l,color:i}=e;return(0,o.jsx)(t.Z,{component:"span",sx:{display:"inline-flex",px:1.25,py:.25,borderRadius:0,fontSize:"11px",fontWeight:500,backgroundColor:l,color:i,whiteSpace:"nowrap"},children:n})}let g={FULL_NAME:"Name",FIRST_NAME:"First Name",LAST_NAME:"Last Name",EMAIL:"Email",PHONE:"Phone",PHONE_NUMBER:"Phone",COMPANY_NAME:"Company",JOB_TITLE:"Job Title",CITY:"City",STATE:"State",COUNTRY:"Country",ZIP:"ZIP",CUSTOM:"Custom"};function m(e){var n,l,r,a;let{index:s,question:d,answer:c,showType:u}=e,x=d.label||(null===(n=d.key)||void 0===n?void 0:n.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase()))||"Field ".concat(s+1),f=null!==(a=g[null==(r=d.type)?void 0:r.toUpperCase()])&&void 0!==a?a:null!=r?r:"",p=null==c?void 0:null===(l=c.values)||void 0===l?void 0:l[0];return(0,o.jsxs)(t.Z,{sx:{py:1.5,borderBottom:"1px solid #F3F4F6"},children:[(0,o.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,mb:void 0!==c?.75:0},children:[(0,o.jsxs)(i.Z,{sx:{fontSize:"11px",fontWeight:600,color:"#6B7280",minWidth:18},children:[s+1,"."]}),(0,o.jsx)(i.Z,{sx:{fontSize:"13px",fontWeight:500,flex:1},children:x}),u&&f&&(0,o.jsx)(t.Z,{component:"span",sx:{fontSize:"10px",fontWeight:500,px:1,py:.25,borderRadius:0,backgroundColor:"#EEF2FF",color:"#4F46E5"},children:f})]}),void 0!==c&&(0,o.jsx)(t.Z,{sx:{ml:3.5},children:p?(0,o.jsx)(i.Z,{sx:{fontSize:"13px",color:"#111827",fontWeight:500,px:1.5,py:.75,backgroundColor:"#F9FAFB",borderRadius:0,border:"1px solid #E5E7EB"},children:p}):(0,o.jsx)(i.Z,{sx:{fontSize:"12px",color:"#9CA3AF",fontStyle:"italic"},children:null!==c?"Skipped":"No answer provided"})})]})}function v(e){var n,l;let{open:g,onClose:v,form:E,formLoading:C,answers:y,submittedAt:A}=e,S=void 0!==y,b=null!==(n=null==E?void 0:E.questions)&&void 0!==n?n:[],F=(0,f.fb)(null==E?void 0:E.status),_=p[F]||{bg:"#F3F4F6",color:"#6B7280"},j={};for(let e of null!=y?y:[])e.name&&(j[e.name.toLowerCase()]=e);return(0,o.jsxs)(r.Z,{open:g,onClose:v,maxWidth:"sm",fullWidth:!0,PaperProps:{sx:{borderRadius:0,maxHeight:"85vh"}},children:[(0,o.jsxs)(a.Z,{sx:{pb:1,pr:6},children:[(0,o.jsx)(i.Z,{sx:{fontSize:"15px",fontWeight:700,lineHeight:1.3}
1,children:null!==(l=null==E?void 0:E.name)&&void 0!==l?l:C?"Loadingâ¦":"Lead Form"}),E&&(0,o.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1,mt:.75,flexWrap:"wrap"},children:[(0,o.jsx)(h,{label:F,bg:_.bg,color:_.color}),E.locale&&(0,o.jsx)(i.Z,{sx:{fontSize:"11px",color:"#6B7280"},children:E.locale}),E.created_time&&(0,o.jsxs)(i.Z,{sx:{fontSize:"11px",color:"#6B7280"},children:["Created ",(0,f.yu)(E.created_time)]}),S&&A&&(0,o.jsx)(h,{label:"Submitted ".concat((0,f.yu)(A)),bg:"#EEF2FF",color:"#4F46E5"})]}),(0,o.jsx)(s.Z,{onClick:v,sx:{position:"absolute",top:8,right:8,width:48,height:48},children:(0,o.jsx)(x.eSQ,{size:28})})]}),(0,o.jsx)(d.Z,{}),(0,o.jsx)(c.Z,{sx:{px:3,py:0},children:C?(0,o.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",py:5},children:(0,o.jsx)(u.Z,{size:28})}):0===b.length?(0,o.jsx)(t.Z,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:5},children:(0,o.jsx)(i.Z,{sx:{fontSize:"13px",color:"#9CA3AF"},children:"No questions found for this form."})}):(0,o.jsxs)(t.Z,{sx:{py:.5},children:[(0,o.jsxs)(i.Z,{sx:{fontSize:"11px",color:"#6B7280",py:1.25},children:[b.length," ",1===b.length?"question":"questions",S&&" \xb7 ".concat(b.filter(e=>{var n,l,o;return null===(l=j[null===(o=e.key)||void 0===o?void 0:o.toLowerCase()])||void 0===l?void 0:null===(n=l.values)||void 0===n?void 0:n[0]}).length," answered")]}),b.map((e,n)=>{var l,t,i,r;return(0,o.jsx)(m,{index:n,question:e,answer:S?null!==(t=j[null===(l=e.key)||void 0===l?void 0:l.toLowerCase()])&&void 0!==t?t:null:void 0,showType:!S},null!==(r=null!==(i=e.id)&&void 0!==i?i:e.key)&&void 0!==r?r:n)})]})})]})}},91373:function(e,n,l){l.d(n,{P:function(){return d}});var o=l(57437),t=l(29257),i=l(18087),r=l(80403);let a=[{bg:"#EEF2FF",color:"#4F46E5"},{bg:"#EDE9FE",color:"#7C3AED"},{bg:"#DCFCE7",color:"#16A34A"},{bg:"#FEF3C7",color:"#D97706"},{bg:"#EBF1FF",color:"#1A6BFF"}];function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(var n,l=arguments.length,o=Array(l>1?l-1:0),t=1;t<l;t++)o[t-1]=arguments[t];for(let l of o){let o=e.find(e=>e.name===l);if(null==o?void 0:null===(n=o.values)||void 0===n?void 0:n[0])return o.values[0]}return"â"}let d=()=>[{accessorKey:"field_data",id:"name",header:"Name",filterConfig:{label:"Name",dataType:"text",key:"name"},cell:e=>{let{row:n}=e,l=s(n.original.field_data,"full_name","name"),{bg:r,color:d}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return a[(e.charCodeAt(0)||0)%a.length]}(l);return(0,o.jsxs)(t.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,o.jsx)(t.Z,{sx:{width:28,height:28,borderRadius:"50%",backgroundColor:r,color:d,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"11px",fontWeight:700,flexShrink:0},children:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=e.trim().split(/\s+/);return n.length>=2?"".concat(n[0][0]).concat(n[n.length-1][0]).toUpperCase():e.slice(0,2).toUpperCase()||"?"}(l)}),(0,o.jsx)(i.Z,{sx:{fontSize:"12px",fontWeight:500,color:"primary.main"},children:l})]})}},{accessorKey:"field_data",id:"phone",header:"Phone",cell:e=>{let{row:n}=e;return(0,o.jsx)(i.Z,{sx:{fontSize:"12px"},children:s(n.original.field_data,"phone_number","phone")})}},{accessorKey:"field_data",id:"email",header:"Email",filterConfig:{label:"Email",dataType:"text",key:"email"},cell:e=>{let{row:n}=e;return(0,o.jsx)(i.Z,{sx:{fontSize:"12px"},children:s(n.original.field_data,"email")})}},{accessorKey:"field_data",id:"company",header:"Company",cell:e=>{let{row:n}=e;return(0,o.jsx)(i.Z,{sx:{fontSize:"12px",color:"#6B7280"},children:s(n.original.field_data,"company_name","company")})}},{accessorKey:"form_name",id:"form_name",header:"Lead Form",filterConfig:{label:"Form",dataType:"text",key:"form_name"},cell:e=>{var n;let{row:l}=e;return(0,o.jsx)(i.Z,{sx:{fontSize:"12px",color:"#4F46E5"},children:null!==(n=l.original.form_name)&&void 0!==n?n:"â"})}},{accessorKey:"created_time",id:"created_time",header:"Received",cell:e=>{let{row:n}=e;return(0,o.jsx)(i.Z,{sx:{fontSize:"12px",color:"#6B7280"},children:(0,r.yu)(n.original.created_time)}
1)}}]},80403:function(e,n,l){l.d(n,{EY:function(){return a},dP:function(){return o.pP},fb:function(){return t},y1:function(){return i},yu:function(){return r}});var o=l(21103);let t=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null!==(e=({ACTIVE:"Active",PAUSED:"Paused",ARCHIVED:"Archived",DELETED:"Deleted",DRAFT:"Draft",WITH_ISSUES:"Issues"})[String(n).toUpperCase()])&&void 0!==e?e:n},i=function(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return null!==(e=({LEAD_GENERATION:"Lead Gen",OUTCOME_LEADS:"Lead Gen",CONVERSIONS:"Conversions",OUTCOME_SALES:"Conversions",BRAND_AWARENESS:"Awareness",OUTCOME_AWARENESS:"Awareness",REACH:"Reach",TRAFFIC:"Traffic",OUTCOME_TRAFFIC:"Traffic",ENGAGEMENT:"Engagement",OUTCOME_ENGAGEMENT:"Engagement",VIDEO_VIEWS:"Video Views",APP_INSTALLS:"App Installs",OUTCOME_APP_PROMOTION:"App Installs",MESSAGES:"Messages"})[n])&&void 0!==e?e:n},r=e=>e?new Date(e).toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"}):"â",a=function(){var e,n,l,o,t;let i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null===(n=i.geo_locations)||void 0===n?void 0:null===(e=n.cities)||void 0===e?void 0:e.map(e=>e.name).join(", "),a=null===(o=i.geo_locations)||void 0===o?void 0:null===(l=o.countries)||void 0===l?void 0:l.join(", "),s=i.age_min&&i.age_max?"".concat(i.age_min,"â").concat(i.age_max):"â",d=i.genders;return{location:r||a||"Pan India",age:s,gender:Array.isArray(d)&&1===d.length&&null!==(t=({1:"Male",2:"Female"})[d[0]])&&void 0!==t?t:"All"}}},8272:function(e,n,l){l.r(n),l.d(n,{default:function(){return h}});var o=l(57437),t=l(2265),i=l(73667),r=l(29257),a=l(19222),s=l(66246),d=l(87088),c=l(91373),u=l(80403),x=l(55748),f=l(24985);let p=(0,c.P)();function h(){let e=(0,t.useContext)(a.G),{leads:n,isLoading:l,hasNext:c,hasPrev:h,goNext:g,goPrev:m,count:v,pageSize:E,onPageSizeChange:C}=function(){var e,n,l;let o=(0,t.useContext)(a.G),[r,s]=(0,t.useState)(null),[d,c]=(0,t.useState)([]),[u,f]=(0,t.useState)(10),{data:p,isLoading:h}=(0,i.a)({queryKey:["meta","leads",r,u],queryFn:()=>(0,x.hct)(o,{page_size:u,...r?{after:r}:{}}),enabled:!!(null==o?void 0:o.axiosInstance),keepPreviousData:!0}),g=null!==(e=null==p?void 0:p.next)&&void 0!==e?e:null,m=!!g,v=d.length>0;return{leads:null!==(n=null==p?void 0:p.results)&&void 0!==n?n:[],isLoading:h,hasNext:m,hasPrev:v,goNext:()=>{g&&(c(e=>[...e,r]),s(g))},goPrev:()=>{if(!v)return;let e=[...d],n=e.pop();c(e),s(n)},count:null!==(l=null==p?void 0:p.count)&&void 0!==l?l:null,pageSize:u,onPageSizeChange:e=>{f(e),s(null),c([])}}}(),[y,A]=(0,t.useState)(null),{data:S,isLoading:b}=(0,i.a)({queryKey:["meta","lead-form",null==y?void 0:y.form_id],queryFn:()=>(0,x.uHi)(e,y.form_id).then(e=>{var n;return null!==(n=e.data)&&void 0!==n?n:e}),enabled:!!(null==y?void 0:y.form_id)&&!!(null==e?void 0:e.axiosInstance)});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r.Z,{sx:{p:2.5,pb:0},children:(0,o.jsxs)(r.Z,{sx:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:1.75,mb:2.25},children:[(0,o.jsx)(d.Z,{label:"Total Leads",value:l?"â":null!=v?v:n.length,accentColor:"#1A6BFF"}),(0,o.jsx)(d.Z,{label:"Today",value:l?"â":n.filter(e=>e.created_time&&new Date(e.created_time).toLocaleDateString("en-CA")===new Date().toLocaleDateString("en-CA")).length,accentColor:"#7C3AED",sub:"New submissions",subType:"neutral"}),(0,o.jsx)(d.Z,{label:"Forms",value:l?"â":new Set(n.map(e=>e.form_name)).size,accentColor:"#16A34A",sub:"Active lead forms",subType:"up"}),(0,o.jsx)(d.Z,{label:"Latest",value:l||!n[0]?"â":(0,u.yu)(n[0].created_time),accentColor:"#D97706",sub:"Most recent lead",subType:"neutral"})]})}),(0,o.jsx)(s.Z,{tableTitle:"",columns:p,data:n,isLoading:l,filterSearchShown:!0,showTitleActions:!1,onRowClick:e=>A(e.original),cursorPagination:{hasNext:c,hasPrev:h,onNext:g,onPrev:m,count:v,pageSize:E,onPageSizeChange:C}}),(0,o.jsx)(f.Z,{open:!!y,onClose:()=>A(null),form:S,formLoading:b,answers:null==y?void 0:y.field_data,submittedAt:null==y?void 0:y.created_time})]})}},66246:function(e,n,l){var o=l(89101);n.Z=o.Z}}]);
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.