PageSourceSearch

https://www.codingjr.online/_next/static/chunks/pages/panel/lab_reports/view-81362ab1a543cca9.js

js codingjr.online collected 2026-09-24 12:25:33 UTC 28,608 bytes, 1 lines download raw bytes

1void 0===Promise.withResolvers&&(Promise.withResolvers=function(){let e,t;return{promise:new Promise((a,n)=>{e=a,t=n}),resolve:e,reject:t}}),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1903],{51459:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/panel/lab_reports/view",function(){return a(14504)}])},22551:function(e,t,a){"use strict";var n=a(85893),r=a(74136);let o={control:(e,t)=>({...e,borderColor:t.isFocused?"#fff":"#e2e8f0","&:hover":{borderColor:"#3D63EA"},borderRadius:4}),option:(e,t)=>({...e,backgroundColor:t.isSelected?"#3D63EA":"#fff",color:t.isSelected?"#fff":"text-gray-500","&:hover":{backgroundColor:"#3D63EA",color:"#fff"}}),singleValue:e=>({...e,color:"text-gray-700"}),menu:e=>({...e,zIndex:999,"scrollbar-width":"thin","scrollbar-color":"#888 transparent",scrollMargin:0,scrollbarWidth:"revert-layer",msScrollbarArrowColor:"transparent","::-webkit-scrollbar":{width:"4px"},"::-webkit-scrollbar-track":{background:"transparent"},"::-webkit-scrollbar-thumb":{background:"#888",borderRadius:"2px"},"::-webkit-scrollbar-thumb:hover":{background:"#555"}})};var s=1;t.Z=e=>{let{className:t,value:a,placeholder:i,getOptionValue:l,options:c,defaultValue:d,maxMenuHeight:u,onChange:h,menuPosition:m}=e;return(0,n.jsx)(r.ZP,{placeholder:null!=i?i:"Select an option",onChange:h,maxMenuHeight:u,defaultValue:d,menuPlacement:"".concat(null!=m?m:"auto"),options:c,styles:o,getOptionValue:l,className:t,value:a},s++)}},79970:function(e,t,a){"use strict";var n=a(85893);t.Z=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,n.jsx)("path",{d:"M2 12C2 8.22876 2 6.34315 3.17157 5.17157C4.34315 4 6.22876 4 10 4H14C17.7712 4 19.6569 4 20.8284 5.17157C22 6.34315 22 8.22876 22 12V14C22 17.7712 22 19.6569 20.8284 20.8284C19.6569 22 17.7712 22 14 22H10C6.22876 22 4.34315 22 3.17157 20.8284C2 19.6569 2 17.7712 2 14V12Z",stroke:"currentColor",strokeWidth:"1.5"}),(0,n.jsx)("path",{opacity:"0.5",d:"M7 4V2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{opacity:"0.5",d:"M17 4V2.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{opacity:"0.5",d:"M2 9H22",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}},77393:function(e,t,a){"use strict";var n=a(85893);t.Z=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,n.jsx)("path",{d:"M17 7.82959L18.6965 9.35641C20.239 10.7447 21.0103 11.4389 21.0103 12.3296C21.0103 13.2203 20.239 13.9145 18.6965 15.3028L17 16.8296",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{opacity:"0.5",d:"M13.9868 5L10.0132 19.8297",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),(0,n.jsx)("path",{d:"M7.00005 7.82959L5.30358 9.35641C3.76102 10.7447 2.98975 11.4389 2.98975 12.3296C2.98975 13.2203 3.76102 13.9145 5.30358 15.3028L7.00005 16.8296",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]})}},14504:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return N}});var n=a(85893),r=a(22551),o=a(37340),s=a(67294);function i(){let e=(0,o._)(['\n  .loader {\n  --background: linear-gradient(135deg, #3fdcdb, #3aa6e7);\n  --shadow: #3aa6e767;\n  --text: #6c7486;\n  --page: rgba(255, 255, 255, 0.36);\n  --page-fold: rgba(255, 255, 255, 0.52);\n  --duration: 3s;\n  width: 200px;\n  height: 140px;\n  position: relative;\n}\n\n.loader:before,\n.loader:after {\n  --r: -6deg;\n  content: "";\n  position: absolute;\n  bottom: 8px;\n  width: 120px;\n  top: 80%;\n  box-shadow: 0 16px 12px var(--shadow);\n  transform: rotate(var(--r));\n}\n\n.loader:before {\n  left: 4px;\n}\n\n.loader:after {\n  --r: 6deg;\n  right: 4px;\n}\n\n.loader div {\n  width: 100%;\n  height: 100%;\n  border-radius: 13px;\n  position: relative;\n  z-index: 1;\n  perspective: 600px;\n  box-shadow: 0 4px 6px var(--shadow);\n  background-image: var(--background);\n}\n\n.loader div ul {\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  position: relative;\n}\n\n.loader div ul li {\n  --r: 180deg;\n  --o: 0;\n  --c: var(--page);\n  position: absolute;\n  top: 10px;\n  left: 10px;\n  transform-origin: 100% 50%;\n  color: var(--c);\n  opacity: var(--o);\n  transform: rotateY(var(--r));\n  -webkit-animation: var(--duration) ease infinite;\n  animation: var(--duration) ease infinite;\n}\n\n.loader div ul li:nth-child(2) {\n  --c: var(--page-fold);\n  -webkit-animation-name: page-2;\n  animation-name: page-2;\n}\n\n.loader div ul li:nth-child(3) {\n  --c: var(--page-fold);\n  -webkit-animation-name: page-3;\n  animation-name: page-3;\n}\n\n.loader div ul li:nth-child(4) {\n  --c: var(--page-fold);\n  -webkit-animation-name: page-4;\n  animation-name: page-4;\n}\n\n.loader div ul li:nth-child(5) {\n  --c: var(--page-fold);\n  -webkit-animation-name: page-5;\n  animation-name: page-5;\n}\n\n.loader div ul li svg {\n  width: 90px;\n  height: 120px;\n  display: block;\n}\n\n.loader div ul li:first-child {\n  --r: 0deg;\n  --o: 1;\n}\n\n.loader div ul li:last-child {\n  --o: 1;\n}\n\n.loader span {\n  display: block;\n  left: 0;\n  right: 0;\n  top: 100%;\n  margin-top: 20px;\n  text-align: center;
1\n  color: var(--text);\n}\n\n@keyframes page-2 {\n  0% {\n    transform: rotateY(180deg);\n    opacity: 0;\n  }\n\n  20% {\n    opacity: 1;\n  }\n\n  35%,\n  100% {\n    opacity: 0;\n  }\n\n  50%,\n  100% {\n    transform: rotateY(0deg);\n  }\n}\n\n@keyframes page-3 {\n  15% {\n    transform: rotateY(180deg);\n    opacity: 0;\n  }\n\n  35% {\n    opacity: 1;\n  }\n\n  50%,\n  100% {\n    opacity: 0;\n  }\n\n  65%,\n  100% {\n    transform: rotateY(0deg);\n  }\n}\n\n@keyframes page-4 {\n  30% {\n    transform: rotateY(180deg);\n    opacity: 0;\n  }\n\n  50% {\n    opacity: 1;\n  }\n\n  65%,\n  100% {\n    opacity: 0;\n  }\n\n  80%,\n  100% {\n    transform: rotateY(0deg);\n  }\n}\n\n@keyframes page-5 {\n  45% {\n    transform: rotateY(180deg);\n    opacity: 0;\n  }\n\n  65% {\n    opacity: 1;\n  }\n\n  80%,\n  100% {\n    opacity: 0;\n  }\n\n  95%,\n  100% {\n    transform: rotateY(0deg);\n  }\n}\n\n']);return i=function(){return e},e}let l=a(35480).ZP.div(i());var c=()=>(0,n.jsx)(l,{children:(0,n.jsxs)("div",{className:"loader",children:[(0,n.jsx)("div",{children:(0,n.jsxs)("ul",{children:[(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})}),(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})}),(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})}),(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})}),(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})}),(0,n.jsx)("li",{children:(0,n.jsx)("svg",{viewBox:"0 0 90 120",fill:"currentColor",children:(0,n.jsx)("path",{d:"M90,0 L90,120 L11,120 C4.92486775,120 0,115.075132 0,109 L0,11 C0,4.92486775 4.92486775,0 11,0 L90,0 Z M71.5,81 L18.5,81 C17.1192881,81 16,82.1192881 16,83.5 C16,84.8254834 17.0315359,85.9100387 18.3356243,85.9946823 L18.5,86 L71.5,86 C72.8807119,86 74,84.8807119 74,83.5 C74,82.1745166 72.9684641,81.0899613 71.6643757,81.0053177 L71.5,81 Z M71.5,57 L18.5,57 C17.1192881,57 16,58.1192881 16,59.5 C16,60.8254834 17.0315359,61.9100387 18.3356243,61.9946823 L18.5,62 L71.5,62 C72.8807119,62 74,60.8807119 74,59.5 C74,58.1192881 72.8807119,57 71.5,57 Z M71.5,33 L18.5,33 C17.1192881,33 16,34.1192881 16,35.5 C16,36.8254834 17.0315359,37.9100387 18.3356243,37.9946823 L18.5,38 L71.5,38 C72.8807119,38 74,36.8807119 74,35.5 C74,34.1192881 72.8807119,33 71.5,33 Z"})})})]})}),(0,n.jsx)("span",{children:"Loading"})]})}),d=a(79970),u=e=>{let{className:t}=e;return(0,n.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[(0,n.jsx)("circle",{opacity:"1",cx:"12",cy:"12",r:"10",stroke:"black",strokeWidth:"1.5"}),(0,n.jsx)("path",{d:"M12 8V12L14.5 14.5",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},h=a(77393),m=a(41382),p=a(30178),g=a(88057),x=a(73237),f=a(89687),v=a(87066),b=a(47041),y=a(89734),w=a.n(y),C=a(32333),j=a(11163),L=a(9473);let _=[{label:"C (Clang 10.0.1)",value:"1"},{label:"C++ (Clang 10.0.1)",value:"2"},{label:"Java (OpenJDK 14.0.1)",value:"4"},{label:"PHP (7.4.1)",value:"68"},{label:"JavaScript (Node.js 12.14.0)",value:"63"},{label:"TypeScript",value:"74"},{label:"Python (3.8.1)",value:"71"},{label:"Python for ML (3.7.3)",value:"72"}],k=()=>
1{let[e,t]=(0,s.useState)({web_dev_count:0,ide_count:0,game_dev_count:0,scratchjr_count:0}),[a,o]=(0,s.useState)([]),[i,l]=(0,s.useState)([]),[m,y]=(0,s.useState)([]),[k,N]=(0,s.useState)([]),[S,Z]=(0,s.useState)(void 0),[P,M]=(0,s.useState)(void 0),[A,E]=(0,s.useState)(0),[D,U]=(0,s.useState)(_[0]),[B,R]=(0,s.useState)(_[0].value),[q,W]=(0,s.useState)(!1),[Y,T]=(0,s.useState)(1),[z,I]=(0,s.useState)(10),[O,V]=(0,s.useState)(!1),[F,H]=(0,s.useState)(!0),J=(0,j.useRouter)(),K=(0,L.I0)(),[X,G]=(0,s.useState)({columnAccessor:"serial_no",direction:"asc"}),[Q,$]=(0,s.useState)({columnAccessor:"serial_no",direction:"asc"});(0,s.useEffect)(()=>{K((0,x.Iw)("Lab Reports"))},[]),(0,s.useEffect)(()=>{if(J.isReady){let e=J.query.user_id,t=J.query.name;Z(Array.isArray(e)?e[0]:e),M(Array.isArray(t)?t[0]:t),E(0)}},[J.isReady,J.query.user_id,J.query.name]),(0,s.useEffect)(()=>{S&&ee(S)},[S]),(0,s.useEffect)(()=>{S&&void 0!==A&&(0===A?ec(S):1===A?el(Y,z,S):2===A?ei(Y,z,S):es(Number(S)))},[S,A,Y,z]);let ee=async e=>{try{let a=await v.Z.get("".concat(g._n,"/lab_reports?user_id=").concat(e),{headers:{Authorization:"Bearer ".concat((0,b.getCookie)("token"))}});if(200===a.status&&a.data.data&&a.data.data.length>0){let e=a.data.data[0];t({web_dev_count:e.web_dev_count||0,ide_count:e.ide_count||0,game_dev_count:e.game_dev_count||0,scratchjr_count:e.scratchjr_count||0})}}catch(e){console.error("Error fetching report counts:",e),(0,p.CF)("error","Failed to fetch report counts")}},et=e=>{E(e),W(!1),V(!0),T(1),(0===e||2===e)&&(U(_[0]),R(_[0].value))},ea=(e,t)=>({serial_no:t+1,id:e.id,title:e.title,thumbnail:e.thumbnail,created_at:new Date(e.created_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),updated_at:new Date(e.updated_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})}),en=(e,t,a,n)=>({serial_no:(a-1)*n+t+1,id:e.id,title:e.title,code:e.code,created_at:new Date(e.created_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),updated_at:new Date(e.updated_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})}),er=(e,t,a,n)=>({serial_no:(a-1)*n+t+1,id:e.id,project_name:e.project_name,source_value:e.source_value,stdin_value:e.stdin_value,created_at:new Date(e.created_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),updated_at:new Date(e.updated_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})}),eo=(e,t)=>({serial_no:t+1,id:e.id,title:e.title,code:e.code,created_by:e.created_by,created_at:new Date(e.created_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"}),updated_at:new Date(e.updated_at).toLocaleDateString("en-US",{day:"numeric",month:"long",year:"numeric"})});(0,s.useEffect)(()=>{B&&S&&1===A&&el(Y,z,S)},[B,S,A]);let es=async e=>{V(!0);try{let t=await v.Z.get("".concat(g._n,"/scratchjr/reports?user_id=").concat(e),{headers:{Authorization:"Bearer ".concat((0,b.getCookie)("token"))}});if(200===t.status){if(!t.data.data||0===t.data.data.length){W(!0),N([]);return}let e=t.data.data.map((e,t)=>ea(e,t));N(e),W(!1)}else N([]),W(!0)}catch(t){let e="An unexpected error occurred. Please try again.";if(v.Z.isAxiosError(t)){if(t.response)switch(t.response.status){case 400:e="Invalid request. Please check your input.";break;case 401:e="You are not authorized to view this data. Please log in.";break;case 404:e="The requested data could not be found.";break;case 500:e="We're experiencing server issues. Please try again later."}else t.request&&(e="Unable to connect to the server. Please check your internet connection.")}(0,p.CF)("error",e)}finally{V(!1)}},ei=async(e,t,a)=>{V(!0);try{let n=await v.Z.get("".concat(g._n,"/game_dev/fetch_by_user?user_id=").concat(a),{headers:{Authorization:"Bearer ".concat((0,b.getCookie)("token"))}});if(200===n.status){if(0===n.data.length){W(!0),y([]);return}let a=n.data.map((a,n)=>en(a,n,e,t));y(a),W(!1)}else y([]),W(!0)}catch(t){let e="An unexpected error occurred. Please try again.";if(v.Z.isAxiosError(t)){if(t.response)switch(t.response.status){case 400:e="Invalid request. Please check your input.";break;case 401:e="You are not authorized to view this data. Please log in.";break;case 404:e="The requested data could not be found.";break;case 500:e="We're experiencing server issues. Please try again later."}else t.request&&(e="Unable to connect to the server. Please check your internet connection.")}(0,p.CF)("error",e)}finally{V(!1)}},el=async(e,t,a)=>{V(!0);try{let n=await v.Z.get("".concat(g._n,"/ide_dev/fetch_by_user?user_id=").concat(a,"&language_id=").concat(B),{headers:{Authorization:"Bearer ".concat((0,b.getCookie)("token"))}});if(200===n.status){if(0===n.data.length){W(!0),l([]);return}let a=n.data.map((a,n)=>er(a,n,e,t));l(a),W(!1)}else l([]),W(!0)}catch(t){let e="An unexpected error occurred. Please try again.";if(v.Z.isAxiosError(t)){if(t.response)switch(t.response.status){case 400:e="Invalid request. Please check your input.";break;case 401:e="You are not authorized to view this data. Please log in.";break;case 404:e="The requested data could not be found.";break;case 500:e="We're experiencing server issues. Please try again later."}else t.request&&(e="Unable to connect to the server. Please check your internet connection.")}(0,p.CF)("error",e)}finally{V(!1)}},ec=async e=>{V(!0);try{let t=await v.Z.get("".concat(g._n,"/web_dev/fetch_by_user?user_id=").concat(e),{headers:{Authorization:"Bearer ".concat((0,b.getCookie)("token"))}});if(200===t.status){if(0===t.data.length){o([]),W(!0);return}let e=t.data.map(eo);o(e),W(!1)}else o([]),W(!0)}catch(t){let e="An unexpected error occurred. Please try again.";if(v.Z.isAxiosError(t)){if(t.response)switch(t.response.status){case 400:e="Invalid request. Please check your input.";break;case 401:e="You are not authorized to view this data. Please log in.";break;case 404:e="The requested data could not be found.";break;case 500:e="We're experiencing server issues. Please try again later."}else t.request&&(e="Unable to connect to the server. Please check your internet connection.")}(0,p.CF)("error",e)}finally{V(!1)}},ed=e=>{let t;try{t=JSON.parse(e)}catch(e){return URL.createObjectURL(new Blob(["\n                <h2>Error: Invalid Report Format</h2>\n                <p>
1The report could not be rendered due to an invalid format.</p>\n            "],{type:"text/html"}))}let a=t["index.html"]||"<h1>No Content</h1>",n=t["style.css"]||"",r=t["script.js"]||"",o='\n            <!DOCTYPE html>\n            <html lang="en">\n            <head>\n                <meta charset="UTF-8">\n                <meta name="viewport" content="width=device-width, initial-scale=1.0">\n                <style>'.concat(n,"</style>\n            </head>\n            <body>\n                ").concat(a,"\n                <script>").concat(r,"</script>\n            </body>\n            </html>\n        ");return URL.createObjectURL(new Blob([o],{type:"text/html"}))},eu=(0,s.useMemo)(()=>{let e=w()(i,X.columnAccessor);return"desc"===X.direction?e.reverse():e},[i,X]),eh=(0,s.useMemo)(()=>{let e=w()(m,Q.columnAccessor);return"desc"===Q.direction?e.reverse():e},[m,Q]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"h-full w-full",children:[(0,n.jsxs)("div",{className:"mb-6 flex flex-wrap items-center justify-between rounded-sm p-6 gap-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-base font-medium text-gray-500",children:"LAB REPORTS:"}),(0,n.jsx)("div",{className:"d-flex justify-content-evenly align-items-center select-none",children:(0,n.jsx)("h2",{className:"text-2xl font-semibold",children:P})})]}),(0,n.jsxs)("div",{className:"flex items-center flex-wrap text-nowrap gap-x-3 gap-y-1",children:[(0,n.jsxs)("button",{onClick:()=>et(0),className:"badge ".concat(0===A?"bg-primary":"bg-gray-200 text-gray-700"," px-3 py-2 w-fit text-sm"),children:["Web Development: ",e.web_dev_count]}),(0,n.jsxs)("button",{onClick:()=>et(1),className:"badge ".concat(1===A?"bg-primary":"bg-gray-200 text-gray-700"," px-3 py-2 w-fit text-sm"),children:["Programming Labs: ",e.ide_count]}),(0,n.jsxs)("button",{onClick:()=>et(2),className:"badge ".concat(2===A?"bg-primary":"bg-gray-200 text-gray-700"," px-3 py-2 w-fit text-sm"),children:["Game Development: ",e.game_dev_count]}),(0,n.jsxs)("button",{onClick:()=>et(3),className:"badge ".concat(3===A?"bg-primary":"bg-gray-200 text-gray-700"," px-3 py-2 w-fit text-sm"),children:["Kids ScratchJr: ",e.scratchjr_count]})]})]}),(0,n.jsxs)("div",{className:"panel flex w-full flex-col p-6",children:[0===A&&(0,n.jsx)("div",{className:"grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:O?(0,n.jsx)("div",{className:"flex min-h-96 w-full items-center justify-center col-span-full",children:(0,n.jsx)("span",{className:"inline-block h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent align-middle"})}):q?(0,n.jsx)("div",{className:"flex min-h-96 w-full items-center justify-center col-span-full text-gray-600",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)(h.Z,{className:"mx-auto scale-150 mb-1"}),(0,n.jsx)("p",{children:"No reports found"})]})}):a.map(e=>(0,n.jsxs)("button",{className:"group flex w-full flex-col text-start gap-3 rounded-lg border border-gray-200 bg-white p-3 shadow-sm transition-all duration-200 hover:border-primary/30 hover:shadow-md",onClick:()=>window.open("/virtual_labs/web/?id=".concat(e.id)),children:[(0,n.jsxs)("div",{className:"aspect-video w-full overflow-hidden rounded-md border relative",children:[F&&(0,n.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-white",children:(0,n.jsx)(c,{})}),(0,n.jsx)("iframe",{onLoad:()=>H(!1),onError:()=>H(!1),src:ed(e.code),className:"h-full w-full bg-white",title:e.title,style:{pointerEvents:"none"}}),(0,n.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-black/40 to-transparent opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-primary text-xs font-medium text-white",children:e.serial_no}),(0,n.jsx)("h3",{className:"line-clamp-2 flex-1 text-base font-medium text-gray-800 group-hover:text-primary",children:e.title})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-1 text-sm text-gray-600",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u,{className:"shrink-0"}),(0,n.jsxs)("span",{children:["Created: ",(0,n.jsx)("span",{className:"font-medium text-gray-700",children:e.created_at})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.Z,{className:"scale-90 shrink-0"}),(0,n.jsxs)("span",{children:["Updated: ",(0,n.jsx)("span",{className:"font-medium text-gray-700",children:e.updated_at})]})]})]})]},e.id))}),1===A&&(0,n.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,n.jsx)("div",{className:"w-full sm:max-w-64 self-end",children:(0,n.jsx)(r.Z,{placeholder:"Select language",onCh
1ange:e=>{e&&(U(e),R(e.value),T(1),G({columnAccessor:"serial_no",direction:"asc"}))},value:D,className:"w-full",options:_,defaultValue:_[0]})}),(0,n.jsx)(C.w,{noRecordsText:"No programming reports found",highlightOnHover:!0,className:"table-hover whitespace-nowrap",records:eu,columns:[{accessor:"serial_no",title:"#",width:"5%",sortable:!0},{accessor:"project_name",title:"Project Name",width:"40%",sortable:!0},{accessor:"created_at",title:"Created At",width:"20%",sortable:!0},{accessor:"updated_at",title:"Updated At",width:"20%",sortable:!0},{accessor:"actions",title:"Actions",width:"15%",render:e=>(0,n.jsx)("button",{onClick:()=>{(0,f.jP)(Number(B)),window.open("/virtual_labs/ide/?lang=".concat(B,"&id=").concat(e.id),"_blank")},className:"btn btn-primary shadow-none py-1.5 px-3",children:"View"})}],sortStatus:X,onSortStatusChange:G,minHeight:200})]}),2===A&&(0,n.jsx)(C.w,{noRecordsText:"No game development reports found",highlightOnHover:!0,className:"table-hover whitespace-nowrap",records:eh,columns:[{accessor:"serial_no",title:"#",width:"5%",sortable:!0},{accessor:"title",title:"Project Name",width:"40%",sortable:!0},{accessor:"created_at",title:"Created At",width:"20%",sortable:!0},{accessor:"updated_at",title:"Updated At",width:"20%",sortable:!0},{accessor:"actions",title:"Actions",width:"15%",render:e=>(0,n.jsx)("button",{onClick:()=>{window.open("".concat(window.location.origin,"/virtual_labs/game_dev/index.html?id=").concat(e.id),"_blank")},className:"btn btn-primary shadow-none py-1.5 px-3",children:"View"})}],sortStatus:Q,onSortStatusChange:$,minHeight:200}),3===A&&(0,n.jsx)("div",{className:"grid w-full grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:O?(0,n.jsx)("div",{className:"flex min-h-96 w-full items-center justify-center col-span-full",children:(0,n.jsx)("span",{className:"inline-block h-12 w-12 animate-spin rounded-full border-4 border-primary border-t-transparent align-middle"})}):q?(0,n.jsx)("div",{className:"flex min-h-96 w-full items-center justify-center col-span-full text-gray-600",children:(0,n.jsx)("div",{className:"text-center",children:(0,n.jsx)("p",{children:"No reports found"})})}):k.map(e=>(0,n.jsxs)("button",{className:"group flex w-full text-start flex-col gap-3 rounded-lg border border-gray-200 bg-white p-3 shadow-sm transition-all duration-200 hover:cursor-pointer hover:border-primary/30 hover:shadow-md",onClick:()=>window.open("/virtual_labs/v/?id=742815&pid=".concat(e.id)),children:[(0,n.jsxs)("div",{className:"aspect-video w-full overflow-hidden rounded-md border relative",children:[e.thumbnail?(0,n.jsx)("img",{src:e.thumbnail,alt:e.title,className:"h-full w-full object-cover bg-white"}):(0,n.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gray-100 text-gray-400",children:"No Preview"}),(0,n.jsx)("div",{className:"absolute bottom-0 left-0 right-0 h-12 bg-gradient-to-t from-black/40 to-transparent opacity-0 transition-opacity group-hover:opacity-100"})]}),(0,n.jsxs)("div",{className:"flex items-start gap-2",children:[(0,n.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-primary text-xs font-medium text-white",children:e.serial_no}),(0,n.jsx)("h3",{className:"line-clamp-2 flex-1 text-base font-medium text-gray-800 group-hover:text-primary",children:e.title})]}),(0,n.jsxs)("div",{className:"flex w-full flex-col gap-1 text-sm text-gray-600",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u,{className:"shrink-0"}),(0,n.jsxs)("span",{children:["Created: ",(0,n.jsx)("span",{className:"font-medium text-gray-700",children:e.created_at})]})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(d.Z,{className:"scale-90 shrink-0"}),(0,n.jsxs)("span",{children:["Updated: ",(0,n.jsx)("span",{className:"font-medium text-gray-700",children:e.updated_at})]})]})]})]},e.id))})]})]})})};k.getLayout=e=>(0,n.jsx)(m.Z,{children:e});var N=k},89687:function(e,t,a){"use strict";a.d(t,{PC:function(){return o},WK:function(){return i},jP:function(){return s},t:function(){return r}});let n=e=>"".concat("cjr-ide","-").concat(e),r=e=>{try{return localStorage.getItem(n(e))||""}catch(t){return console.error("Error loading code for language ".concat(e,":"),t),""}},o=(e,t)=>{try{localStorage.setItem(n(e),t)}catch(t){console.error("Error saving code for language ".concat(e,":"),t)}},s=e=>{try{localStorage.removeItem(n(e))}catch(t){console.error("Error deleting code for language ".concat(e,":"),t)}},i=e=>{try{let t=localStorage.getItem(n(e));return null!==t&&""!==t.trim()}catch(t){return console.error("Error checking code for language ".concat(e,":"),t),!1}}}},function(e){e.O(0,[1623,3598,1964,9332,4750,6768,5652,4136,2685,2333,3696,52,6133,1382,2888,9774,179],function(){return e(e.s=51459)}),_N_E=e.O()}]);

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.