"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[8817],{338817:(e,i,t)=>{t.r(i),t.d(i,{default:()=>d});var a=t(296540),r=t(469733),s=t(951272),c=t(870443),n=t(691189),l=t(887831),u=t(857301);const o=(e,i,t="default")=>`${((e="default")=>`/v2/api/site/${e}`)(t)}/${(e=>{switch(e){case"ap":return"device";case"unifiClient":case"client":return"station";default:throw new Error("Invalid item type")}})(i)}/${e}/wifi_experience/incorrect`;var p=t(602021),E=t(561173);const d=({hideModal:e,item:i,experienceGraphType:t})=>{const d=(0,r.useDispatch)(),h={siteName:(0,r.useSelector)(p.LF),mac:"mac"in i?i.mac:void 0,experienceGraphType:t},m=c.A.object().shape({reason:c.A.string().label("COMMON_REPORT_WIFI_EXPERIENCE_MODAL_PROBLEM_LABEL").required(),comment:c.A.string().label("COMMON_REPORT_WIFI_EXPERIENCE_MODAL_COMMENT_FORMIK_LABEL")}),_=(0,a.useCallback)(async({mac:e,experienceGraphType:i,siteName:t,...a},r)=>{r.setStatus({isSuccess:void 0,isError:void 0}),r.setErrors(void 0);try{await d(((e,i,t,a,r,s)=>(0,n.vL)(u.$,null,o(e,i,t),a,r,{...s,method:l.A.POST}))(e,i,t,a)),r.setStatus({isSuccess:!0})}catch(e){r.setStatus({isError:!0})}},[]);return a.createElement(s.l1,{enableReinitialize:!0,onSubmit:_,initialValues:h,validationSchema:m},a.createElement(E.A,{hideModal:e,item:i,experienceGraphType:t}))}}}]);