PageSourceSearch

https://www.app.aisensy.com/static/js/1683.aa635fed.chunk.js

js aisensy.com collected 2026-09-24 18:22:53 UTC 55,029 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwhatsapp_dashboard=self.webpackChunkwhatsapp_dashboard||[]).push([[1683],{19291:(e,t,a)=>{a.d(t,{Rm:()=>d,aJ:()=>m,mE:()=>h});a(47313);var n=a(73908),s=a(57009),o=a(93901),l=a(25172),i=a(46417);const r="#0a474c",c={groups:"groups",description:"description",ads_click:"ads_click",fact_check:"fact_check",check_circle:"check_circle"},d=e=>{let{label:t,value:a,delta:d,icon:p,color:m,sub:h}=e;const u=null!=d&&d>=0;return(0,i.jsxs)(n.Z,{style:{flex:"1 1 0",minWidth:150,minHeight:92,padding:"14px 16px",background:"#fff",border:"1px solid rgba(0,0,0,0.08)",borderRadius:12,display:"flex",flexDirection:"column",justifyContent:"center",gap:4},children:[(0,i.jsxs)(n.Z,{style:{display:"flex",alignItems:"center",gap:6},children:[(0,i.jsx)(n.Z,{style:{width:24,height:24,borderRadius:6,display:"grid",placeItems:"center",background:(m||r)+"14"},children:(0,i.jsx)("span",{className:"material-icons",style:{fontSize:15,color:m||r},children:c[p]||p})}),(0,i.jsx)(s.Z,{variant:"caption",style:{color:"#6E6E6E",fontWeight:600},children:t})]}),(0,i.jsxs)(n.Z,{style:{display:"flex",alignItems:"baseline",gap:6},children:[(0,i.jsx)(s.Z,{style:{fontSize:"1.6rem",fontWeight:700,color:"#4A4A4A",lineHeight:1.1},children:a}),null!=d&&(0,i.jsxs)(n.Z,{style:{display:"inline-flex",alignItems:"center",color:u?"#357a38":"#aa2e25"},children:[u?(0,i.jsx)(o.Z,{style:{fontSize:18}}):(0,i.jsx)(l.Z,{style:{fontSize:18}}),(0,i.jsxs)("span",{style:{fontSize:11.5,fontWeight:700},children:[Math.abs(d),"%"]})]})]}),h&&(0,i.jsx)(s.Z,{variant:"caption",style:{color:"#B9B9B9"},children:h})]})},p=e=>{let{cards:t}=e;return(0,i.jsx)(n.Z,{style:{display:"flex",gap:16,flexWrap:"wrap",marginBottom:18},children:t.map((e=>(0,i.jsx)(d,{...e},e.key)))})},m=e=>{let{metrics:t=[]}=e;return(0,i.jsx)(p,{cards:t})},h=e=>{let{forms:t=[],totalForms:a,activeForms:n,totalResponses:s=0}=e;const o=null!=a?a:t.length,l=null!=n?n:t.filter((e=>"ACTIVE"===e.status)).length,c=[{key:"f",label:"Total forms",value:o,icon:"fact_check",color:r},{key:"a",label:"Active forms",value:l,sub:o-l+" archived",icon:"check_circle",color:"#357a38"},{key:"s",label:"Total responses",value:Number(s).toLocaleString(),icon:"description",color:"#9013FE"}];return(0,i.jsx)(p,{cards:c})}},33938:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Te});var n=a(47313),s=a(45788),o=a(63830),l=a(70089),i=a(73908),r=a(21144),c=a(57009),d=a(97241),p=a(1805),m=a(20337),h=a(96083),u=a(34882),g=a(72728),x=a(5088),f=a(14636),y=a(84747),v=a(16761),b=a(3873),j=a(47735),Z=a(50724),S=a(8826),k=a(18550),w=a(25048),C=a(82277),N=a(54070),I=a(69889),z=a(62300),R=a(80458),A=a(49998),T=a(31385),F=a(70816),E=a.n(F),W=a(47856),B=a(75145),P=a(51497),q=a(16108),M=a(74197),D=a(16286),L=a(12285),O=a(19942),H=a(46417);const V=(0,d.Z)((e=>({optionRow:{display:"flex",alignItems:"center",marginBottom:e.spacing(1),"&:last-child":{marginBottom:0},"& > :nth-child(2)":{flex:1}},optionRowClickable:{cursor:"pointer",borderRadius:6,margin:e.spacing(0,-1),padding:e.spacing(.5,1),transition:"background-color .15s ease","&:hover":{backgroundColor:"#EBF5F3"},"&:hover $optionLabel":{color:e.palette.primary.main}},optionLabel:{width:140,flexShrink:0,fontSize:13,color:e.palette.text.primary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",paddingRight:e.spacing(1.5)},optionMeta:{width:92,flexShrink:0,textAlign:"right",fontSize:12,color:e.palette.text.secondary,whiteSpace:"nowrap"},optionMetaCount:{fontWeight:600,color:e.palette.text.primary}}))),_=e=>{let{options:t=[],answered:a=0,onSelectOption:n}=e;const s=V(),o=Math.max(a,...t.map((e=>e.count)),1);return(0,H.jsx)(i.Z,{children:t.map((e=>{const t=!!n&&(e.count||0)>0,l=(0,H.jsxs)(i.Z,{className:"".concat(s.optionRow," ").concat(t?s.optionRowClickable:""),onClick:t?()=>n(e.label):void 0,children:[(0,H.jsx)(c.Z,{className:s.optionLabel,title:e.label,children:e.label}),(0,H.jsx)(O.ko,{variant:"determinate",value:Math.max(e.count/o*100,1.5),size:"xlarge",status:"answerDistribution"}),(0,H.jsxs)(c.Z,{className:s.optionMeta,children:[(0,H.jsx)("span",{className:s.optionMetaCount,children:e.count})," ","(",(r=e.count,d=a,d>0?Math.round(r/d*100):0),"%)"]})]},e.label);var r,d;return t?(0,H.jsx)(u.ZP,{title:"View these responses",placement:"top-start",enterDelay:300,children:l},e.label):l}))})};var K=a(34960),G=a(61809),Q=a(52194),Y=a(41407),U=a(58673),J=a(20657),X=a(71968),$=a(12834),ee=a(70476),te=a(20951),ae=a(13188),ne=a(66842),se=a(26395),oe=a(9930),le=a(123),ie=a(87117),re=a(80154),ce=a(77083);const de={choice:["is"],text:["contains","is"]},pe=(0,d.Z)((e=>
1({filterGroup:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:6,minHeight:32},filterChip:{backgroundColor:"#fff",border:"1px solid #E5E7EB",borderRadius:6,height:30,fontSize:13,maxWidth:320,"&:hover, &:focus":{backgroundColor:"#fff"},"& .MuiChip-deleteIcon":{fontSize:16,color:"#9CA3AF","&:hover":{color:"#6B7280"}}},filterChipEditing:{backgroundColor:"#fff",border:"1.5px solid ".concat(e.palette.primary.main),borderRadius:6,height:30,fontSize:13,maxWidth:320,"&:hover, &:focus":{backgroundColor:"#fff"},"& .MuiChip-deleteIcon":{fontSize:16,color:"#9CA3AF","&:hover":{color:"#6B7280"}}},connector:{fontWeight:600,fontSize:11,color:e.palette.primary.main,cursor:"pointer",padding:"2px 6px",height:22,display:"inline-flex",alignItems:"center",borderRadius:4,"&:hover":{backgroundColor:e.palette.primary.light}},connectorPopoverItem:{display:"flex",alignItems:"center",padding:"6px 16px",cursor:"pointer",fontSize:13,color:"#374151",minWidth:100,"&:hover":{backgroundColor:"#F3F4F6"}},connectorPopoverItemActive:{display:"flex",alignItems:"center",padding:"6px 16px",cursor:"pointer",fontSize:13,color:e.palette.primary.main,fontWeight:500,minWidth:100,backgroundColor:e.palette.primary.light,"&:hover":{backgroundColor:e.palette.primary.light}},actionsRow:{display:"flex",alignItems:"center",gap:12,marginTop:10,"&:first-child":{marginTop:0}},actionLink:{fontSize:13,textTransform:"none",color:"#6B7280",cursor:"pointer",display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"none",border:"none",whiteSpace:"nowrap",fontFamily:"inherit","&:hover":{color:e.palette.primary.main,backgroundColor:e.palette.primary.light}},popoverPaper:{borderRadius:8,boxShadow:"0 4px 20px rgba(0,0,0,0.12)",maxHeight:400,minWidth:240,paddingTop:8},popoverSearch:{padding:"8px 12px"},popoverGroupLabel:{fontSize:11,fontWeight:600,color:"#9CA3AF",textTransform:"uppercase",letterSpacing:.8,padding:"8px 16px 4px"},popoverItem:{fontSize:13,padding:"6px 16px",gap:8,"& .MuiListItemIcon-root":{minWidth:28}},editPopoverHeader:{fontSize:12,fontWeight:600,color:"#6B7280",padding:"12px 16px 8px"},operatorItem:{display:"flex",alignItems:"center",padding:"6px 16px",cursor:"pointer",fontSize:13,color:"#374151","&:hover":{backgroundColor:"#F3F4F6"}},operatorItemActive:{display:"flex",alignItems:"center",padding:"6px 16px",cursor:"pointer",fontSize:13,color:e.palette.primary.main,fontWeight:500,backgroundColor:e.palette.primary.light,"&:hover":{backgroundColor:e.palette.primary.light}},editValueSection:{padding:"8px 16px 12px"}}))),me=e=>{let{questions:t=[],value:a=[],onChange:s}=e;
1const o=pe(),l=(0,T.Z)(),[r,d]=(0,n.useState)(a),[p,u]=(0,n.useState)(!1);(0,n.useEffect)((()=>{d(a),u(!1)}),[a]);const[x,y]=(0,n.useState)(null),[v,b]=(0,n.useState)(""),[j,Z]=(0,n.useState)(null),[S,k]=(0,n.useState)(null),[w,C]=(0,n.useState)(null),[N,I]=(0,n.useState)(null),z=new Set(r.map((e=>e.key))),R=t.filter((e=>!z.has(e.key)&&e.label.toLowerCase().includes(v.toLowerCase()))),A=R.filter((e=>"choice"===e.type)),F=R.filter((e=>"text"===e.type)),E=e=>{const t={key:e.key,question:e.label,type:e.type,operator:de[e.type][0],condition:"and",values:[]},a=[...r,t];d(a),u(!0),y(null),b(""),setTimeout((()=>{const e=document.querySelector('[data-response-filter-chip="'.concat(a.length-1,'"]'));e&&(k(a.length-1),Z(e))}),50)},W=(e,t)=>{d((a=>a.map(((a,n)=>n===e?{...a,...t}:a)))),u(!0)},B=()=>{Z(null),k(null)},P=e=>{const t=e.question.length>28?"".concat(e.question.slice(0,28).trim(),"\u2026"):e.question,a=(e.values||[]).filter((e=>""!==String(e).trim()));return a.length?1===a.length?"".concat(t," ").concat(e.operator," ").concat(a[0]):"".concat(t," ").concat(e.operator," ").concat(a[0]," +").concat(a.length-1):"".concat(t," ").concat(e.operator," ...")},q=null!==S?r[S]:null,M=q?(D=q.key,t.find((e=>e.key===D))):null;var D;return(0,H.jsxs)(i.Z,{children:[r.length>0&&(0,H.jsx)(i.Z,{className:o.filterGroup,children:r.map(((e,t)=>(0,H.jsxs)(n.Fragment,{children:[(0,H.jsx)(h.Z,{"data-response-filter-chip":t,className:S===t?o.filterChipEditing:o.filterChip,label:P(e),onDelete:()=>(e=>{d((t=>t.filter(((t,a)=>a!==e)))),u(!0),S===e&&(Z(null),k(null))})(t),onClick:e=>{k(t),Z(e.currentTarget)},icon:"choice"===e.type?(0,H.jsx)(le.Z,{style:{fontSize:16,color:l.palette.primary.main}}):(0,H.jsx)(ie.Z,{style:{fontSize:16,color:l.palette.primary.main}})}),t<r.length-1&&(0,H.jsx)(i.Z,{className:o.connector,onClick:e=>{I(t),C(e.currentTarget)},children:"or"===e.condition?"or":"and"})]},"".concat(e.key,"-").concat(t))))}),t.length>z.size&&(0,H.jsx)(i.Z,{className:o.actionsRow,children:(0,H.jsxs)(i.Z,{component:"span",className:o.actionLink,onClick:e=>y(e.currentTarget),children:[(0,H.jsx)(oe.Z,{style:{fontSize:15}}),"Add filter"]})}),(r.length>0||p)&&(0,H.jsxs)(i.Z,{className:o.actionsRow,children:[(0,H.jsx)(m.Z,{size:"small",disableElevation:!0,variant:"contained",disabled:!p,onClick:()=>{Z(null),k(null),s&&s(r),u(!1)},style:{backgroundColor:p?l.palette.primary.main:"#D1D5DB",color:"#fff",textTransform:"none",fontSize:12,borderRadius:6,padding:"3px 14px",height:28,minWidth:0},children:"Apply Filters"}),(0,H.jsx)(i.Z,{component:"span",className:o.actionLink,onClick:()=>{d([]),Z(null),k(null),u(!1),s&&s([])},style:{color:"#EF4444"},children:"Discard"})]}),(0,H.jsxs)($.ZP,{open:Boolean(x),anchorEl:x,onClose:()=>{y(null),b("")},anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{className:o.popoverPaper},children:[t.length>6&&(0,H.jsx)(i.Z,{className:o.popoverSearch,children:(0,H.jsx)(g.Z,{fullWidth:!0,autoFocus:!0,variant:"standard",placeholder:"Search questions...",value:v,onChange:e=>b(e.target.value),InputProps:{style:{fontSize:13}}})}),A.length>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(c.Z,{className:o.popoverGroupLabel,children:"Choice questions"}),(0,H.jsx)(ee.Z,{dense:!0,children:A.map((e=>(0,H.jsxs)(f.Z,{className:o.popoverItem,onClick:()=>E(e),children:[(0,H.jsx)(te.Z,{children:(0,H.jsx)(le.Z,{style:{fontSize:18,color:"#6B7280"}})}),(0,H.jsx)(ae.Z,{primary:e.label,primaryTypographyProps:{style:{fontSize:13}}})]},e.key)))})]}),F.length>0&&(0,H.jsxs)(H.Fragment,{children:[A.length>0&&(0,H.jsx)(ne.Z,{}),(0,H.jsx)(c.Z,{className:o.popoverGroupLabel,children:"Input questions"}),(0,H.jsx)(ee.Z,{dense:!0,children:F.map((e=>(0,H.jsxs)(f.Z,{className:o.popoverItem,onClick:()=>E(e),children:[(0,H.jsx)(te.Z,{children:(0,H.jsx)(ie.Z,{style:{fontSize:18,color:"#6B7280"}})}),(0,H.jsx)(ae.Z,{primary:e.label,primaryTypographyProps:{style:{fontSize:13}}})]},e.key)))})]}),0===A.length&&0===F.length&&(0,H.jsx)(c.Z,{style:{fontSize:13,color:"#9CA3AF",padding:"12px 16px"},children:"No matching questions"})]}),(0,H.jsx)($.ZP,{open:Boolean(w)&&null!==N,anchorEl:w,onClose:()=>{C(null),I(null)},anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},PaperProps:{style:{borderRadius:8,boxShadow:"0 4px 16px rgba(0,0,0,0.12)",padding:"4px 0"}},children:null!==N&&["and","or"].map((e=>{var t;
1const a=("or"===(null===(t=r[N])||void 0===t?void 0:t.condition)?"or":"and")===e;return(0,H.jsxs)(i.Z,{className:a?o.connectorPopoverItemActive:o.connectorPopoverItem,onClick:()=>{return t=N,a=e,d((e=>e.map(((e,n)=>n===t?{...e,condition:a}:e)))),u(!0),C(null),void I(null);var t,a},children:[a?(0,H.jsx)(re.Z,{style:{fontSize:16,color:l.palette.primary.main,marginRight:8}}):(0,H.jsx)(ce.Z,{style:{fontSize:16,color:"#D1D5DB",marginRight:8}}),(0,H.jsx)("span",{children:e})]},e)}))}),(0,H.jsx)($.ZP,{open:Boolean(j)&&null!==S,anchorEl:j,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PaperProps:{style:{borderRadius:8,minWidth:280,boxShadow:"0 4px 20px rgba(0,0,0,0.12)"}},children:q&&(0,H.jsxs)(i.Z,{children:[(0,H.jsx)(c.Z,{className:o.editPopoverHeader,children:q.question}),(0,H.jsx)(ne.Z,{}),(de[q.type]||[]).length>1&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i.Z,{style:{padding:"4px 0"},children:de[q.type].map((e=>{const t=q.operator===e;return(0,H.jsxs)(i.Z,{className:t?o.operatorItemActive:o.operatorItem,onClick:()=>W(S,{operator:e}),children:[t?(0,H.jsx)(re.Z,{style:{fontSize:16,color:l.palette.primary.main,marginRight:8}}):(0,H.jsx)(ce.Z,{style:{fontSize:16,color:"#D1D5DB",marginRight:8}}),(0,H.jsx)("span",{children:e})]},e)}))}),(0,H.jsx)(ne.Z,{})]}),(0,H.jsxs)(i.Z,{className:o.editValueSection,children:["choice"===q.type?(0,H.jsx)(se.ZP,{multiple:!0,disableCloseOnSelect:!0,size:"small",options:(null===M||void 0===M?void 0:M.options)||[],value:q.values,onChange:(e,t)=>
1W(S,{values:t}),ListboxProps:{style:{maxHeight:200,overflowX:"hidden"}},renderInput:e=>{var t;return(0,H.jsx)(g.Z,{...e,variant:"standard",placeholder:q.values.length?"":"Select answers...",InputProps:{...e.InputProps,style:{...null===(t=e.InputProps)||void 0===t?void 0:t.style,fontSize:13}}})}}):(0,H.jsx)(g.Z,{fullWidth:!0,autoFocus:!0,variant:"standard",placeholder:"Enter value...",value:q.values[0]||"",onChange:e=>W(S,{values:e.target.value?[e.target.value]:[]}),onKeyDown:e=>{"Enter"===e.key&&B()},InputProps:{style:{fontSize:13}}}),(0,H.jsx)(i.Z,{style:{display:"flex",justifyContent:"flex-end",marginTop:10},children:(0,H.jsx)(m.Z,{size:"small",variant:"contained",disableElevation:!0,onClick:B,style:{backgroundColor:l.palette.primary.main,color:"#fff",textTransform:"none",fontSize:12,borderRadius:6,padding:"3px 14px",height:28},children:"Done"})})]})]})})]})};var he=a(7275),ue=a(84160),ge=a(22877),xe=a(22496);const fe=(0,d.Z)((e=>({countRow:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,marginBottom:8,flexWrap:"wrap"},searchField:{width:300,padding:"2px 6px 2px 15px",background:"#f0f0f0",borderRadius:8,"&:focus-within":{background:"white"},[e.breakpoints.down("sm")]:{width:"100%"}},searchInput:{fontSize:14},searchIconButton:{padding:6,background:"#d6ede9","& svg":{fontSize:15},"&:hover":{background:"#d6ede9"}},filterToggle:{textTransform:"none",fontWeight:600},filterPanel:{background:"#F4F4F5",borderRadius:8,padding:e.spacing(1.5,2),marginBottom:8},countGroup:{display:"flex",alignItems:"center",gap:12,marginLeft:"auto"},count:{fontSize:13,color:e.palette.text.secondary},checkboxCell:{width:56},listRoot:{border:"1px solid lightgrey",borderRadius:10,background:"white",overflow:"hidden"},scrollContainer:{width:"100%",overflowX:"auto",overflowY:"hidden"},table:{width:"100%",borderCollapse:"collapse",borderSpacing:0},headRow:{"& th":{textAlign:"left",height:50,boxSizing:"border-box",color:e.palette.text.secondary,backgroundColor:"rgb(252,252,252)",padding:e.spacing(2),whiteSpace:"nowrap"}},tr:{cursor:"pointer",transition:"0.3s",background:"white","&:hover":{backgroundColor:"#EBF5F3"},"& > td":{padding:e.spacing(2),verticalAlign:"middle",height:50,boxSizing:"border-box",fontSize:14,color:e.palette.text.primary}},striped:{background:"rgb(245,245,245)"},name:{fontSize:14,color:e.palette.text.primary},subtle:{fontSize:12,color:e.palette.text.secondary,marginTop:2,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:220},phone:{fontSize:13,whiteSpace:"nowrap"},answer:{fontSize:13,maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},unanswered:{color:e.palette.text.hint},time:{fontSize:12,color:e.palette.text.secondary,whiteSpace:"nowrap"},emptyState:{padding:"40px 24px",textAlign:"center",color:e.palette.text.secondary},footer:{position:"fixed",height:60,borderTop:"1px solid lightgrey",background:"white",bottom:0,left:70,right:0,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,[e.breakpoints.down("sm")]:{left:0,height:50}},footerSpacer:{height:72}}))),ye=e=>{let{form:t,analytics:a,assistantId:s,reloadToken:o=0,syncReloadToken:l=0,actionsRef:r,onMeta:d,answerFilters:p=[],onAnswerFiltersChange:h}=e;const u=fe(),x=null===t||void 0===t?void 0:t.formId,[f,v]=(0,n.useState)([]),[b,Z]=(0,n.useState)(0),[S,w]=(0,n.useState)(0),[C,I]=(0,n.useState)(25),[z,A]=(0,n.useState)(""),[T,F]=(0,n.useState)(""),[W,B]=(0,n.useState)((()=>(p||[]).length>
10)),[P,q]=(0,n.useState)(!1),[M,D]=(0,n.useState)(-1),[L,O]=(0,n.useState)(!1),[V,_]=(0,n.useState)(!1),[$,ee]=(0,n.useState)({dailyTemplateLimit:null,consumedQuota:null});(0,n.useEffect)((()=>{if(!s)return;let e=!1;return(0,ge.YN)(s).then((t=>{!e&&t&&ee({dailyTemplateLimit:t.dailyTemplateLimit,consumedQuota:t.consumedTemplateLimitQuota})})).catch((()=>{})),()=>{e=!0}}),[s]);const[te,ae]=(0,n.useState)(!1),[ne,se]=(0,n.useState)([]),[oe,le]=(0,n.useState)([]),ie=(0,n.useRef)(new Map),re=e=>{const t=(0,xe.tm)(e);return!!t&&(te?!oe.includes(t):ne.includes(t))},ce=te?Math.max(0,b-oe.length):ne.length,de=e=>e.map((e=>(e=>{const t=(0,xe.s6)(e);return t&&t.startsWith("+")?t.slice(1):t})(ie.current.get(e)))).filter(Boolean),pe=te?[]:de(ne),ye=te?de(oe):[],ve=f.length>0&&f.every(re),be=!ve&&f.some(re),je=async()=>{if(s&&x&&!L){O(!0);try{await(0,ge.LD)(s,{formId:x,answers:we,search:T,hasSelection:te||ne.length>0,selectAll:te,selectedNums:pe,unselectedNums:ye})}catch(e){}finally{O(!1)}}},Ze=()=>{0!==ce&&_(!0)};r&&(r.current={broadcast:Ze,doExport:je}),(0,n.useEffect)((()=>{d&&d({total:b,selectedCount:ce,isExporting:L})}),[d,b,ce,L]);const Se=(0,n.useMemo)((()=>((null===t||void 0===t?void 0:t.questions)||[]).filter((e=>!(0,xe.a1)(e))).map((e=>({key:e.key,label:e.label||e.question||e.key})))),[t]),ke=(0,n.useMemo)((()=>((null===a||void 0===a?void 0:a.questions)||[]).filter((e=>!(0,xe.a1)(e))).map((e=>{const t=Array.isArray(e.options)&&e.options.length>0;return{key:e.key,label:e.label||e.question||e.key,type:t?"choice":"text",rawOptions:e.options||[],options:t?e.options.map((e=>String(null!=e.label?e.label:e.key))):[]}}))),[a]),we=(0,n.useMemo)((()=>(p||[]).map((e=>{const t=(e.values||[]).filter((e=>""!==String(e).trim()));if(!e.key||!t.length)return null;const a="or"===e.condition?"or":"and";return"text"===e.type?{key:e.key,question:e.question,operator:"is"===e.operator?"is":"contains",condition:a,values:t.map(String)}:{key:e.key,question:e.question,condition:a,values:t.map(String)}})).filter(Boolean)),[p]),Ce=we.length>0,Ne=Ce||!!T;(0,n.useEffect)((()=>{const e=setTimeout((()=>{F((e=>{const t=z.trim();return t===e?e:(w(0),ae(!1),se([]),le([]),t)}))}),500);return()=>clearTimeout(e)}),[z]);const Ie=(0,n.useCallback)((async function(){let{silent:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(x){e||q(!0);try{const a=await(0,ue.wW)({assistantId:s,type:"form",formId:x,page:S+1,limit:C,answers:we,search:T});if(null!==a&&void 0!==a&&a.status){var t;const e=a.data||[];e.forEach((e=>{const t=(0,xe.tm)(e);t&&ie.current.set(t,e)})),v(e),Z((null===(t=a.pagination)||void 0===t?void 0:t.total)||0)}else e||(v([]),Z(0))}catch(a){e||(v([]),Z(0))}finally{e||q(!1)}}}),[s,x,S,C,o,we,T]);(0,n.useEffect)((()=>{Ie()}),[Ie]);const ze=(0,n.useRef)(Ie);ze.current=Ie,(0,n.useEffect)((()=>{l&&ze.current({silent:!0})}),[l]);const Re=M>=0?f[M]:null;return(0,H.jsxs)(i.Z,{children:[(0,H.jsxs)(i.Z,{className:u.countRow,children:[(0,H.jsxs)(i.Z,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,H.jsx)(g.Z,{classes:{root:u.searchField},placeholder:"Search name, phone or answers",value:z,onChange:e=>A(e.target.value),InputProps:{disableUnderline:!0,classes:{input:u.searchInput},endAdornment:(0,H.jsx)(y.Z,{position:"end",children:(0,H.jsx)(N.Z,{color:"primary",className:u.searchIconButton,children:(0,H.jsx)(k.Z,{})})})}}),ke.length>0&&(0,H.jsx)(Q.Z,{color:"primary",variant:"dot",invisible:!Ce,children:(0,H.jsx)(m.Z,{startIcon:(0,H.jsx)(Y.Z,{}),color:"primary",className:u.filterToggle,onClick:()=>B((e=>!e)),children:"Filter"})})]}),(0,H.jsxs)(i.Z,{className:u.countGroup,children:[ce>0&&(0,H.jsxs)(c.Z,{className:u.count,children:[ce.toLocaleString()," selected"]}),Ne&&!P&&(0,H.jsxs)(c.Z,{className:u.count,children:[b.toLocaleString()," matching response",1===b?"":"s"]})]})]}),ke.length>0&&(0,H.jsx)(R.Z,{in:W,timeout:250,unmountOnExit:!0,children:(0,H.jsx)(i.Z,{className:u.filterPanel,children:(0,H.jsx)(me,{questions:ke,value:p,onChange:e=>{h&&(h(e),w(0),ae(!1),se([]),le([]))}})})}),(0,H.jsx)(i.Z,{className:u.listRoot,children:P||0!==f.length?(0,H.jsx)(i.Z,{className:u.scrollC
1ontainer,children:(0,H.jsxs)("table",{className:u.table,children:[(0,H.jsx)("thead",{children:(0,H.jsxs)("tr",{className:u.headRow,children:[(0,H.jsx)("th",{className:u.checkboxCell,children:(0,H.jsx)(K.Z,{size:"small",color:"primary",checked:ve,indeterminate:be,disabled:0===f.length,onChange:()=>{var e;be?(ae(!1),se([]),le([])):(e=!ve,se([]),le([]),ae(e))}})}),(0,H.jsx)("th",{style:{minWidth:200},children:(0,H.jsx)(c.Z,{variant:"h5",color:"primary",children:"Name"})}),(0,H.jsx)("th",{style:{minWidth:150},children:(0,H.jsx)(c.Z,{variant:"h5",color:"primary",children:"Phone Number"})}),Se.map(((e,t)=>(0,H.jsx)("th",{style:{minWidth:180},children:(0,H.jsx)(c.Z,{variant:"h5",color:"primary",children:e.label})},e.key||t))),(0,H.jsx)("th",{style:{minWidth:170},children:(0,H.jsx)(c.Z,{variant:"h5",color:"primary",children:"Created At"})})]})}),(0,H.jsxs)("tbody",{children:[P&&Array.from({length:Math.min(b>0?Math.max(1,Math.min(C,b-S*C)):C,25)}).map(((e,t)=>(0,H.jsxs)("tr",{className:t%2===0?"".concat(u.tr," ").concat(u.striped):u.tr,children:[(0,H.jsx)("td",{className:u.checkboxCell,children:(0,H.jsx)(j.Z,{variant:"rect",width:16,height:16})}),(0,H.jsx)("td",{children:(0,H.jsx)(j.Z,{width:"65%"})}),(0,H.jsx)("td",{children:(0,H.jsx)(j.Z,{width:"55%"})}),Se.map(((e,t)=>(0,H.jsx)("td",{children:(0,H.jsx)(j.Z,{width:"70%"})},e.key||t))),(0,H.jsx)("td",{children:(0,H.jsx)(j.Z,{width:"80%"})})]},"skeleton-".concat(t)))),!P&&f.map(((e,a)=>{const n=((e,t)=>{const a=(0,xe.yZ)(e,t),n={};return[...a.contact,...a.qualifying,...a.additional].forEach((e=>{null!=e.key&&(n[e.key]=e)})),n})(t,e),s=(0,xe.s6)(e),o=(0,xe.GB)(e);return(0,H.jsxs)("tr",{className:a%2===0?"".concat(u.tr," ").concat(u.striped):u.tr,onClick:()=>D(a),children:[(0,H.jsx)("td",{className:u.checkboxCell,onClick:e=>e.stopPropagation(),children:(0,H.jsx)(K.Z,{size:"small",color:"primary",checked:re(e),onChange:t=>((e,t)=>{const a=(0,xe.tm)(e);a&&(ie.current.set(a,e),te?le((e=>t?e.filter((e=>e!==a)):e.includes(a)?e:[...e,a])):se((e=>t?e.includes(a)?e:[...e,a]:e.filter((e=>e!==a)))))})(e,t.target.checked)})}),(0,H.jsxs)("td",{children:[(0,H.jsx)(c.Z,{className:u.name,children:(0,xe.Qh)(e)||"(Unknown)"}),e.email&&(0,H.jsx)(c.Z,{className:u.subtle,children:e.email})]}),(0,H.jsx)("td",{children:(0,H.jsx)("span",{className:u.phone,children:s?(0,xe.CN)(s):"\u2014"})}),Se.map(((e,t)=>{const a=n[e.key],s=a&&a.answered&&""!==a.value;return(0,H.jsx)("td",{children:(0,H.jsx)("span",{className:"".concat(u.answer," ").concat(s?"":u.unanswered),title:s?String(a.value):"",children:s?a.value:"\u2014"})},e.key||t)})),(0,H.jsx)("td",{children:(0,H.jsx)("span",{className:u.time,children:o?E()(o).format("MMM DD, YYYY HH:mm"):"\u2014"})})]},e._id||e.leadgenId||a)}))]})]})}):(0,H.jsxs)(i.Z,{className:u.emptyState,children:[(0,H.jsx)(c.Z,{variant:"body1",children:Ne?"No responses match your search or filters":"No responses yet"}),(0,H.jsx)(c.Z,{variant:"body2",style:{marginTop:4},children:Ne?"Try a different search or remove some filter conditions.":"Submissions to this form will appear here."})]})}),b>0&&(0,H.jsx)(i.Z,{className:u.footerSpacer}),b>0&&(0,H.jsx)(i.Z,{className:u.footer,children:(0,H.jsx)(J.Z,{limit:C,page:S,total:b,loadPrev:()=>w((e=>Math.max(0,e-1))),loadNext:()=>w((e=>e+1)),setLimit:e=>{I(parseInt(e.target.value,10)),w(0)}})}),(0,H.jsx)(U.Z,{open:!!Re,onClose:()=>D(-1),title:"Lead detail",width:"600px",children:Re&&(0,H.jsx)(he.Z,{lead:Re,assistantId:s,index:M,total:f.length,onPrev:()=>D((e=>Math.max(0,e-1))),onNext:()=>D((e=>Math.min(f.length-1,e+1)))},Re._id||Re.leadgenId)}),(0,H.jsx)(G.Z,{open:V,onClose:()=>_(!1),"aria-labelledby":"form-broadcast-dialog",maxWidth:"md",fullWidth:!0,disableBackdropClick:!0,children:V&&(0,H.jsx)(X.default,{closeDialog:()=>_(!1),totalSelected:ce,selectAll:te,unSelected:ye,selected:pe,allFilters:void 0,optedCount:0,selectedOptNo:0,unSelectedOptNo:0,groupedContacts:[],scheduledCampaigns:[],dailyTemplateLimit:$.dailyTemplateLimit,consumedQuota:$.consumedQuota,leadAudienceCampaign:!0,leadSourceType:"form",leadSearch:T,leadStartDate:null,leadEndDate:null,leadAdId:"",leadFormId:x,leadAnswers:we})})]})};var ve=a(19291);const be=(0,d.Z)((e=>({backArrow:{marginLeft:e.spacing(-.5),marginRight:e.spacing(1),color:e.palette.text.primary,"&:hover":{color:e.palette.primary.main}},headRow:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(1)},title:{fontFamily:"Inter",fontSize:20,fontWeight:700,color:e.palette.text.primary},statusDot:{display:"inline-flex",alignItems:"center",fontSize:11,fontWeight:600,letterSpacing:.5,marginLeft:e.spacing(1.5)},dot:{width:8,height:8,borderRadius:"50%",marginRight:5},tabs:{marginBottom:e.spacing(2),"& .MuiTab-root":{textTransform:"none",fontSize:14,fontWeight:500,minHeight:44,borderBottom:"2px s
1olid #f0f0f0"}},statRow:{display:"flex",gap:16,flexWrap:"wrap",marginBottom:e.spacing(2.5)},panel:{padding:e.spacing(2.5),borderRadius:12,border:"1px solid rgba(0,0,0,0.08)",background:"white",marginBottom:e.spacing(2.5)},panelHead:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:e.spacing(1.5)},panelTitle:{fontFamily:"Inter",fontSize:15,fontWeight:700,color:e.palette.text.primary},panelHint:{fontSize:12,color:e.palette.text.secondary},chartWrap:{width:"100%",marginTop:e.spacing(.5)},chartEmpty:{height:300,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,color:e.palette.text.secondary},sectionHead:{display:"flex",alignItems:"center",justifyContent:"space-between",margin:e.spacing(.5,0,1.5)},sectionTitle:{fontFamily:"Inter",fontSize:15,fontWeight:700,color:e.palette.text.primary},expandAll:{textTransform:"none",fontSize:12,color:e.palette.primary.main},qCard:{borderRadius:10,border:"1px solid #e6e6e6",background:"white",marginBottom:e.spacing(1.5),transition:"box-shadow .2s ease, border-color .2s ease",overflow:"hidden","&:hover":{boxShadow:"0 2px 10px rgba(0,0,0,0.07)",borderColor:"#d6d6d6"}},qConditional:{borderLeft:"3px solid ".concat(e.palette.primary.light)},qHeader:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:e.spacing(2),padding:e.spacing(1.75,2),cursor:"pointer",userSelect:"none"},qHeaderLeft:{minWidth:0},qTitle:{fontFamily:"Inter",fontSize:14,fontWeight:600,color:e.palette.text.primary,display:"flex",alignItems:"center",gap:e.spacing(1),flexWrap:"wrap"},qMeta:{fontSize:12,color:e.palette.text.secondary,marginTop:3},typeChip:{height:20,fontSize:11,fontWeight:600,background:"#ebf5f3",color:"#0a474c",textTransform:"capitalize"},qHeaderRight:{display:"flex",alignItems:"center",gap:e.spacing(1.5),flexShrink:0},answered:{fontSize:12,fontWeight:600,color:e.palette.text.secondary,whiteSpace:"nowrap"},chevron:{transition:"transform .2s ease",color:e.palette.text.secondary},chevronOpen:{transform:"rotate(180deg)"},qBody:{padding:e.spacing(0,2,2),borderTop:"1px solid #f2f2f2",paddingTop:e.spacing(1.75)},sampleGrid:{display:"flex",flexWrap:"wrap",gap:8},sampleAnswer:{fontSize:13,color:e.palette.text.primary,background:"rgb(240,240,240)",borderRadius:8,padding:"6px 12px",maxWidth:320,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},pendingHint:{fontSize:12,color:e.palette.text.hint},kv:{display:"flex",justifyContent:"space-between",padding:e.spacing(1.25,0),borderBottom:"1px solid #F0F0F0","&:last-child":{borderBottom:"none"}},kvLabel:{fontSize:13,color:e.palette.text.secondary},kvValue:{fontSize:14,fontWeight:500,color:e.palette.text.primary},emptyState:{padding:e.spacing(4),textAlign:"center",color:e.palette.text.secondary}}))),je=[{key:"overview",label:"Overview"},{key:"responses",label:"Responses"},{key:"automation",label:"Automation"}],Ze=e=>{var t,a;let{form:s,assistantId:o,onBack:l}=e;const r=be(),d=(0,T.Z)(),[p,g]=(0,n.useState)("overview"),[x,f]=(0,n.useState)({startDate:null,endDate:null,focusedInput:null}
1),[y,v]=(0,n.useState)(null),[Z,S]=(0,n.useState)({}),[k,F]=(0,n.useState)(!1),[V,K]=(0,n.useState)(!1),[G,Q]=(0,n.useState)(!1),[Y,U]=(0,n.useState)(null),[J,X]=(0,n.useState)(0),[$,ee]=(0,n.useState)(0),[te,ae]=(0,n.useState)(null),ne=(0,n.useRef)({}),[se,oe]=(0,n.useState)({total:0,selectedCount:0,isExporting:!1}),[le,ie]=(0,n.useState)([]),re=(0,n.useCallback)((async()=>{if(null!==s&&void 0!==s&&s.formId){F(!0);try{const e=await(0,ue.TJ)(s.formId,o);v((null===e||void 0===e?void 0:e.data)||null)}catch(e){v(null)}finally{K(!0),F(!1)}}}),[null===s||void 0===s?void 0:s.formId,o]);(0,n.useEffect)((()=>{re()}),[re,$]);const ce=(null===y||void 0===y?void 0:y.form)||s,de=(null===y||void 0===y?void 0:y.analytics)||null,pe=(null===de||void 0===de?void 0:de.totals)||null,me="ACTIVE"===ce.status,he=ce.questions||[],xe=(0,n.useMemo)((()=>{const e=new Map;return((null===de||void 0===de?void 0:de.questions)||[]).forEach((t=>e.set(t.key,t))),e}),[de]),fe=pe?[{key:"sub",label:"Submissions",value:(pe.submissions||0).toLocaleString(),icon:"description",color:"#9013FE"},{key:"uniq",label:"Unique leads",value:(pe.uniqueLeads||0).toLocaleString(),icon:"groups",color:"#0a474c"},{key:"new",label:"New contacts",value:(pe.newContacts||0).toLocaleString(),sub:"".concat((pe.returningContacts||0).toLocaleString()," returning"),icon:"person_add",color:"#1769d4"},{key:"auto",label:"Automation sent",value:(pe.automationSent||0).toLocaleString(),sub:"".concat((pe.automationFailed||0).toLocaleString()," failed"),icon:"send",color:"#b07b00"}]:[],Ze=he.length>0&&he.every((e=>Z[e.key])),Se=(0,n.useMemo)((()=>(null===de||void 0===de?void 0:de.timeSeries)||[]),[de]),ke=(0,n.useMemo)((()=>{if(!Se.length)return null;const e=Se.map((e=>E()(e.date)));return{min:E().min(e).startOf("day"),max:E().max(e).endOf("day")}}),[Se]);(0,n.useEffect)((()=>{ke&&!x.startDate&&f((e=>({...e,startDate:ke.min,endDate:ke.max})))}),[ke,x.startDate]);const we=(0,n.useMemo)((()=>{const{startDate:e,endDate:t}=x,a=Se.filter((a=>{if(!e||!t)return!0;const n=E()(a.date);return n.isSameOrAfter(e,"day")&&n.isSameOrBefore(t,"day")})),n=a.map((e=>({label:E()(e.date).format("MMM DD"),submissions:e.count})));return 1===n.length?[{label:E()(a[0].date).subtract(1,"day").format("MMM DD"),submissions:0},...n]:n}),[Se,x]),Ce=d.palette.primary.main,Ne=G||!!Y,Ie=(0,n.useRef)(re);return Ie.current=re,(0,n.useEffect)((()=>{if(!Y)return;let e=!1,t=0;const a=async()=>{t+=1;try{const t=await(0,ue.RR)(o,{syncBatchId:Y});if(e)return;const a=null===t||void 0===t?void 0:t.summary;if(X((e=>e+1)),null!==a&&void 0!==a&&a.isComplete)return U(null),ae(a.failed>0?{severity:"warning",message:"Lead sync finished with errors \u2014 some leads may be missing. Try syncing again."}:{severity:"success",message:"Lead sync completed. Responses are up to date."}),void Ie.current()}catch(a){}!e&&t>=60&&(U(null),ae({severity:"info",message:"Lead sync is still running in the background. Refresh in a bit to see new responses."}))},n=setInterval(a,5e3);return a(),()=>{e=!0,clearInterval(n)}}),[Y,o]),(0,H.jsxs)(i.Z,{children:[(0,H.jsxs)(i.Z,{className:r.headRow,children:[(0,H.jsxs)(i.Z,{display:"flex",alignItems:"center",children:[(0,H.jsx)(N.Z,{onClick:l,size:"small",className:r.backArrow,"aria-label":"Back to forms",children:(0,H.jsx)(P.Z,{})}),(0,H.jsx)(c.Z,{className:r.title,children:ce.name}),(0,H.jsxs)("span",{className:r.statusDot,style:{color:me?"#4caf50":"#9e9e9e"},children:[(0,H.jsx)("span",{className:r.dot,style:{backgroundColor:me?"#4caf50":"#9e9e9e"}}),me?"ACTIVE":"ARCHIVED"]})]}),(0,H.jsxs)(i.Z,{display:"flex",alignItems:"center",style:{gap:8},children:[(0,H.jsx)(u.ZP,{title:"Reload this form's overview and responses",children:(0,H.jsx)("span",{children:(0,H.jsx)(m.Z,{variant:"text",size:"small",startIcon:k?(0,H.jsx)(b.Z,{size:14}):(0,H.jsx)(M.Z,{}),onClick:()=>ee((e=>e+1)),disabled:k,style:{textTransform:"none"},children:"Refresh"})})}),"responses"===p&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(u.ZP,{title:0===se.selectedCount?"Select at least one response to broadcast":"",children:(0,H.jsx)("span",{children:(0,H.jsxs)(m.Z,{variant:"contained",color:"primary",size:"small",startIcon:(0,H.jsx)(D.Z,{style:{fontSize:16}}),disabled:0===se.selectedCount,onClick:()=>{var e,t;return null===(e=(t=ne.current).broadcast)||void 0===e?void 0:e.call(t)},style:{textTransform:"none"},children:["Broadcast",se.selectedCount>0?" (".concat(se.selectedCount,")"):""]})})}),(0,H.jsx)(u.ZP,{title:0===se.total?"No responses to export":"",children:(0,H.jsx)("span",{children:(0,H.jsx)(m.Z,{variant:"outlined",size:"small",startIcon:se.isExporting?(0,H.jsx)(b.Z,{size:14}):(0,H.jsx)(L.Z,{style:{fontSize:16}}),disabled:0===se.total||se.isExporting,onClick:()=>{var e,t;return null===(e=(t=ne.current).doExport)||void 0===e?void 0:e.call(t)},style:{textTransform:"none"},children:se.isExporting?"Exporting\u2026":"Export CSV"})})})]}),(0,H.jsx)(u.ZP,{title:ce.pageId?"Fetch any leads missed by the webhook from Meta":"Connect a page to sync leads",children:(0,H.jsx)("span",{children:(0,H.jsx)(m.Z,{variant:"outlined",size:"small",startIcon:Ne?(0,H.jsx)(b.Z,{size:14}):(0,H.jsx)(w.Z,{}),onClick:async()=>{const e=ce.pageId;if(o&&e&&ce.formId&&!G&&!Y){Q(!0);try{const t=await(0,ge.Hu)(o,e,ce.formId);!1===(null===t||void 0===t?void 0:t.status)?ae({severity:"info",message:(null===t||void 0===t?void 0:t.message)||"Nothing to sync"}):(null!==t&&void 0!==t&&t.syncBatchId&&0!==(null===t||void 0===t?void 0:t.queuedForms)&&U(t.syncBatchId),ae({severity:"success",message:"Lead sync started. New responses will appear shortly."}),X((e=>e+1)))}catch(n){var t,a;ae({severity:"error",message:(null===n||void 0===n||null===(t=n.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.message)||"Failed to start lead sync"})}finally{Q(!1)}}},disabled:Ne||!ce.pageId,style:{textTransform:"none"},children:Ne?"Syncing\u2026":"Sync from Meta"})})})]})]}),(0,H.jsx)(I.Z,{value:p,onChange:(e,t)=>
1g(t),indicatorColor:"primary",textColor:"primary",className:r.tabs,children:je.map((e=>(0,H.jsx)(z.Z,{value:e.key,label:e.label},e.key)))}),Ne&&(0,H.jsx)(A.Z,{severity:"info",icon:(0,H.jsx)(b.Z,{size:16}),style:{marginBottom:16,borderRadius:8},children:"Syncing leads from Meta \u2014 new responses will appear here automatically once the sync completes."}),"overview"===p&&!V&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i.Z,{className:r.statRow,children:[0,1,2,3].map((e=>(0,H.jsx)(j.Z,{variant:"rect",height:84,style:{flex:"1 1 0",minWidth:150,borderRadius:12}},e)))}),(0,H.jsx)(j.Z,{variant:"rect",height:300,style:{borderRadius:12,marginBottom:20}}),(0,H.jsx)(i.Z,{className:r.sectionHead,children:(0,H.jsx)(c.Z,{className:r.sectionTitle,children:"Questions & answers"})}),[0,1,2].map((e=>(0,H.jsx)(j.Z,{variant:"rect",height:56,style:{borderRadius:10,marginBottom:12}},e)))]}),"overview"===p&&V&&(0,H.jsxs)(H.Fragment,{children:[fe.length>0&&(0,H.jsx)(i.Z,{className:r.statRow,children:fe.map((e=>(0,H.jsx)(ve.Rm,{...e},e.key)))}),Se.length>0&&(0,H.jsxs)(C.Z,{elevation:0,className:r.panel,children:[(0,H.jsxs)(i.Z,{className:r.panelHead,children:[(0,H.jsx)(c.Z,{className:r.panelTitle,children:"Daily submissions"}),(0,H.jsx)(B.ZP,{startDate:x.startDate,endDate:x.endDate,focusedInput:x.focusedInput,onDatesChange:e=>{let{startDate:t,endDate:a}=e;return f((e=>({...e,startDate:t,endDate:a})))},onFocusChange:e=>f((t=>({...t,focusedInput:e}))),constraintStartDate:null===ke||void 0===ke||null===(t=ke.min)||void 0===t?void 0:t.toDate()})]}),we.length>0?(0,H.jsx)(i.Z,{className:r.chartWrap,children:(0,H.jsx)(W.h2,{width:"100%",height:300,children:(0,H.jsxs)(W.TH,{data:we,margin:{top:10,right:16,left:-12,bottom:0},children:[(0,H.jsx)("defs",{children:(0,H.jsxs)("linearGradient",{id:"leadDailyFill",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,H.jsx)("stop",{offset:"0%",stopColor:Ce,stopOpacity:.35}),(0,H.jsx)("stop",{offset:"95%",stopColor:Ce,stopOpacity:0})]})}),(0,H.jsx)(W.q3,{strokeDasharray:"3 3",vertical:!1,stroke:"#eeeeee"}),(0,H.jsx)(W.Kc,{dataKey:"label",axisLine:!1,tickLine:!1,tick:{fontSize:12,fill:"#888"}}),(0,H.jsx)(W.B2,{axisLine:!1,tickLine:!1,allowDecimals:!1,width:36,tick:{fontSize:12,fill:"#888"}}),(0,H.jsx)(W.u,{cursor:{stroke:Ce,strokeOpacity:.2}}),(0,H.jsx)(W.uN,{type:"monotone",dataKey:"submissions",name:"Submissions",stroke:Ce,strokeWidth:2,fill:"url(#leadDailyFill)",dot:we.length<=2&&(e=>(0,H.jsx)("circle",{cx:e.cx,cy:e.cy,r:e.index===we.length-1?4:0,fill:Ce},"dot-".concat(e.index))),isAnimationActive:!0})]})})}):(0,H.jsx)(i.Z,{className:r.chartEmpty,children:"No submissions in the selected range."})]}),(0,H.jsxs)(i.Z,{className:r.sectionHead,children:[(0,H.jsx)(c.Z,{className:r.sectionTitle,children:"Questions & answers"}),he.length>0&&(0,H.jsx)(m.Z,{size:"small",className:r.expandAll,onClick:()=>{if(Ze)S({});else{const e={};he.forEach((t=>{e[t.key]=!0})),S(e)}},children:Ze?"Expand all":"Collapse all"})]}),0===he.length?(0,H.jsx)(i.Z,{className:r.emptyState,children:"No questions stored for this form."}):he.map(((e,t)=>{const a=xe.get(e.key),n=a&&"choice"===a.type||Array.isArray(e.options)&&e.options.length>0,s=!Z[e.key];return(0,H.jsxs)(i.Z,{className:"".concat(r.qCard," ").concat(e.parentId?r.qConditional:""),children:[(0,H.jsxs)(i.Z,{className:r.qHeader,onClick:()=>{return t=e.key,S((e=>({...e,[t]:!e[t]})));var t},children:[(0,H.jsxs)(i.Z,{className:r.qHeaderLeft,children:[(0,H.jsxs)(c.Z,{className:r.qTitle,children:[e.label||e.question||e.key,(0,H.jsx)(h.Z,{size:"small",className:r.typeChip,label:(o=(null===a||void 0===a?void 0:a.type)||e.type,String(o||"question").replace(/_/g," ").toLowerCase())}),e.parentId&&(0,H.jsx)(h.Z,{size:"small",className:r.typeChip,label:"conditional"})]}),e.mappedParameter&&(0,H.jsxs)(c.Z,{className:r.qMeta,children:["maps to ",e.mappedParameter]})]}),(0,H.jsxs)(i.Z,{className:r.qHeaderRight,children:[a&&(0,H.jsxs)("span",{className:r.answered,children:[(a.totalAnswered||0).toLocaleString()," answered"]}),(0,H.jsx)(q.Z,{className:"".concat(r.chevron," ").concat(s?r.chevronOpen:"")})]})]}),(0,H.jsx)(R.Z,{in:s,timeout:"auto",unmountOnExit:!0,children:(0,H.jsx)(i.Z,{className:r.qBody,
1children:a&&n?(0,H.jsx)(_,{options:a.options||[],answered:a.totalAnswered||0,onSelectOption:t=>{return n=t,ie([{key:(a=e).key,question:a.label||a.question||a.key,type:"choice",operator:"is",condition:"and",values:[String(n)]}]),void g("responses");var a,n}}):a&&!n?(a.freeTextSamples||[]).length>0?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(i.Z,{className:r.sampleGrid,children:a.freeTextSamples.map(((e,t)=>(0,H.jsxs)(c.Z,{className:r.sampleAnswer,title:e,children:["\u201c",e,"\u201d"]},t)))}),(0,H.jsx)(c.Z,{className:r.pendingHint,style:{marginTop:8},children:"Free-text answers can't be charted \u2014 showing recent samples."})]}):(0,H.jsx)(c.Z,{className:r.pendingHint,children:"No answers yet."}):(0,H.jsx)(c.Z,{className:r.pendingHint,children:"Answer breakdown appears once this form receives submissions."})})})]},e.key||t);var o}))]}),"responses"===p&&(0,H.jsx)(ye,{form:ce,assistantId:o,reloadToken:$,syncReloadToken:J,actionsRef:ne,onMeta:oe,answerFilters:le,onAnswerFiltersChange:ie,analytics:de}),"automation"===p&&(0,H.jsx)(C.Z,{elevation:0,className:r.panel,children:null!==(a=ce.automation)&&void 0!==a&&a.enabled?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(i.Z,{className:r.kv,children:[(0,H.jsx)("span",{className:r.kvLabel,children:"Status"}),(0,H.jsx)("span",{className:r.kvValue,style:{color:"#4caf50"},children:"Enabled"})]}),(0,H.jsxs)(i.Z,{className:r.kv,children:[(0,H.jsx)("span",{className:r.kvLabel,children:"WhatsApp template"}),(0,H.jsx)("span",{className:r.kvValue,children:ce.automation.templateName||"\u2014"})]}),ce.automation.campaignName&&(0,H.jsxs)(i.Z,{className:r.kv,children:[(0,H.jsx)("span",{className:r.kvLabel,children:"Campaign"}),(0,H.jsx)("span",{className:r.kvValue,children:ce.automation.campaignName})]}),(0,H.jsxs)(i.Z,{className:r.kv,children:[(0,H.jsx)("span",{className:r.kvLabel,children:"Trigger"}),(0,H.jsx)("span",{className:r.kvValue,children:"On every new lead"})]}),(0,H.jsx)(c.Z,{className:r.pendingHint,style:{marginTop:12},children:"When a lead submits this form, the template is sent automatically to their WhatsApp number."})]}):(0,H.jsxs)(i.Z,{className:r.emptyState,children:[(0,H.jsx)(c.Z,{variant:"body1",children:"Automation is off"}),(0,H.jsx)(c.Z,{variant:"body2",style:{marginTop:4},children:"Leads from this form aren't messaged automatically. Turn on automation to send a WhatsApp template on each new submission."})]})}),(0,H.jsx)(O.A9,{open:!!te,onClose:()=>ae(null),anchorOrigin:{vertical:"bottom",horizontal:"center"},severity:null===te||void 0===te?void 0:te.severity,message:null===te||void 0===te?void 0:te.message})]})};var Se=a(51854);const ke=e=>(0,H.jsx)(S.Z,{...e}),we=(0,d.Z)((e=>({headerBar:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"1em",flexWrap:"wrap",gap:8},headerTitle:{fontFamily:"Inter",fontWeight:700},searchField:{width:"35%",padding:"2px",background:"rgb(240,240,240)",[e.breakpoints.down("sm")]:{width:"100%"}},searchInputPadding:{padding:"12px 10px 12px 8px"},pillSelect:{width:185,fontSize:"0.8125rem",color:"black",backgroundColor:"rgb(240,240,240)",borderRadius:8,padding:"4px 10px",[e.breakpoints.down("sm")]:{width:"auto",flex:1}},pillSelectIcon:{width:20,height:20,marginRight:6},headerActions:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},tableHeader:{background:"white",padding:4,borderRadius:8,marginBottom:"1em",alignItems:"center"},tableItem:{background:"white",marginBottom:"1em",alignItems:"center",padding:4,borderRadius:8,cursor:"pointer",transition:"background 0.15s","&:hover":{background:"#efefef"}},cell:{padding:"16px 0 16px 16px",minWidth:0},formIcon:{width:38,height:38,borderRadius:8,background:e.palette.primary.light||"#ebf5f3",display:"grid",placeItems:"center",flexShrink:0},formName:{fontFamily:"Inter",fontWeight:400,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},statusChip:{padding:"4px",color:"white",fontWeight:600},automationChip:{height:22,fontSize:12,fontWeight:600},emptyState:{width:"100%",height:360,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:e.palette.text.secondary},paginationBar:{position:"fixed",height:60,borderTop:"1px solid lightgrey",background:"white",bottom:0,left:70,right:0,overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2,[e.breakpoints.down("sm")]:{left:0,height:50}},footerSpacer:{height:72}}
1))),Ce=[{value:"createdAt:desc",label:"Newest first"},{value:"createdAt:asc",label:"Oldest first"},{value:"leadCounts:desc",label:"Most leads"},{value:"leadCounts:asc",label:"Fewest leads"}],Ne=[{value:"all",label:"All"},{value:"on",label:"On"},{value:"off",label:"Off"}],Ie=[{key:"icon",label:"",size:1},{key:"form",label:"Form",size:3},{key:"status",label:"Status",size:2},{key:"questions",label:"Questions",size:2},{key:"leads",label:"Leads",size:2},{key:"automation",label:"Automation",size:2}],ze=e=>{let{forms:t=[],assistantId:a,pageId:s,mockMode:o=!1,totalResponses:l=0,onFormsSynced:d}=e;const p=we(),[S,C]=(0,n.useState)(null),[N,I]=(0,n.useState)(0),[z,R]=(0,n.useState)(10),[A,T]=(0,n.useState)(!1),[F,E]=(0,n.useState)(""),[W,B]=(0,n.useState)(""),[P,q]=(0,n.useState)("createdAt:desc"),[M,D]=(0,n.useState)("all"),[L,O]=(0,n.useState)([]),[V,_]=(0,n.useState)(0),[K,G]=(0,n.useState)(!1),[Q,Y]=(0,n.useState)(0),[U,J]=(0,n.useState)(0),[X,$]=(0,n.useState)(!1);(0,n.useEffect)((()=>{const e=setTimeout((()=>{B(F.trim()),I(0)}),350);return()=>clearTimeout(e)}),[F]);const ee=(0,n.useCallback)((()=>{if(o||!a||!s)return;const e=(0,Se.PK)("lead-forms-count",{assistantId:a,pageId:s}),t=(0,Se.PK)("lead-forms-count",{assistantId:a,pageId:s,status:"ACTIVE"}),n=(0,Se.q9)(e),l=(0,Se.q9)(t);void 0!==n&&(Y(n),$(!0)),void 0!==l&&J(l),(0,ue.Kq)(a,s,void 0,void 0,1,1).then((t=>{var a;const n=(null===t||void 0===t||null===(a=t.pagination)||void 0===a?void 0:a.total)||0;(0,Se.Zi)(e,n),Y(n)})).catch((()=>{})).finally((()=>$(!0))),(0,ue.Kq)(a,s,"ACTIVE",void 0,1,1).then((e=>{var a;const n=(null===e||void 0===e||null===(a=e.pagination)||void 0===a?void 0:a.total)||0;(0,Se.Zi)(t,n),J(n)})).catch((()=>{}))}),[a,s,o]),te=(0,n.useRef)(0),ae=(0,n.useCallback)((()=>{if(o||!a||!s)return;const[e,t]=P.split(":"),n="all"===M?void 0:"on"===M,l=(0,Se.PK)("lead-forms",{assistantId:a,pageId:s,search:W||void 0,page:N+1,limit:z,sortBy:e,sortOrder:t,automationEnabled:n}),i=(0,Se.q9)(l);i?(O(i.rows),_(i.total),G(!1)):G(!0);const r=++te.current;(0,ue.Kq)(a,s,void 0,W||void 0,N+1,z,{sortBy:e,sortOrder:t,automationEnabled:n}).then((e=>{var t;const a={rows:(null===e||void 0===e?void 0:e.data)||[],total:(null===e||void 0===e||null===(t=e.pagination)||void 0===t?void 0:t.total)||0};(0,Se.Zi)(l,a),r===te.current&&(O(a.rows),_(a.total))})).catch((()=>{r!==te.current||i||(O([]),_(0))})).finally((()=>{r===te.current&&G(!1)}))}),[a,s,o,W,N,z,P,M]);(0,n.useEffect)((()=>{ee()}),[ee]),(0,n.useEffect)((()=>{ae()}),[ae]);const ne=(0,n.useMemo)((()=>{if(!o)return[];const e=W.toLowerCase();let a=e?t.filter((t=>(t.name||"").toLowerCase().includes(e))):[...t];if("all"!==M){const e="on"===M;a=a.filter((t=>{var a;return!(null===(a=t.automation)||void 0===a||!a.enabled)===e}))}const[n,s]=P.split(":"),l="asc"===s?1:-1;return a.sort(((e,t)=>{var a,s,o,i;return(("leadCounts"===n?Number(null!==(a=null!==(s=e.leadCounts)&&void 0!==s?s:e.leadsCount)&&void 0!==a?a:0)||0:new Date(e.createdAt||0).getTime())-("leadCounts"===n?Number(null!==(o=null!==(i=t.leadCounts)&&void 0!==i?i:t.leadsCount)&&void 0!==o?o:0)||0:new Date(t.createdAt||0).getTime()))*l})),a}),[o,t,W,M,P]),se=o?ne.slice(N*z,N*z+z):L,oe=o?ne.length:V,le=o?t.length:Q,ie=o?t.filter((e=>"ACTIVE"===e.status)).length:U,re=o?t.length>0:Q>0;if(S)return(0,H.jsx)(Ze,{form:S,assistantId:a,onBack:()=>C(null)});const ce=e=>{var t,a;return Number(null!==(t=null!==(a=e.leadCounts)&&void 0!==a?a:e.leadsCount)&&void 0!==t?t:0)||0},de=!o&&!X,pe=e=>Array.from({length:e}).map(((e,t)=>(0,H.jsx)(j.Z,{variant:"rect",height:62,style:{borderRadius:8,marginBottom:"1em"}},t)));return(0,H.jsxs)(H.Fragment,{children:[de?(0,H.jsx)(i.Z,{style:{display:"flex",gap:16,marginBottom:18},children:[0,1,2].map((e=>(0,H.jsx)(j.Z,{variant:"rect",height:92,style:{flex:"1 1 0",minWidth:150,borderRadius:12}},e)))}):(0,H.jsx)(ve.mE,{totalForms:le,activeForms:ie,totalResponses:l}),(0,H.jsxs)(i.Z,{className:p.headerBar,children:[(0,H.jsx)(g.Z,{classes:{root:p.searchField},variant:"outlined",size:"small",placeholder:"Search by form name",value:F,onChange:e=>E(e.target.value),InputProps:{classes:{input:p.searchInputPadding},startAdornment:(0,H.jsx)(y.Z,{position:"start",style:{margin:0},children:(0,H.jsx)(k.Z,{})})}}),(0,H.jsxs)(i.Z,{className:p.headerActions,children:[(0,H.jsx)(x.Z,{disableUnderline:!0,className:p.pillSelect,value:P,onChange:e=>{q(e.target.value),I(0)},renderValue:e=>{var t;return"Sort: ".concat((null===(t=Ce.find((t=>t.value===e)))||void 0===t?void 0:t.label)||"")},classes:{icon:p.pillSelectIcon},IconComponent:ke,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},style:{marginTop:5}},children:Ce.map((e=>(0,H.jsx)(f.Z,{value:e.value,children:e.label},e.value)))}),(0,H.jsx)(x.Z,{disableUnderline:!0,className:p.pillSelect,value:M,onChange:e=>{D(e.target.value),I(0)},renderValue:e=>{var t;
1return"Automation: ".concat((null===(t=Ne.find((t=>t.value===e)))||void 0===t?void 0:t.label)||"")},classes:{icon:p.pillSelectIcon},IconComponent:ke,MenuProps:{getContentAnchorEl:null,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},style:{marginTop:5}},children:Ne.map((e=>(0,H.jsx)(f.Z,{value:e.value,children:e.label},e.value)))}),(0,H.jsx)(u.ZP,{title:o?"Disabled in demo mode":s?"Fetch the latest forms from Meta (does not sync leads)":"Connect a page to sync forms",children:(0,H.jsx)("span",{children:(0,H.jsx)(m.Z,{variant:"outlined",size:"small",startIcon:A?(0,H.jsx)(b.Z,{size:14}):(0,H.jsx)(w.Z,{}),disabled:A||o||!s,onClick:async()=>{if(a&&s&&!A){T(!0);try{await(0,ge.nB)(a,s),(0,Se.cM)("lead-forms"),(0,Se.cM)("lead-forms-count"),d&&await d(),ee(),ae()}catch(e){}finally{T(!1)}}},style:{textTransform:"none"},children:A?"Syncing\u2026":"Sync forms"})})})]})]}),de?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(j.Z,{variant:"rect",height:54,style:{borderRadius:8,marginBottom:"1em"}}),pe(6)]}):re?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(r.Z,{container:!0,className:p.tableHeader,children:Ie.map((e=>"icon"===e.key?(0,H.jsx)(r.Z,{item:!0,xs:e.size,className:p.cell,children:(0,H.jsx)(Z.Z,{style:{fontSize:20,color:"#0a474c"}})},e.key):(0,H.jsx)(r.Z,{item:!0,xs:e.size,className:p.cell,children:(0,H.jsx)(c.Z,{variant:"h5",color:"primary",children:e.label})},e.key)))}),K&&pe(Math.min(z,6)),!K&&0===se.length&&(0,H.jsx)(i.Z,{className:p.emptyState,style:{height:200},children:(0,H.jsx)(c.Z,{variant:"body1",color:"textSecondary",children:W?"No forms match \u201c".concat(W,"\u201d"):"No forms to show"})}),!K&&se.map((e=>{var t,a;const n="ACTIVE"===e.status,s=(e=>{var t,a,n;return null!==(t=null!==(a=null===(n=e.questions)||void 0===n?void 0:n.length)&&void 0!==a?a:e.questionCount)&&void 0!==t?t:0})(e),o=!(null===(t=e.automation)||void 0===t||!t.enabled);return(0,H.jsxs)(r.Z,{container:!0,className:p.tableItem,onClick:()=>C(e),children:[(0,H.jsx)(r.Z,{item:!0,xs:1,className:p.cell,children:(0,H.jsx)(Z.Z,{style:{fontSize:20,color:"#0a474c"}})}),(0,H.jsx)(r.Z,{item:!0,xs:3,className:p.cell,children:(0,H.jsxs)(i.Z,{minWidth:0,children:[(0,H.jsx)(c.Z,{className:p.formName,children:e.name}),o&&(null===(a=e.automation)||void 0===a?void 0:a.templateName)&&(0,H.jsx)(c.Z,{variant:"caption",color:"textSecondary",children:e.automation.templateName})]})}),(0,H.jsx)(r.Z,{item:!0,xs:2,className:p.cell,children:(0,H.jsx)(h.Z,{size:"small",label:n?"Active":"Archived",className:p.statusChip,style:{background:n?"rgb(40 193 82 / 89%)":"rgb(173 173 173 / 85%)"}})}),(0,H.jsx)(r.Z,{item:!0,xs:2,className:p.cell,children:(0,H.jsxs)(c.Z,{variant:"body1",children:[s," question",1===s?"":"s"]})}),(0,H.jsx)(r.Z,{item:!0,xs:2,className:p.cell,children:(0,H.jsx)(c.Z,{variant:"body1",children:ce(e).toLocaleString()})}),(0,H.jsx)(r.Z,{item:!0,xs:2,className:p.cell,children:(0,H.jsx)(h.Z,{size:"small",variant:"outlined",className:p.automationChip,label:o?"ON":"OFF",style:{color:o?"#357a38":"#9e9e9e",borderColor:o?"#4caf50":"#d0d0d0",background:o?"rgba(76,175,80,0.08)":"transparent"}})})]},e.formId)})),(0,H.jsx)(i.Z,{className:p.footerSpacer}),(0,H.jsx)(i.Z,{className:p.paginationBar,children:(0,H.jsx)(v.Z,{component:"div",count:oe,page:N,rowsPerPage:z,rowsPerPageOptions:[5,10,25,50],onChangePage:(e,t)=>I(t),onChangeRowsPerPage:e=>{R(parseInt(e.target.value,10)),I(0)}})})]}):(0,H.jsxs)(i.Z,{className:p.emptyState,children:[(0,H.jsx)(c.Z,{variant:"h5",color:"textSecondary",children:"No lead forms yet !"}),(0,H.jsx)(c.Z,{variant:"body2",style:{marginTop:6},children:"Forms you create on Meta (or from ad creation) will appear here."})]})]})};var Re=a(91529);const Ae=(0,d.Z)((e=>({pageRoot:{height:"100%",width:"100%",background:"rgb(247, 247, 247)",boxSizing:"border-box",overflowX:"hidden",overflowY:"auto",scrollbarGutter:"stable",position:"relative",minHeight:"100vh"},pageTitleContainer:{position:"sticky",top:0,zIndex:100,background:"#fff",boxShadow:"0 0 11px rgb(230 230 230)",minHeight:60,display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 24px",boxSizing:"border-box",width:"100%",[e.breakpoints.down("sm")]:{padding:"0 16px"}},innerContainer:{padding:"24px 40px",width:"100%",boxSizing:"border-box",[e.breakpoints.down("md")]:{padding:"20px 24px"},[e.breakpoints.down("sm")]:{padding:"16px"}},connectMessage:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"60vh",padding:24,textAlign:"center"}}))),Te=()=>
1{const e=Ae(),t=(0,o.useHistory)(),a=(0,s.useSelector)((e=>e.assistantDetails.data)),d=(0,s.useSelector)((e=>{var t;return null===(t=e.ads)||void 0===t?void 0:t.pageDetails})),m=null===a||void 0===a?void 0:a.assistantId,[h,u]=(0,n.useState)(null),[g,x]=(0,n.useState)(0),f=(0,n.useCallback)((async()=>{if(!m)return;const e=(0,Se.PK)("meta-ad-setup-page",{assistantId:m}),t=(0,Se.q9)(e);t&&u(t);try{const t=await l.Z.post("".concat(p.URL,"/meta-ads/fetch-meta-ad-setup"),{assistantId:m}),{isValid:a,pageId:n}=(null===t||void 0===t?void 0:t.data)||{};a&&n&&((0,Se.Zi)(e,n),u(n))}catch(a){console.error("Error fetching meta ad setup:",a)}}),[m]);(0,n.useEffect)((()=>{null!==d&&void 0!==d&&d.pageId?u(d.pageId):null!==a&&void 0!==a&&a.selectedMetaPageId?u(a.selectedMetaPageId):f()}),[null===d||void 0===d?void 0:d.pageId,null===a||void 0===a?void 0:a.selectedMetaPageId,f]);const y=(0,n.useCallback)((async()=>{if(!m)return;const e=(0,Se.PK)("lead-gen-stats",{assistantId:m}),t=(0,Se.q9)(e);t&&x(t.formSubmissions||0);try{const t=await(0,ue.nV)(m),a=(null===t||void 0===t?void 0:t.data)||{};(0,Se.Zi)(e,a),x(a.formSubmissions||0)}catch{}}),[m]);return(0,n.useEffect)((()=>{y()}),[y]),a&&!a.fbConnected?(0,H.jsx)("div",{className:e.pageRoot,children:(0,H.jsx)(i.Z,{className:e.connectMessage,children:(0,H.jsx)(c.Z,{variant:"h4",color:"primary",style:{cursor:"pointer"},onClick:()=>t.push("/projects/".concat(m,"/advertisement/setup")),children:"Connect and Setup Meta Ad Account to view lead forms! \u2192"})})}):(0,H.jsxs)("div",{className:"".concat(e.pageRoot," ginger-page-root"),children:[(0,H.jsxs)(r.Z,{container:!0,className:"".concat(e.pageTitleContainer," ginger-page-header"),children:[(0,H.jsx)(r.Z,{item:!0,children:(0,H.jsx)(i.Z,{display:"flex",alignItems:"center",children:(0,H.jsx)(c.Z,{variant:"h3",children:"Forms"})})}),(0,H.jsx)(i.Z,{display:"flex",alignItems:"center",ml:"auto",pr:2,children:(0,H.jsx)(Re.default,{})})]}),(0,H.jsx)(i.Z,{className:e.innerContainer,children:(0,H.jsx)(ze,{assistantId:m,pageId:h,totalResponses:g,onFormsSynced:y})})]})}},51854:(e,t,a)=>{a.d(t,{PK:()=>s,Zi:()=>l,cM:()=>i,q9:()=>o});const n=new Map,s=(e,t)=>"".concat(e,":").concat(JSON.stringify(t||{})),o=e=>n.get(e),l=(e,t)=>{n.set(e,t)},i=e=>{const t="".concat(e,":");Array.from(n.keys()).forEach((e=>{e.startsWith(t)&&n.delete(e)}))}}}]);

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.