1import{a as x,j as e}from"./vendor-react-CIe7BBPp.js";import{v as h,w as g,x as y}from"./vendor-react-icons-QnPKxA--.js";import{a as C,A as I}from"./index-DuLZZD6P.js";import{c as S}from"./vendor-router-D97L2d81.js";import{C as c,b as m,R as P,S as k}from"./vendor-react-bootstrap-4fqcuWvZ.js";import"./vendor-react-dom-t5F7FhZR.js";import"./vendor-prop-types-DNxwfY3H.js";import"./vendor-js-cookie-Cz0CWeBA.js";import"./vendor-redux-LH1zpDpA.js";import"./vendor-use-sync-external-store-f1cvjnMh.js";import"./vendor-immer-Bp5DpiZ6.js";import"./vendor-redux-thunk-ClJT1hhx.js";import"./vendor-react-helmet-async-CO3viEpT.js";import"./vendor-react-fast-compare-Dxl0Zvcn.js";import"./vendor-invariant-CCbxWKZF.js";import"./vendor-shallowequal-Ck_j7EqP.js";import"./vendor-axios-D2K41pGA.js";import"./vendor-antd-DLTvu8QC.js";import"./vendor-clsx-B-dksMZM.js";import"./vendor-helpers-D6AZgMqr.js";import"./vendor-resize-observer-polyfill-pFR5zza0.js";import"./vendor-stylis-BmaM3nay.js";import"./vendor-scroll-into-view-if-needed-D5b_oRbX.js";import"./vendor-compute-scroll-into-view-Bl8rNFhg.js";import"./vendor-throttle-debounce-CUWDS_la.js";import"./vendor-json2mq-CN42t7xi.js";import"./vendor-string-convert-Bhuo--sE.js";import"./vendor-copy-to-clipboard-DxQUb0mb.js";import"./vendor-toggle-selection-DGa8lynz.js";import"./vendor-remix-run-router-D1FRce34.js";import"./vendor-react-lifecycles-compat-BQyd-nVo.js";import"./vendor-restart-ui-CZ6pMDW7.js";import"./vendor-dom-helpers-DY4L_g-8.js";import"./vendor-warning-CQQPl30N.js";import"./vendor-react-aria-ssr-C_EJWdyo.js";import"./vendor-restart-hooks-C7rFwvJj.js";import"./vendor-uncontrollable-BpozDFHz.js";import"./vendor-prop-types-extra-BShinCMI.js";import"./vendor-react-transition-group-GGXzq96r.js";const ue=()=>{const[p,_]=x.useState([]),[j,f]=x.useState(!1),[a,d]=x.useState("all"),b=S(),u=localStorage.getItem("user_id"),N=async()=>{var t,r;try{f(!0);const s=await C.post(I.CUSTOM_QBANK.GETCUSTOMQUIZLIST,{user_id:u,filter:a,page:1,limit:10}),i=((r=(t=s==null?void 0:s.data)==null?void 0:t.data)==null?void 0:r.list)||[];let o=i;a==="paused"&&(o=i.filter(n=>n.state==="1")),a==="completed"&&(o=i.filter(n=>n.state==="0")),_(o)}catch(s){globalThis.__APP_LOGGER__.log("API Error:",s)}finally{f(!1)}};x.useEffect(()=>{u&&N()},[a]);const w=t=>{if(!t)return;globalThis.__APP_LOGGER__.log(t);const r=t.quiz_id||t.id,s=t.quiz_attempt_id||t.attempt_id;globalThis.__APP_LOGGER__.log(s,"attemptId");const i={quizId:r,quizAttemptId:s,quizData:{data:{test_series_name:t.quiz_title,total_questions:t.no_of_question},total_questions:t.no_of_question}};if(t.state==="0"){b("/customleaderboard",{state:i});return}if(t.state==="1"){const o=window.screen.availWidth,n=window.screen.availHeight,v=`toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=${o},height=${n},top=0,left=0`;sessionStorage.setItem("customQuizData",JSON.stringify({quizId:r,quizAttemptId:s,navigationData:i,timestamp:Date.now()})),window.open(`/customquizquestionlist?quz=${r}`,"_blank",v)}};let l;return j?l=e.jsx(c,{className:"text-center mt-4",children:e.jsx(k,{animation:"border",variant:"primary"})}):p.length>0?l=p.map((t,r)=>e.jsx(c,{xs:12,children:e.jsx(m,{className:"quiz-item-card1 mb-3.75 rounded-xl! border border-[#ccc] bg-white px-3.25! py-2.5! max-[767px]:rounded-md! max-[767px]:p-2!",children:e.jsx("button",{className:"quiz-btn w-full! border-0! bg-transparent! p-0! text-left!",onClick:()=>w(t),children:e.jsxs("div",{className:"d-flex align-items-center",children:[e.jsx("div",{className:"quiz-icon-container1 mr-4! flex h-10 w-10 min-w-10 items-center justify-center rounded-xl bg-[#eef1f4] p-1!",children:e.jsx("img",{className:"h-8.75 w-8.75",src:t.image_icon||"https://cdn-icons-png.flaticon.com/512/2622/2622112.png",alt:"icon"})}),e.jsxs("div",{className:"grow",children:[e.jsx("h6",{className:"mb-1 fw-bold text-dark text-[15px]! max-[767px]:text-[12px]!",children:t.quiz_title}),e.jsxs("div",{className:"text-muted small text-[15px]! max-[767px]:text-[12px]!",children:["Created"," ",new Date(t.created_at).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})," ","⢠",t.no_of_question," MCQs"]})]}),e.jsx("div",{className:"ml-2!",children:t.state==="1"?e.jsxs("span",{className:"paused",children:[e.jsx(h,{})," Paused"]}):e.jsxs("span",{className:"completed1 flex items-center gap-1 text-[16px] text-[#28a745] max-[767px]:text-[12px]",children:[e.jsx(g,{className:"inline-block font-size-[20px]! fill-current stroke-current stroke-0 max-[767px]:font-size-[16px]!"})," ","Completed"]})})]})})})},t.id||r)):l=e.jsx(c,{className:"text-center mt-4",children:e.jsx("p",{className:"text-muted",children:"No Quiz Found"})}),e.jsx("div",{className:"tw-container",children:e.jsxs("div",{className:"my-12.5! min-h-auto! p-0! max-[767px]:my-7!",children:[e.jsx("h5",{className:"text-[18px]! mb-4! max-[767px]:text-[14px]! max-[767px]:mb-2!",children:"Custom Quiz"}),e.jsx("div",{className:"w-full flex align-items-center mb-4",children:e.jsxs("div",{className:"flex w-162.5 gap-2.5 max-[767px]:w-full max-[767px]:flex-wrap",children:[e.jsx("div",{className:"flex-[1_0_0]",children:e.jsx(m,{className:`curs
1or-pointer rounded-xl! p-2.5! text-center! shadow-[0_4px_10px_rgba(0,0,0,0.06)]! transition-all duration-300 ease-[ease] hover:border! hover:border-[#0d6efd]! max-[767px]:w-full! max-[767px]:rounded! max-[767px]:px-1! max-[767px]:py-2! ${a==="all"?"active-card1":""} ${a==="all"?"border! border-[#0d6efd]! bg-[#f0f8ff]!":""}`,onClick:()=>d("all"),children:e.jsxs("div",{className:" ml-0! flex! items-center! justify-center! gap-3! max-[767px]:gap-1.25!",children:[e.jsx("div",{className:"icon-box primary flex! h-8.75! w-8.75! items-center! justify-center! rounded-lg! bg-[#f8f9fa]! max-[767px]:h-3! max-[767px]:w-3! max-[767px]:rounded-none!",children:e.jsx(y,{})}),e.jsx("span",{className:"text-[15px]! max-[767px]:text-[12px]!",children:"All"})]})})}),e.jsx("div",{className:"flex-[1_0_0]",children:e.jsx(m,{className:`cursor-pointer rounded-xl! p-2.5! text-center! shadow-[0_4px_10px_rgba(0,0,0,0.06)]! transition-all duration-300 ease-[ease] hover:border! hover:border-[#0d6efd]! max-[767px]:w-full! max-[767px]:rounded! max-[767px]:px-1! max-[767px]:py-2! ${a==="completed"?"active-card1":""} ${a==="completed"?"border! border-[#0d6efd]! bg-[#f0f8ff]!":""}`,onClick:()=>d("completed"),children:e.jsxs("div",{className:"card-content ml-0! flex! items-center! justify-center! gap-3! max-[767px]:gap-1.25!",children:[e.jsx("div",{className:"icon-box success flex! h-8.75! w-8.75! items-center! justify-center! rounded-lg! bg-[#f8f9fa]! max-[767px]:h-3! max-[767px]:w-3! max-[767px]:rounded-none!",children:e.jsx(g,{})}),e.jsx("span",{className:"text-[15px]! max-[767px]:text-[12px]!",children:"Completed"})]})})}),e.jsx("div",{className:"flex-[1_0_0]",children:e.jsx(m,{className:`cursor-pointer rounded-xl! p-2.5! text-center! shadow-[0_4px_10px_rgba(0,0,0,0.06)]! transition-all duration-300 ease-[ease] hover:border! hover:border-[#0d6efd]! max-[767px]:w-full! max-[767px]:rounded! max-[767px]:px-1! max-[767px]:py-2! ${a==="paused"?"active-card":""} ${a==="paused"?"border! border-[#0d6efd]! bg-[#f0f8ff]!":""}`,onClick:()=>d("paused"),children:e.jsxs("div",{className:"card-content ml-0! flex! items-center! justify-center! gap-3! max-[767px]:gap-1.25!",children:[e.jsx("div",{className:"icon-box warning flex! h-8.75! w-8.75! items-center! justify-center! rounded-lg! bg-[#f8f9fa]! max-[767px]:h-3! max-[767px]:w-3! max-[767px]:rounded-none!",children:e.jsx(h,{})}),e.jsx("span",{className:"text-[15px]! max-[767px]:text-[12px]!",children:"Paused"})]})})})]})}),e.jsx(P,{className:"g-3",children:l})]})})};export{ue 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.