PageSourceSearch

https://replynext.com/assets/index-CQRz0ykg.js

js replynext.com collected 2026-10-08 09:40:40 UTC 13,640 bytes, 2 lines download raw bytes

1import{d as re,r as d,j as e,h as u,R as le,bd as H,dK as ce,T as l,G as A,H as y,bS as de,gB as q,c9 as P,f2 as pe,M as ue,ae as Q,dk as ge,ah as xe,b2 as me,dr as fe,dq as he}from"./mui-BUUHqJu8.js";import{D as be}from"./index-Dd3cWAR9.js";import{u as ye,bf as ve,aj as Ce,bk as je,bX as ke,fz as Se}from"./index-KfLgEAeB.js";import{u as ze,M as we}from"./index.esm-BA94RqL6.js";import{Q as Re}from"./index-T6j67Axu.js";import{u as Te}from"./useNarrowedAssetIds-BEXN1nH4.js";import{g as Ie,h as Le,f as De,S as Ae}from"./qrZipDownload-DJC24XTK.js";import{D as Pe}from"./index-Bw_vqor3.js";import{L as Fe}from"./index-COwHMr69.js";import{c as Ee}from"./vendor-ZhY-J0gg.js";import"./index-CzSrIK-J.js";import"./index-Jse0EZ2Z.js";import"./platformMeta-ByZVNQtt.js";import"./index-CHXjNc14.js";import"./index-CX2zYU70.js";import"./framer-a83AX1Uy.js";import"./TimePicker-D604ILim.js";import"./index.esm-CqtOSkpP.js";import"./inputFilesWrapper-BA7o8tfA.js";import"./index-_Rz_do29.js";import"./core.esm-Ci-aFFDb.js";import"./sortable.esm-CrCxcnw6.js";import"./useFormErrors-y_f1okxI.js";import"./index-BYmaT1WP.js";import"./InfoPanel-D811bTZY.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};a.SENTRY_RELEASE={id:"frontend-v1.30.0"};var o=new a.Error().stack;o&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[o]="97420282-c923-400d-80c5-9c89377c535e",a._sentryDebugIdIdentifier="sentry-dbid-97420282-c923-400d-80c5-9c89377c535e")}catch{}})();const We={year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0},N=(a,o,C)=>{const f=o.find(w=>w.id===a);return f&&(f.labels[C]||f.labels[Object.keys(f.labels)[0]])||a},ct=()=>{const{t:a}=ye(),o=re(),{navigateToDashboard:C}=ve(),{showError:f}=Ce(),{surveyId:w}=Ee(),O=!je()("reviews.edit"),[j,E]=d.useState({pageIndex:0,pageSize:25}),{filters:c}=ke(),{assetIds:R,resolved:U}=Te(),$=(c.assetLabelIds?.length??0)>0,[V,T]=d.useState(!1),[K,W]=d.useState(!1),[B,M]=d.useState(!1),k=w?Number(w):0,{data:i,isLoading:_,error:G}=Ie(k,{skip:!k}),v=(i?.products?.length??0)>1,I=d.useMemo(()=>(i?.products??[]).map(t=>t.asset?.id??t.assetId).filter(t=>t!=null),[i?.products]),X=d.useMemo(()=>{const t={surveyIds:[k],page:j.pageIndex+1,limit:j.pageSize};if(v&&R?.length&&I.length>0){const s=R.filter(r=>I.includes(r));s.length>0&&s.length<I.length&&(t.assetIds=s)}return c.rating&&c.rating!=="all"&&(t.rating=c.rating.split(",").map(Number).filter(s=>!isNaN(s))),c.language&&c.language!=="all"&&(t.language=[c.language]),c.date?.start&&(t.startDate=c.date.start),c.date?.end&&(t.endDate=c.date.end),t},[k,j.pageIndex,j.pageSize,v,I,R,c.rating,c.language,c.date]),{data:L,isLoading:Y,isFetching:Z}=Le(X,{skip:!k||$&&!U});d.useEffect(()=>{E(t=>({...t,pageIndex:0}))},[R,c.rating,c.language,c.date]);const J=d.useCallback(()=>{C("/get-reviews")},[C]),ee=d.useCallback(()=>{W(!0)},[]),te=d.useCallback(()=>{if(i?.links&&i.links.length>0){const t=i.links.find(r=>r.isActive)||i.links[0],s=`${window.location.origin}/survey/${t.key}`;navigator.clipboard.writeText(s).then(()=>{M(!0),window.setTimeout(()=>M(!1),2e3)}).catch(()=>{f(a("copyFailed","Failed to copy link"))})}},[i,f,a]),S=d.useMemo(()=>{const t=i?.links?.[0]?.key;return t?`${window.location.origin}/survey/${t}`:""},[i]),ae=d.useCallback(()=>{const t=document.getElementById("qr-detail-modal-image");if(t){const s=new XMLSerializer().serializeToString(t),r=`qr-${i?.name?.toLowerCase().replace(/\s+/g,"-")||"survey"}`,p=document.createElement("canvas"),h=p.getContext("2d"),x=new Image,n=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),g=URL.createObjectURL(n);x.onload=()=>{if(h){p.width=400,p.height=400,h.clearRect(0,0,400,400),h.drawImage(x,0,0,400,400),URL.revokeObjectURL(g);const m=p.toDataURL("image/png").replace("image/png","image/octet-stream"),b=document.createElement("a");b.href=m,b.download=`${r}.png`,document.body.appendChild(b),b.click(),document.body.removeChild(b)}},x.src=g}},[i]),oe=d.useCallback(()=>{const t=i?.products??[];if(t.length<=1||!S){T(!0);return}const s=t.map(r=>({url:`${S}?asset=${r.asset?.id??r.assetId??r.id}`,fileName:r.asset?.name||r.title}));
1De(s,`qr-${i?.name||"survey"}`).catch(()=>{f(a("downloadFailed","Failed to download QR codes"))})},[i,S,f,a]),F=d.useMemo(()=>{const t=L?.stats,s=t?.total??0,r=t?.avgRating??0,p=t?.deflectedCount??0,h=t?.negativeReviewCount??0,x=p+h,n=x>0?p/x*100:0;return{total:s,avgRating:r,deflectionRate:n}},[L]),D=d.useCallback(t=>e.jsx(u,{sx:{display:"flex",alignItems:"center",gap:"2px"},children:[1,2,3,4,5].map(s=>e.jsx(le.Fragment,{children:t>=s?e.jsx(H,{sx:{fontSize:16,color:"#FF7A78"}}):e.jsx(ce,{sx:{fontSize:16,color:"#DBDDE6"}})},s))}),[]),se=d.useMemo(()=>[{accessorKey:"rating",header:a("rating"),size:120,Cell:({cell:t})=>D(t.getValue()),muiTableHeadCellProps:{sx:{fontSize:"12px",fontWeight:600,color:"#6B7280"}}},...v?[{id:"location",header:a("location","Location"),size:180,accessorFn:t=>t.asset?.name||"-",muiTableHeadCellProps:{sx:{fontSize:"12px",fontWeight:600,color:"#6B7280"}}}]:[],{id:"tags",header:a("tags","Tags"),size:280,Cell:({row:t})=>{const s=t.original.answers||[],r=t.original.language||"en",p=s.find(m=>m.question?.type==="tags");if(!p||!Array.isArray(p.value)||p.value.length===0)return e.jsx(l,{variant:"body2",sx:{color:"#9CA3AF"},children:"-"});const h=p.question?.options||[],x=p.value.map(m=>N(m,h,r)),n=3,g=x.slice(0,n),z=x.length-n;return e.jsxs(u,{sx:{display:"flex",gap:.5,flexWrap:"wrap",alignItems:"center"},children:[g.map((m,b)=>e.jsx(A,{label:m,size:"small",sx:{height:"22px",fontSize:"11px",fontWeight:500,backgroundColor:y(o.palette.primary.main,.08),color:o.palette.primary.main,border:"1px solid",borderColor:y(o.palette.primary.main,.2)}},b)),z>0&&e.jsx(A,{label:`+${z}`,size:"small",sx:{height:"22px",fontSize:"11px",fontWeight:600,backgroundColor:y(o.palette.text.secondary,.08),color:o.palette.text.secondary}})]})},muiTableHeadCellProps:{sx:{fontSize:"12px",fontWeight:600,color:"#6B7280"}}},{accessorKey:"language",header:a("language"),size:120,Cell:({cell:t})=>e.jsx(A,{label:t.getValue()?.toUpperCase()||"-",size:"small",variant:"outlined",sx:{height:"22px",fontSize:"11px",fontWeight:600,borderColor:y(o.palette.primary.main,.3),color:o.palette.primary.main}}),muiTableHeadCellProps:{sx:{fontSize:"12px",fontWeight:600,color:"#6B7280"}}},{accessorKey:"createdAt",header:a("date"),size:180,Cell:({cell:t})=>e.jsx(l,{variant:"body2",sx:{color:"#3A4055"},children:t.getValue()?new Date(t.getValue()).toLocaleString("en-US",We):"-"}),muiTableHeadCellProps:{sx:{fontSize:"12px",fontWeight:600,color:"#6B7280"}}}],[a,o,D,v]),ne=d.useCallback(({row:t})=>{const s=t.original,r=(s.answers||[]).filter(n=>n.question).sort((n,g)=>(n.question?.order??0)-(g.question?.order??0)),p=s.language||"en",h=n=>{const g=n.question.labelByLocale;return g[p]||g[Object.keys(g)[0]]||`Question ${n.question.order+1}`},x=n=>{const g=n.question;switch(g.type){case"tags":{if(!Array.isArray(n.value)||n.value.length===0)return e.jsx(l,{variant:"body2",color:"text.disabled",sx:{fontSize:"13px"},children:"-"});const z=g.options||[];return e.jsx(u,{sx:{display:"flex",gap:.5,flexWrap:"wrap"},children:n.value.map(m=>{const b=N(m,z,p);return e.jsx(A,{label:b,size:"small",sx:{height:"22px",fontSize:"11px",fontWeight:500,backgroundColor:y(o.palette.primary.main,.08),color:o.palette.primary.main}},m)})})}case"text":return e.jsx(l,{variant:"body2",sx:{fontSize:"13px",color:o.palette.text.primary,lineHeight:1.5},children:n.value||"-"});case"rating":return D(n.value);default:return e.jsx(l,{variant:"body2",sx:{fontSize:"13px",color:o.palette.text.secondary},children:String(n.value??"-")})}};return e.jsx(u,{sx:{px:3,py:1.5,backgroundColor:y(o.palette.primary.main,.02),borderTop:"1px solid",borderColor:"divider"},children:r.length>0?e.jsxs(u,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(auto-fill, minmax(240px, 1fr))"},gap:1.5},children:[r.map(n=>e.jsxs(u,{sx:{minWidth:0},children:[e.jsx(l,{variant:"caption",sx:{fontWeight:600,color:o.palette.text.secondary,fontSize:"11px",lineHeight:1.2,mb:.25,display:"block"},children:h(n)}),x(n)]},n.id)),e.jsxs(u,{sx:{minWidth:0},children:[e.jsx(l,{variant:"caption",sx:{fontWeight:600,color:o.palette.text.secondary,fontSize:"11px",lineHeight:1.2,mb:.25,display:"block"},children:a("email")}),e.jsx(l,{variant:"body2",sx:{fontSize:"13px"},children:s.email||"-"})]}),s.acceptTerms!==void 0&&e.jsxs(u,{sx:{minWidth:0},children:[e.jsx(l,{variant:"caption",sx:{fontWeight:600,color:o.palette.text.secondary,fontSize:"11px",lineHeight:1.2,mb:.25,display:"block"},children:a("acceptTerms","Terms")}),e.jsxs(u,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e.jsx(de,{sx:{fontSize:14,color:s.acceptTerms?o.palette.success.main:o.palette.text.disabled}}),e.jsx(l,{variant:"body2",sx:{fontSize:"13px"},children:s.acceptTerms?a("yes","Yes"):a("no","No")})]})]})]}):e.jsx(l,{variant:"body2",color:"text.disabled",sx:{fontSize:"13px"},children:a("noAnswers","No answers recorded")})})},[a,o,D]),ie=ze({...Se({enablePagination:!0,enableBottomToolbar:!0,enableTopToolbar:!1}),columns:se,data:L?.data||[],rowCount:L?.pagination?.total??0,state:{isLoading:Y,showProgressBars:Z,pagination:j},onPaginationChange:E,manualPagination:!0,renderDetailPanel:ne,muiTableBodyRowProps:({row:t})=>({onClick:()=>t.toggleExpanded(),sx:{cursor:"pointer"}}),muiTableBodyCellProps:{sx:{py:"6px",px:"12px",fontSize:"13px"}},muiTableHeadCellProps:{sx:{py:"8px",px:"12px"}},muiSkeletonProps:{animation:"wave",height:28},initialState:{sorting:[{id:"createdAt",desc:!0}]},enableGlobalFilter:!1,enableColumnFilters:!1,enableSorting:!0,muiTableContainerProps:{sx:{flex:1,minHeight:0,overflow:"auto"}},muiTablePaperProps:{elevation:0,sx:{boxShadow:"none",border:"none",backgroundColor:"transparent",width:"100%",flex:1,minHeight:0,display:"flex",flexDirection:"column"}}});return _?null:G||!i?e.jsxs(u,{sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",height:"60vh",gap:3},children:[e.jsx(u,{sx:{p:2,borderRadius:2,background:y(o.palette.error.main,.1),color:o.palette.error.main},children:e.jsx(q,{sx:{fontSize:48}})}),e.jsx(l,{variant:"h6",sx:{color:o.palette.text.primary,fontWeight:600},children:a("surveyNotFound")}),e.jsx(Pe,{onClick:J,children:a("backToSurveys")})]}):e.jsxs(be,{filters:v?["app","date","rating","language"]:["date","rating","language"],isMultipleApps:v,headerContent:e.jsx(Fe,{title:i.name,subtitle:i.description||a("surveyDetailSubtitle","View responses, download QR codes, and manage this survey."),actions:[...i.links&&i.links.length>0?[{icon:B?e.jsx(me,{fontSize:"small"}):e.jsx(fe,{fontSize:"small"}),onClick:te,tooltip:B?a("copied","Copied!"):a("copyLink","Copy Link")},{icon:e.jsx(q,{fontSize:"small"}),onClick:oe,tooltip:(i.products?.length??0)>1?a("downloadAllQR","Download All QR Codes"):a("qrCode","QR Code")}]:[],{icon:e.jsx(he,{fontSize:"small"}),onClick:ee,tooltip:a("edit","Edit"),disabled:O}]}),children:[e.jsxs(u,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(3, 1fr)"},gap:2,mb:3},children:[e.jsxs(P,{elevation:0,sx:{borderRadius:3,p:3,backgroundColor:"#fff",textAlign:"center"},children:[e.jsx(l,{variant:"h3",sx:{fontWeight:700,color:o.palette.primary.main},children:F.total}),e.jsx(l,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:a("totalResponses")})]}),e.jsxs(P,{elevation:0,sx:{borderRadius:3,p:3,backgroundColor:"#fff",textAlign:"center"},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5},children:[e.jsx(l,{variant:"h3",sx:{fontWeight:700,color:o.palette.warning.main},children:F.avgRating.toFixed(1)}),e.jsx(H,{sx:{fontSize:28,color:"#FF7A78"}})]}),e.jsx(l,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:a("avgRating")})]}),e.jsxs(P,{elevation:0,sx:{borderRadius:3,p:3,backgroundColor:"#fff",textAlign:"center"},children:[e.jsxs(u,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:.5},children:[e.jsxs(l,{variant:"h3",sx:{fontWeight:700,color:o.palette.success.main},children:[F.deflectionRate.toFixed(0),"%"]}),e.jsx(pe,{sx:{fontSize:24,color:o.palette.success.main}})]}),e.jsx(l,{variant:"body2",sx:{color:"text.secondary",mt:.5},children:a("deflectionRate","Deflection Rate")})]})]}),e.jsx(P,{elevation:0,sx:{borderRadius:3,backgroundColor:"#fff",overflow:"hidden",flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:e.jsx(we,{table:ie})}),e.jsx(ue,{open:V,onClose:()=>T(!1),sx:{display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0, 0, 0, 0.95)"},children:e.jsxs(u,{sx:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",outline:"none"},onClick:t=>{t.target===t.currentTarget&&T(!1)},children:[e.jsx(Q,{onClick:ae,sx:{position:"absolute",top:20,left:2
10,color:"white",backgroundColor:"rgba(255, 255, 255, 0.1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},zIndex:2},children:e.jsx(ge,{sx:{fontSize:32}})}),e.jsx(Q,{onClick:()=>T(!1),sx:{position:"absolute",top:20,right:20,color:"white",backgroundColor:"rgba(255, 255, 255, 0.1)","&:hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},zIndex:2},children:e.jsx(xe,{sx:{fontSize:32}})}),S&&e.jsx(u,{sx:{maxWidth:"90%",maxHeight:"90%",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"white",padding:"40px",borderRadius:"8px"},children:e.jsx(Re,{id:"qr-detail-modal-image",size:400,value:S})})]})}),e.jsx(Ae,{open:K,onClose:()=>W(!1),survey:i})]})};export{ct as default};
2//# sourceMappingURL=index-CQRz0ykg.js.map

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.