"use strict";(globalThis.webpackChunkacadlix=globalThis.webpackChunkacadlix||[]).push([["admin_setting_general_advance_quiz_option"],{"./src/free/admin/setting/general/AdvanceQuizOption.js":(e,s,t)=>{t.r(s),t.d(s,{default:()=>g});var a=t("react"),i=t.n(a),n=t("./node_modules/@mui/material/esm/Grid/Grid.js"),l=t("./node_modules/@mui/material/esm/Autocomplete/Autocomplete.js"),r=t("./node_modules/@mui/material/esm/TextField/TextField.js"),o=t("./node_modules/@mui/material/esm/Button/Button.js"),d=t("./node_modules/@mui/material/esm/Paper/Paper.js"),u=t("./node_modules/@mui/material/esm/CircularProgress/CircularProgress.js"),m=t("./node_modules/react-hot-toast/dist/index.mjs"),p=t("@wordpress/i18n"),c=t("./src/requests/admin/AdminSettingRequest.js"),_=t("react/jsx-runtime");const g=e=>{const[s,t]=i().useState(""),a=(0,c.yE)();return(0,_.jsx)(n.A,{size:{xs:12,sm:6,lg:3},children:(0,_.jsx)(l.A,{size:"small",disabled:!0,options:e?.pages?.length>0?e?.pages:[],getOptionLabel:e=>`${e?.post_title} (#${e?.ID})`||"",isOptionEqualToValue:(e,s)=>e?.ID===s?.ID,renderInput:e=>(0,_.jsx)(r.A,{...e,label:(0,p.__)("Select Advance Quiz Page","acadlix"),inputProps:{...e.inputProps,autoComplete:"spoc_gender"},InputProps:{...e.InputProps,endAdornment:(0,_.jsxs)(i().Fragment,{children:[""!==s&&a?.isPending?(0,_.jsx)(u.A,{color:"inherit",size:20}):null,e.InputProps.endAdornment]})},onChange:e=>t(e.target.value)}),PaperComponent:t=>(0,_.jsxs)(d.A,{children:[t?.children,(0,_.jsxs)(o.A,{color:"primary",fullWidth:!0,sx:{justifyContent:"flex-start",pl:2},onMouseDown:t=>{""!==s?a?.mutate({title:s,user_id:acadlixOptions?.user_id},{onSuccess:s=>{e?.setPages(s?.data?.all_pages),e?.setValue("acadlix_advance_quiz_page_id",s?.data?.page_id,{shouldDirty:!0})}}):m.Ay.error((0,p.__)("Title cannot be empty.","acadlix"))},children:["+ ",(0,p.__)("Add New","acadlix")]})]})})})}}}]);