PageSourceSearch

https://solarintelligence.ai/assets/AdminSurveyResponsesPage-CRCCRxHM.js

js solarintelligence.ai collected 2026-10-05 12:51:08 UTC 11,271 bytes, 1 lines download raw bytes

1import{j as s}from"./state-DKBP_IF5.js";import{A as x}from"./AdminPageChrome-TdsAIsqV.js";import{r}from"./react-vendor-Unhn4PzF.js";import{e as N}from"./index-Br3_ARw7.js";import{A as g}from"./AdminIncludeAdminsToggle-Dzktzck7.js";/* empty css                           */import{C as b}from"./clipboard-list-C2XbsuEp.js";import"./ui-Dw3dkPmY.js";import"./charts-D5dg506X.js";import"./forms-GD8l5aEM.js";window.CESIUM_BASE_URL="/cesium/";function y(){const[a,m]=r.useState(null),[v,o]=r.useState(!0),[d,j]=r.useState(!1),[t,c]=r.useState("overview"),[l,h]=r.useState(null);r.useEffect(()=>{let e=!1;return(async()=>{try{o(!0);const i=await N.getAnalyticsSurveys(d);e||m(i.data)}catch(i){console.error("Failed to load surveys:",i)}finally{e||o(!1)}})(),()=>{e=!0}},[d]);const u=e=>new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}),n=e=>Math.max(...Object.values(e),1);return v?s.jsxs("div",{className:"surveys-section",children:[s.jsxs("h3",{className:"chart-title",children:[s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("path",{d:"M9 11l3 3L22 4"}),s.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),"Survey Responses"]}),s.jsxs("div",{className:"surveys-loading",children:[s.jsx("div",{className:"loading-spinner small"}),s.jsx("span",{children:"Loading surveys..."})]})]}):a?s.jsxs("div",{className:"surveys-section",children:[s.jsxs("div",{className:"surveys-header",children:[s.jsxs("h3",{className:"chart-title",children:[s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("path",{d:"M9 11l3 3L22 4"}),s.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),"Survey Responses",s.jsxs("span",{className:"surveys-count",children:[a.total_stage1+a.total_stage2," total"]})]}),s.jsxs("div",{className:"surveys-header-controls",children:[s.jsx(g,{checked:d,onChange:j}),s.jsxs("div",{className:"surveys-tabs",children:[s.jsx("button",{className:`survey-tab ${t==="overview"?"active":""}`,onClick:()=>c("overview"),children:"Overview"}),s.jsxs("button",{className:`survey-tab ${t==="stage1"?"active":""}`,onClick:()=>c("stage1"),children:["Profile (",a.total_stage1,")"]}),s.jsxs("button",{className:`survey-tab ${t==="stage2"?"active":""}`,onClick:()=>c("stage2"),children:["Market Activity (",a.total_stage2,")"]})]})]})]}),t==="overview"&&s.jsxs("div",{className:"surveys-overview",children:[s.jsxs("div",{className:"surveys-summary",children:[s.jsxs("div",{className:"survey-stat-box",children:[s.jsx("span",{className:"survey-stat-value",children:a.total_stage1}),s.jsx("span",{className:"survey-stat-label",children:"Profile Surveys"})]}),s.jsxs("div",{className:"survey-stat-box",children:[s.jsx("span",{className:"survey-stat-value",children:a.total_stage2}),s.jsx("span",{className:"survey-stat-label",children:"Market Activity Surveys"})]}),s.jsxs("div",{className:"survey-stat-box",children:[s.jsxs("span",{className:"survey-stat-value",children:[a.total_stage1>0?Math.round(a.total_stage2/a.total_stage1*100):0,"%"]}),s.jsx("span",{className:"survey-stat-label",children:"Completion Rate"})]})]}),a.aggregates&&s.jsxs("div",{className:"surveys-distributions",children:[a.aggregates.role_distribution&&Object.keys(a.aggregates.role_distribution).length>0&&s.jsxs("div",{className:"distribution-chart",children:[s.jsx("h4",{className:"distribution-title",children:"Role Distribution"}),s.jsx("div",{className:"distribution-bars",children:Object.entries(a.aggregates.role_distribution).sort((e,i)=>i[1]-e[1]).slice(0,6).map(([e,i])=>s.jsxs("div",{className:"distribution-item",children:[s.jsx("span",{className:"distribution-label",children:e}),s.jsxs("div",{className:"distribution-bar-container",children:[s.jsx("div",{className:"distribution-bar",style:{width:`${i/n(a.aggregates.role_distribution)*100}%`}}),s.jsx("span",{className:"distribution-value",children:i})]})]},e))})]}),a.aggregates.familiarity_distribution&&Object.keys(a.aggregates.familiarity_distribution).length>0&&s.jsxs("div",{className:"distribution-chart",children:[s.jsx("h4",{className:"distribution-title",children:"PV Familiarity"}),s.jsx("div",{className:"distribution-bars",children:Object.entries(a.aggregates.familiarity_distribution).sort((e,i)=>i[1]-e[1]).map(([e,i])=>s.jsxs("div",{className:"distribution-item",children:[s.jsx("span",{className:"distribution-label",children:e}),s.jsxs("div",{className:"distribution-bar-container",children:[s.jsx("div",{className:"distribution-bar familiarity",style:{width:`${i/n(a.aggregates.familiarity_distribution)*100}
1%`}}),s.jsx("span",{className:"distribution-value",children:i})]})]},e))})]}),a.aggregates.region_distribution&&Object.keys(a.aggregates.region_distribution).length>0&&s.jsxs("div",{className:"distribution-chart",children:[s.jsx("h4",{className:"distribution-title",children:"Regions of Interest"}),s.jsx("div",{className:"distribution-bars",children:Object.entries(a.aggregates.region_distribution).sort((e,i)=>i[1]-e[1]).slice(0,6).map(([e,i])=>s.jsxs("div",{className:"distribution-item",children:[s.jsx("span",{className:"distribution-label",children:e}),s.jsxs("div",{className:"distribution-bar-container",children:[s.jsx("div",{className:"distribution-bar region",style:{width:`${i/n(a.aggregates.region_distribution)*100}%`}}),s.jsx("span",{className:"distribution-value",children:i})]})]},e))})]}),a.aggregates.work_focus_distribution&&Object.keys(a.aggregates.work_focus_distribution).length>0&&s.jsxs("div",{className:"distribution-chart",children:[s.jsx("h4",{className:"distribution-title",children:"Work Focus"}),s.jsx("div",{className:"distribution-bars",children:Object.entries(a.aggregates.work_focus_distribution).sort((e,i)=>i[1]-e[1]).slice(0,6).map(([e,i])=>s.jsxs("div",{className:"distribution-item",children:[s.jsx("span",{className:"distribution-label",children:e}),s.jsxs("div",{className:"distribution-bar-container",children:[s.jsx("div",{className:"distribution-bar work-focus",style:{width:`${i/n(a.aggregates.work_focus_distribution)*100}%`}}),s.jsx("span",{className:"distribution-value",children:i})]})]},e))})]})]})]}),t==="stage1"&&s.jsx("div",{className:"surveys-list-container",children:a.stage1_surveys.length===0?s.jsx("div",{className:"surveys-empty",children:s.jsx("p",{children:"No profile surveys yet"})}):s.jsx("div",{className:"surveys-list",children:a.stage1_surveys.map(e=>s.jsxs("div",{className:`survey-item ${l===e.id?"expanded":""}`,onClick:()=>h(l===e.id?null:e.id),children:[s.jsxs("div",{className:"survey-item-header",children:[s.jsxs("div",{className:"survey-item-main",children:[s.jsx("span",{className:"survey-email",children:e.email}),s.jsx("span",{className:"survey-role-badge",children:e.role})]}),s.jsxs("div",{className:"survey-item-meta",children:[s.jsx("span",{className:"survey-timestamp",children:u(e.created_at)}),e.bonus_queries_granted>0&&s.jsxs("span",{className:"survey-bonus",children:["+",e.bonus_queries_granted," queries"]})]})]}),l===e.id&&s.jsxs("div",{className:"survey-item-details",children:[s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Familiarity:"}),s.jsx("span",{className:"survey-detail-value",children:e.familiarity})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Regions:"}),s.jsx("span",{className:"survey-detail-value",children:e.regions.join(", ")||"None selected"})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Insights:"}),s.jsx("span",{className:"survey-detail-value",children:e.insights.join(", ")||"None selected"})]}),e.tailored&&s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Tailored:"}),s.jsx("span",{className:"survey-detail-value",children:e.tailored})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"User Hash:"}),s.jsx("span",{className:"survey-detail-value survey-hash",children:e.user_hash})]})]})]},e.id))})}),t==="stage2"&&s.jsx("div",{className:"surveys-list-container",children:a.stage2_surveys.length===0?s.jsx("div",{className:"surveys-empty",children:s.jsx("p",{children:"No market activity surveys yet"})}):s.jsx("div",{className:"surveys-list",children:a.stage2_surveys.map(e=>s.jsxs("div",{className:`survey-item ${l===e.id+1e4?"expanded":""}`,onClick:()=>h(l===e.id+1e4?null:e.id+1e4),children:[s.jsxs("div",{className:"survey-item-header",children:[s.jsxs("div",{className:"survey-item-main",children:[s.jsx("span",{className:"survey-email",children:e.email}),s.jsx("span",{className:"survey-role-badge work-focus",children:e.work_focus})]}),s.jsxs("div",{className:"survey-item-meta",children:[s.jsx("span",{className:"survey-timestamp",children:u(e.created_at)}),e.bonus_queries_granted>0&&s.jsxs("span",{className:"survey-bonus",children:["+",e.bonus_queries_granted," queries"]})]})]}),l===e.id+1e4&&s.jsxs("div",{className:"survey-item-details",children:[s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"PV Segments:"}),s.jsx("span",{className:"survey-detail-value",children:e.pv_segments.join(", ")||"None selected"})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Technologies:"}),s.jsx("span",{className:"survey-detail-value",children:e.technologies.join(", ")||"None selected"})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Challenges:"}),s.jsx("span",{className:"survey-detail-value",children:e.challenges.join(", ")||"None selected"})]}),e.weekly_insight&&s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"Weekly Insight:"}),s.jsx("span",{className:"survey-detail-value",children:e.weekly_insight})]}),s.jsxs("div",{className:"survey-detail-row",children:[s.jsx("span",{className:"survey-detail-label",children:"User Hash:"}),s.jsx("span",{className:"survey-detail-value survey-hash",children:e.user_hash})]})]})]},e.id))})})]}):s.jsxs("div",{className:"surveys-section",children:[s.jsxs("h3",{className:"chart-title",children:[s.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[s.jsx("path",{d:"M9 11l3 3L22 4"}),s.jsx("path",{d:"M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"})]}),"Survey Responses"]}),s.jsx("div",{className:"surveys-empty",children:s.jsx("p",{children:"No survey data available"})})]})}function O(){return s.jsxs("div",{className:"analytics-page",children:[s.jsx(x,{}),s.jsx("div",{className:"analytics-header",children:s.jsxs("div",{children:[s.jsxs("h1",{children:[s.jsx(b,{size:28,strokeWidth:2}
1),"Survey Responses"]}),s.jsx("p",{className:"analytics-subtitle",children:"Onboarding survey analytics and individual responses"})]})}),s.jsx("div",{className:"chart-card analytics-widget-card",children:s.jsx(y,{})})]})}export{O as default};

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.