PageSourceSearch

https://classsight.ai/assets/SoftwareDetails-KN1M7bzm.js

js classsight.ai collected 2026-10-02 00:26:07 UTC 10,217 bytes, 1 lines download raw bytes

1import{j as s}from"./vendor-markdown-Daxr8BJC.js";import{r as D}from"./vendor-charts-qvx8-m0G.js";import{a7 as P,z as A,b as C,aP as e,C as h,D as j,d as x,u as L,_ as M,a3 as B,Y as U,f as z}from"./index-DomUViA2.js";import{u as F,a as T,S as E}from"./useSoftwareDetailComplete-XObG410N.js";import{A as k}from"./arrow-left-Dm8Znr56.js";import"./vendor-pdf-SjvVsPhg.js";import"./separator-Cuir5rbU.js";import"./softwareAggregation-BJ41NStq.js";import"./arrow-up-right-CS4LPnPJ.js";import"./minus-Dh30aSx4.js";import"./activity-DOYlDh4V.js";import"./UserUtilizationModal-AnY6kbB9.js";import"./useDebouncedSearch-BTC3foQz.js";import"./dialog-Z6uIZR47.js";import"./table-2JwoYJH_.js";import"./pagination-BWsTyAa6.js";import"./chevron-left-BM4F_IH1.js";import"./select-DQl_0Prn.js";import"./index-BdQq_4o_.js";import"./useDistrictDeviceInsights-B-vRgIR0.js";import"./circle-check-DcmIZKwX.js";import"./monitor-oEZee-rW.js";import"./filter-B-mLNcwP.js";import"./share-2-UB-axEvr.js";import"./format-DxQEMY0O.js";import"./en-US-BkOM94b8.js";import"./graduation-cap-DWabbyE4.js";import"./school-BO1QM0a8.js";import"./building-D3XI7BaO.js";import"./house-CkBHT_T4.js";import"./SoftwareDetailSlideOver-C6G3ai6Y.js";import"./progress-xwecauh6.js";import"./SoftwareRequestForm-DozLzjvo.js";import"./textarea-D7EqJhoS.js";import"./radio-group-BkU_jd62.js";import"./RequesterFields-DKzijjWl.js";import"./vendorEngagement-BgIPsJA9.js";import"./loader-circle-Zxz7fgvC.js";import"./lock-C3igZ1pg.js";import"./info-ChtQ0yBY.js";import"./book-open-BMctbPvs.js";import"./dollar-sign-CLYJJSKN.js";import"./star-DmsXF-Hj.js";import"./zap-D5kU4p-M.js";import"./send-DkJqSvl8.js";import"./download-Bu4HsJ2t.js";import"./history-C03PugHK.js";import"./upload-Bljz4qw0.js";import"./plus-BvlDSNSM.js";import"./link-2-DV_kY9i9.js";import"./copy-DEiTaKHS.js";import"./trash-2-BYHcvji4.js";const W=(r,l)=>{if(r==null||!Number.isFinite(r)||r<=0)return"low";const i=(l??"").toLowerCase().trim(),p=i==="weekly"?.8:i==="periodic"?.7:i==="sporadic"?.6:.9,n=i==="weekly"?.65:i==="periodic"?.5:i==="sporadic"?.4:.75;return r>=p&&r>=.8?"high":r>=n&&r>=.6?"moderate":"low"},$=({softwareName:r,userType:l="student",grades:i,enabled:p=!0})=>P({queryKey:["software-card-compliance",r,l,i],enabled:p&&!!r,staleTime:1e3*60*2,queryFn:async()=>{var b;if(!r)return null;const{data:n}=await A.auth.getSession(),o=(b=n==null?void 0:n.session)==null?void 0:b.access_token;if(!o)return null;const c=new URLSearchParams;c.set("search",r),c.set("view",l==="teacher"?"Teacher":"Student"),c.set("grades",i&&i!=="All Grades"?i:"all"),c.set("softwareType","authorizedAll"),c.set("page","1"),c.set("limit","12"),c.set("sortBy","cost"),c.set("sortOrder","desc");const w=await fetch(`https://api.classsight.ai/functions/v1/software-management?${c}`,{headers:{Authorization:`Bearer ${o}`,"Content-Type":"application/json"}});if(!w.ok)return null;const u=await w.json(),m=(u==null?void 0:u.data)||[],a=r.toLowerCase(),t=m.find(d=>String((d==null?void 0:d.name)||"").toLowerCase()===a)||m[0];if(!t)return null;const N=t.usageCompliance??t.usage_compliance??(t.usage_ratio!=null?Number(t.usage_ratio)*100:null)??t.percent_days_with_minimum_usage??null,v=N==null||!Number.isFinite(Number(N))?null:Math.max(0,Math.min(100,Number(N))),g=t.usage_ratio!=null?Number(t.usage_ratio):null,f=t.category_type??null,y=W(g,f),_=t.roi_percentage!=null&&Number.isFinite(Number(t.roi_percentage))?Number(t.roi_percentage):g!=null?(g-1)*100:null;return{compliance:v,roiStatus:y,roiPercentage:_}}}),I=()=>s.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-50 via-blue-50/20 to-indigo-50/30",children:s.jsxs("div",{className:"container mx-auto py-4 px-4 space-y-6",children:[s.jsx("div",{className:"animate-fade-in",children:s.jsxs(C,{variant:"ghost",className:"flex items-center gap-2 text-muted-foreground",disabled:!0,children:[s.jsx(k,{className:"h-4 w-4"}),"Back to Dashboard"]})}),s.jsxs("div",{className:"bg-white/80 backdrop-blur-sm rounded-xl shadow-lg border border-white/50 p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx(e,{className:"h-9 w-64"}),s.jsx(e,{className:"h-6 w-20"})]}),s.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4 mb-4",children:Array.from({length:4}).map((r,l)=>s.jsx("div",{className:"bg-blue-50 rounded-lg p-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(e,{className:"h-5 w-5 rounded-full"}),s.jsxs("div",{className:"flex-1",children:[s.jsx(e,{className:"h-6 w-12 mb-1"}),s.jsx(e,{className:"h-3 w-16"})]})]})},l))}),s.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[s.jsx(e,{className:"h-4 w-24"}),s.jsx(e,{className:"h-4 w-32"})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(e,{className:"h-9 w-28"}),s.jsx(e,{className:"h-9 w-20"})]})]}),s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsx(e,{className:"h-4 w-full mb-2"}),s.jsx(e,{className:"h-4 w-3/4"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[20%_20%_20%_35%] gap-4",children:[s.jsxs(h,{className:"animate-pulse",children:[s.jsx(j,{className:"pb-2",children:s.jsx(e,{className:"h-5 w-32"})}),s.jsxs(x,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-20 mb-1"}),s.jsx(e,{className:"h-6 w-24"})]}),s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-16 mb-1"}),s.jsx(e,{className:"h-6 w-16"})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-24 mb-1"}),s.jsx(e,{className:"h-6 w-16"})]}),s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-8 mb-1"}),s.jsx(e,{className:"h-6 w-12"})]})]})]})]}),s.jsxs(h,{className:"animate-pulse",children:[s.jsx(j,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(e,{className:"h-5 w-5 rounded-full"}),s.jsx(e,{className:"h-5 w-28"})]})}),s.jsxs(x,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(e,{className:"h-8 w-12 mb-1"}),s.jsx(e,{className:"h-4 w-32"})]}),s.jsx("div",{className:"pt-2 border-t",children:s.jsxs("div",{className:"flex justify-between",children:[s.jsx(e,{className:"h-4 w-20"}),s.jsx(e,{className:"h-4 w-12"})]})})]})]}),s.jsxs(h,{className:"animate-pulse",children:[s.jsx(j,{className:"pb-2",children:s.jsx(e,{className:"h-5 w-28"})}),s.jsx(x,{className:"space-y-4",children:Array.from({length:4}).map((r,l)=>s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-24 mb-1"}),s.jsx(e,{className:"h-6 w-16"})]},l))})]}),s.jsxs(h,{className:"lg:row-span-2 animate-pulse",children:[s.jsxs(j,{className:"pb-3",children:[s.jsx(e,{className:"h-6 w-40"}),s.jsx(e,{className:"h-4 w-full"})]}),s.jsx(x,{className:"space-y-4",children:Array.from({length:3}).map((r,l)=>s.jsx("div",{className:"border rounded-lg p-3",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(e,{className:"h-10 w-10 rounded"}),s.jsxs("div",{className:"flex-1",children:[s.jsx(e,{className:"h-5 w-32 mb-2"}),s.jsx(e,{className:"h-4 w-full mb-1"}),s.jsx(e,{className:"h-4 w-3/4"})]})]})},l))})]}),s.jsxs(h,{className:"lg:col-span-3 animate-pulse",children:[s.jsx(j,{className:"pb-2",children:s.jsx(e,{className:"h-5 w-32"})}),s.jsxs(x,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-12 mb-1"}),s.jsx(e,{className:"h-6 w-16"})]}),s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-20 mb-1"}),s.jsx(e,{className:"h-6 w-12"})]}),s.jsxs("div",{children:[s.jsx(e,{className:"h-4 w-16 mb-1"}),s.jsx(e,{className:"h-5 w-40"})]})]})]}),s.jsxs(h,{className:"lg:col-span-4 animate-pulse",children:[s.jsx(j,{children:s.jsx(e,{className:"h-6 w-48"})}),s.jsx(x,{children:s.jsx("div",{className:"space-y-4",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:Array.from({length:3}).map((r,l)=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(e,{className:"h-32 w-full"}),s.jsx(e,{className:"h-4 w-20"})]},l))})})})]})]})]})}),$s=()=>{var S;const{id:r}=L(),l=M(),[i]=B(),[p,n]=D.useState(1),o=((S=i.get("view"))==null?void 0:S.toLowerCase())==="teacher"?"teacher":"student",c=i.get("grades")||void 0,{software:w,isLoading:u,error:m}=F({softwareId:r||"",enabled:!!r}),a=w,{data:t}=$({softwareName:a==null?void 0:a.name,userType:o,grades:c,enabled:!!(a!=null&&a.name)}),N=(t==null?void 0:t.compliance)??null,v=(t==null?void 0:t.roiStatus)??null,g=(t==null?void 0:t.roiPercentage)??null,{data:f,isLoading:y}=T({softwareName:(a==null?void 0:a.name)||"",page:p,limit:50,enabled:!u&&!!(a!=null&&a.name),userType:o,gradeBand:c}),_=N??(a==null?void 0:a.percentDaysWithMinimumUsage)??(a==null?void 0:a.usage_compliance)??(a==null?void 0:a.utilization_rate_percentage)??0,b={softwareId:r||"",costPerStudent:(a==null?void 0:a.costPerStudent)||0,totalUsageDays:(a==null?void 0:a.totalUsageDays)||0,daysWithMinimumUsage:(a==null?void 0:a.daysWithMinimumUsage)||0,percentDaysWithMinimumUsage:_||0,roiStatus:v??(a==null?void 0:a.roiStatus)??"low",roi:g??(a==null?void 0:a.avg_roi_percentage)??0},d=()=>{l(`/roi-dashboard?view=${o}`)};return u?s.jsx(I,{}):(m&&!a&&(console.error("Materialized view fetch error:",m),U.error(`Failed to load software details: ${m.message}`)),a?s.jsx("div",{className:"container mx-auto py-8 px-4",children:s.jsx(E,{softw
1are:a,roiData:b,onBack:d,completeData:f,isLoadingComplete:y,currentPage:p,onPageChange:n,userType:o})}):s.jsxs("div",{className:"container mx-auto py-8 px-4",children:[s.jsx(C,{variant:"ghost",size:"icon",onClick:d,children:s.jsx(k,{className:"h-5 w-5"})}),s.jsx(h,{className:"p-8 mt-4",children:s.jsxs(x,{className:"text-center pt-6",children:[s.jsx(z,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),s.jsx("h2",{className:"text-xl font-bold mb-2",children:"Software Not Found"}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:['The software with ID "',r,`" couldn't be found in your database.`]}),m&&s.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:["Error details: ",m.message]}),s.jsx(C,{onClick:d,children:"Go Back"})]})})]}))};export{$s 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.