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,iBAAgBD,UAC7BF,EAAAA,EAAAA,KAACe,EAAAA,EAAU,CACTT,OAAO,sBACPC,UAAU,gCACVC,cAAc,oCACdC,gBAAgB,sCAChBO,eAjCcC,KACxBlG,IAAgBD,GAAY,EAiClB8F,cAAepD,GACfkD,OAAoB,OAAZ1E,SAAY,IAAZA,IAA0B,QAAdpE,EAAZoE,GAAc+B,oBAAY,IAAAnG,OAAd,EAAZA,EAA6B,GACrCqG,KAAK,KACL4C,QAASjE,GACTsE,cAAe/D,GACfR,eAAgB/B,GAChBuG,cAAejH,EACf4C,cAAeA,GACfsE,cAAe/D,GACf3E,YAAaA,EACb2I,aAlKaC,IAAe,IAADC,EACrClH,EAAoB,gBACpB,MAAM0F,EAAU,CACd,WAAcuB,EACd,gBAAmBxD,UAAqB,OAAZ9B,SAAY,IAAZA,IAA6B,QAAjBuF,EAAZvF,GAAc+B,aAAa,UAAE,IAAAwD,OAAjB,EAAZA,EAA+BvD,kBAAmB,KAC9E,kBAAqB5C,GAErB,KAAQ,KACR,YAAe,WAGjBb,EAAiBwF,GACjB9C,GAAoB8C,EAAQ,EAuJlB/F,qBAAsBA,EACtBI,iBAAkBA,EAClBC,oBAAqBA,EACrBmH,eAAgB1H,EAChB2H,oBAAqB/H,EACrBgI,uBAAwB/H,EACxBgI,qBAAuB/H,EACvBhB,oBAAqBA,EACrBC,uBAAwBA,EACxB+I,wBAAyB/H,EACzBiH,SAAS,kBAKhB,C","sources":["pages/public/embed/prompt.tsx"],"sourcesContent":["import { useState, useEffect } from \"react\";\r\nimport { usePublicPromptDetailsMutation } from \"../../../api-integration/public/common\";\r\nimport { useDispatch, useSelector } from \"react-redux\";\r\nimport { useParams } from \"react-router-dom\";\r\nimport PromptExecution from \"../../../components/public/common/prompt-execution/prompt-execution\";\r\nimport AiResponse from \"../../../components/secure/create-prompts/ai-response/ai-response\";\r\nimport { usePublicAskGPTMutation, usePublicAskGPTRefineResultMutation } from \"../../../api-integration/secure/prompts\";\r\nimport { fullPageLoader, updateAlertMessage, updateIsSessionExpired, updateReloadPageAfterSessionExpired, updateUser } from \"../../../api-integration/commonSlice\";\r\nimport { getTranslatedText } from \"../../../util/util\";\r\nimport usePageTranslation from \"../../../hooks/usePageTranslation\";\r\n\r\n\r\nconst EmbedPrompt = () => {\r\n  const PageTranslation = usePageTranslation();\r\n  const params = useParams();\r\n  const dispatch = useDispatch();\r\n  const [iterativeFormDisplayClass, setIterativeFormDisplayClass] = useState<string>('d-none')\r\n  const [defaultAction, serDefaultAction] = useState<string>('')\r\n  const [projectName, setProjectName] = useState<string>('')\r\n  const [isIterative, setIsIterative] = useState<boolean>(false)\r\n  const [isIterativeFinished, setIsIterativeFinished] = useState<boolean>(false)\r\n  const [gptResponseText, setGptReponseText] = useState<string>('')\r\n  const [promptId, setPromptId] = useState<any>();\r\n  const [firstPromptId, setFirstPromptId] = useState<any>(promptId);\r\n  const [propsResultLoading, setPropsResultLoading] = useState(false);\r\n  const [searchAgain, setSearchAgain] = useState(false);\r\n  const [projectId, setProjectId] = useState();\r\n  const [showChildResponseSection, setShowChildResponseSection] = useState(true);\r\n  const [showChildSurveySuccessMsg, setShowChildSurveySuccessMsg] = useState(false);\r\n  const [childConstSurveyPrompt, setChildConstSurveyPrompt] = useState(false);\r\n  const [isLibraryTypeChanged, setIsLibraryTypeChanged] = useState(false);\r\n  //const { user, LibraryType } = useSelector((state: any) => state.commonSlice);\r\n  const [refineResposne, setRefineResposne] = useState();\r\n  const [userPromptAction, setUserPromptAction] = useState('');\r\n  const [refinePayload, setRefinePayload] = useState<any>({});\r\n  const [askGptPayload, setAskGptPayload] = useState<any>({});\r\n  const [widerLayout, setWiderLayout] = useState(true);\r\n  const [aiResponse, setAIResponse] = useState<any>({});\r\n  const [reloadCheck,setReloadCheck] = useState(false);\r\n  const [reloadPromptList,setReloadPromptList] = useState(false);\r\n  const [loginUrl, setLoginUrl] = useState<string>('');\r\n  const [userFirstPromptId, setUserFirstPromptId] = useState<any>({});\r\n  //const [accountTypeForCCDeduction, setAccountTypeForCCDeduction] = useState<any>(LibraryType == 'org' ? 'corp' : 'user')\r\n  const [functionToCallAfterRefresh, setFunctionToCallAfterRefresh] = useState<any>('')\r\n  const [localpromptExeAlert, setLocalpromptExeAlert] = useState<number>(0);\r\n  const isSessionExpired = useSelector((state: any) => state.commonSlice.isSessionExpired);\r\n\r\n  const [getPromptsAPI, { data: singlePrompt, isLoading: isLoadingSinglePrompt, isSuccess: isSucccessSinglePrompt, isError: isErrorSinglePrompt, error: errorSinglePrompt }] =\r\n    usePublicPromptDetailsMutation();\r\n\r\n  const [askGPTAPI, { data: askGPTResponse, isLoading: isAskGPTLoading, isSuccess: isAskGPTSuccess, isError: isAskGPTError, error: askGPTError }] =\r\n    usePublicAskGPTMutation();\r\n\r\n  const [refineResultsGPTAPI, { data: refineResulsResponse, isLoading: refineResulsLoading, isSuccess: refineResulsSuccess, isError: isRefineResulsError, error: refineResulsError }] =\r\n    usePublicAskGPTRefineResultMutation();\r\n\r\n  const askGPTBlue = (data: any) => {\r\n    setShowChildResponseSection(true);\r\n    setShowChildSurveySuccessMsg(false);\r\n    setUserPromptAction('localTest');\r\n    setIsIterativeFinished(false);\r\n    setLocalpromptExeAlert(data?.promptExeAlert);\r\n    setAIResponse('');\r\n    setRefineResposne(undefined);\r\n    setAskGptPayload({\r\n      GPTBluePromptId: parseInt(singlePrompt?.promptDetail[0]?.GPTBLUEPROMPTID || '0'),\r\n      //accountType: accountTypeForCCDeduction,\r\n      page: \"io\",\r\n      ...data\r\n    })\r\n    askGPTAPI({\r\n      GPTBluePromptId: parseInt(singlePrompt?.promptDetail[0]?.GPTBLUEPROMPTID || '0'),\r\n      //accountType: accountTypeForCCDeduction, \r\n      page: \"io\",\r\n      ...data\r\n    })\r\n  }\r\n  const handleLibraryTypeChange = () => {\r\n    setIsLibraryTypeChanged(false);\r\n  };\r\n\r\n  const refineResultAPI = (html: any) => {\r\n    setUserPromptAction('refineResult');\r\n    const payload = {\r\n      \"userPrompt\": html,\r\n      \"GPTBluePromptId\": parseInt(singlePrompt?.promptDetail[0]?.GPTBLUEPROMPTID || '0'),\r\n      \"userFirstPromptId\": userFirstPromptId,\r\n      //\"accountType\": accountTypeForCCDeduction,\r\n      \"page\": \"io\",\r\n      \"requestMode\": \"execute\"\r\n      //\"libraryType\": \"\",\r\n    }\r\n    setRefinePayload(payload);\r\n    refineResultsGPTAPI(payload);\r\n  }\r\n\r\n  useEffect(() => {\r\n    if (isSucccessSinglePrompt || isErrorSinglePrompt) {\r\n      dispatch(fullPageLoader(false));\r\n    }\r\n    if (isErrorSinglePrompt) {\r\n      dispatch(updateAlertMessage({ status: 'error', message: getTranslatedText('promptFetchingError.message',PageTranslation) }));\r\n    }\r\n    if (isSucccessSinglePrompt) {\r\n      //send form data to patch\r\n      if (singlePrompt?.success == true) {\r\n        setLoginUrl(`/referral/${singlePrompt?.promptDetail?.[0]['OWNERREFERRALID']}` || '');\r\n        setIsIterative(singlePrompt?.promptDetail?.[0]['ITERATIVETASK'] == 'yes' ? true : false)\r\n        setProjectName(singlePrompt?.promptDetail?.[0]['PROMPTNAME'])\r\n        serDefaultAction(singlePrompt?.promptDetail?.[0]['DEFAULTACTION'])\r\n        setPromptId(singlePrompt?.promptDetail?.[0]?.GPTBLUEPROMPTID);\r\n        setProjectId(singlePrompt?.promptDetail?.[0]?.GPTBLUEPROMPTID);\r\n        setChildConstSurveyPrompt(singlePrompt?.promptDetail?.[0]?.SURVEYPROMPT == 1 ? true : false)\r\n      } else {\r\n        dispatch(updateAlertMessage({ status: 'error', message: singlePrompt?.message }));\r\n      }\r\n    }\r\n  }, [isSucccessSinglePrompt, isErrorSinglePrompt, isLoadingSinglePrompt]);\r\n\r\n  useEffect(() => {\r\n    if (askGPTResponse || refineResulsResponse) {\r\n      dispatch(fullPageLoader(false));\r\n      if (askGPTResponse) {\r\n        if (askGPTResponse?.success == false && askGPTResponse?.statusCode != 401) {\r\n          if (askGPTResponse?.status == 'FETCH_ERROR' || askGPTResponse?.status == 'PARSING_ERROR') {\r\n            dispatch(updateAlertMessage({ status: 'error', message: getTranslatedText('serverAccess.failure.message',PageTranslation) }));\r\n          } else {\r\n            dispatch(updateAlertMessage({ status: 'error', message: askGPTResponse?.message }));\r\n          }\r\n        } else {\r\n          setAIResponse(askGPTResponse);\r\n          setUserFirstPromptId(askGPTResponse?.userPromptId);\r\n          setReloadCheck(true);\r\n          let user = JSON.parse(localStorage.getItem('user') as string);\r\n          if (user) {\r\n            user.promptExeAlert = localpromptExeAlert;\r\n            dispatch(updateUser(user));\r\n            localStorage.setItem('user', JSON.stringify(user));\r\n          }\r\n        }\r\n      }\r\n      // if (askGPTResponse?.statusCode == 401) {\r\n      //   dispatch(updateIsSessionExpired(true));\r\n      //   dispatch(updateReloadPageAfterSessionExpired(false));\r\n      //   setFunctionToCallAfterRefresh('askgpt');\r\n      // }\r\n      if (refineResulsResponse) {\r\n        if (refineResulsResponse?.success == false && refineResulsResponse?.statusCode != 401) {\r\n          if (refineResulsResponse?.status == 'FETCH_ERROR' || refineResulsResponse?.status == 'PARSING_ERROR') {\r\n            dispatch(updateAlertMessage({ status: 'error', message: getTranslatedText('serverAccess.failure.message',PageTranslation) }));\r\n          } else {\r\n            dispatch(updateAlertMessage({ status: 'error', message: refineResulsResponse?.message }));\r\n          }\r\n        } else {\r\n          setRefineResposne(refineResulsResponse);\r\n          setAIResponse(refineResulsResponse);\r\n          setReloadCheck(true);\r\n        }\r\n      }\r\n      // if (refineResulsResponse?.statusCode == 401) {\r\n      //   dispatch(updateIsSessionExpired(true));\r\n      //   dispatch(updateReloadPageAfterSessionExpired(false));\r\n      //   setFunctionToCallAfterRefresh('refine');\r\n      // }\r\n    }\r\n  }, [askGPTResponse, refineResulsResponse])\r\n\r\n  useEffect(() => {\r\n    if (params?.id) {\r\n      const payload = { \"promptPublicCode\": params?.id, \"page\": \"io\"}\r\n      dispatch(fullPageLoader(true));\r\n      getPromptsAPI(payload);\r\n      setAIResponse(false);\r\n    }\r\n  }, [params?.id])\r\n\r\n  useEffect(() => {\r\n    if (isSessionExpired == false && functionToCallAfterRefresh != '') {\r\n      if (functionToCallAfterRefresh == 'refine') refineResultsGPTAPI(refinePayload)\r\n      if (functionToCallAfterRefresh == 'askgpt') askGPTAPI(askGptPayload)\r\n\r\n    }\r\n  }, [isSessionExpired])\r\n\r\n  const onSubmit = (data: string) => {\r\n    setGptReponseText(data);\r\n    setIterativeFormDisplayClass('')\r\n  };\r\n\r\n  const handleSubmit = (data: string) => {\r\n    setPromptId(data);\r\n    setFirstPromptId(data);\r\n    // setIterativeFormDisplayClass('')\r\n  };\r\n\r\n  const isLoadingResult = (data: boolean) => {\r\n    setPropsResultLoading(data);\r\n  }\r\n\r\n  const handleReloadCheck = ()=>{\r\n    setReloadCheck(!reloadCheck)\r\n  }\r\n  const handleWiderLayout = (data: boolean) => {\r\n    setWiderLayout(data);\r\n  }\r\n\r\n  return (\r\n    <>\r\n      <div className=\"container\">\r\n        <div className=\"row\">\r\n          <div className=\"bc-column-12\">\r\n            <PromptExecution\r\n              cardId=\"askgpt_promptExecution\"\r\n              cardTitle=\"askgptPromptExecution.card.title\"\r\n              cardHelpTitle=\"askgptPromptExecution.cardHelp.title\"\r\n              cardHelpContent=\"askgptPromptExecution.cardHelp.content\" \r\n              prompt={singlePrompt?.promptDetail?.[0]} \r\n              askGptResponse={aiResponse} \r\n              TriggerAskGpt={askGPTBlue} \r\n              loading={isAskGPTLoading || refineResulsLoading} \r\n              isLibraryTypeChanged={isLibraryTypeChanged}\r\n              setWiderLayout={handleWiderLayout}\r\n              setReloadPromptList={setReloadPromptList}\r\n              pageType=\"embed\"\r\n            />\r\n          </div>\r\n          <div className=\"col-md-12 mb-3\">\r\n            <AiResponse \r\n              cardId=\"askgpt_promptResult\"\r\n              cardTitle=\"askgptPromptResult.card.title\"\r\n              cardHelpTitle=\"askgptPromptResult.cardHelp.title\"\r\n              cardHelpContent=\"askgptPromptResult.cardHelp.content\" \r\n              onRatingPrompt={handleReloadCheck} \r\n              TriggerAskGpt={askGPTBlue} \r\n              prompt={singlePrompt?.promptDetail?.[0]} \r\n              page=\"io\" \r\n              loading={isAskGPTLoading} \r\n              refineLoading={refineResulsLoading} \r\n              askGPTResponse={aiResponse} \r\n              refineResults={refineResposne} \r\n              isAskGPTError={isAskGPTError} \r\n              isRefineError={isRefineResulsError} \r\n              isIterative={isIterative} \r\n              refineResult={refineResultAPI} \r\n              isLibraryTypeChanged={isLibraryTypeChanged}\r\n              userPromptAction={userPromptAction}\r\n              setUserPromptAction={setUserPromptAction} \r\n              isSurveyPrompt={childConstSurveyPrompt}\r\n              showResponseSection={showChildResponseSection}\r\n              setShowResponseSection={setShowChildResponseSection}\r\n              showSurveySuccessMsg ={showChildSurveySuccessMsg}\r\n              isIterativeFinished={isIterativeFinished}\r\n              setIsIterativeFinished={setIsIterativeFinished}\r\n              setShowSurveySuccessMsg={setShowChildSurveySuccessMsg}\r\n              pageType=\"embed\"\r\n            />\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </>\r\n  )\r\n}\r\n\r\nexport default EmbedPrompt;"],"names":["EmbedPrompt","_singlePrompt$promptD14","_singlePrompt$promptD15","PageTranslation","usePageTranslation","params","useParams","dispatch","useDispatch","iterativeFormDisplayClass","setIterativeFormDisplayClass","useState","defaultAction","serDefaultAction","projectName","setProjectName","isIterative","setIsIterative","isIterativeFinished","setIsIterativeFinished","gptResponseText","setGptReponseText","promptId","setPromptId","firstPromptId","setFirstPromptId","propsResultLoading","setPropsResultLoading","searchAgain","setSearchAgain","projectId","setProjectId","showChildResponseSection","setShowChildResponseSection","showChildSurveySuccessMsg","setShowChildSurveySuccessMsg","childConstSurveyPrompt","setChildConstSurveyPrompt","isLibraryTypeChanged","setIsLibraryTypeChanged","refineResposne","setRefineResposne","userPromptAction","setUserPromptAction","refinePayload","setRefinePayload","askGptPayload","setAskGptPayload","widerLayout","setWiderLayout","aiResponse","setAIResponse","reloadCheck","setReloadCheck","reloadPromptList","setReloadPromptList","loginUrl","setLoginUrl","userFirstPromptId","setUserFirstPromptId","functionToCallAfterRefresh","setFunctionToCallAfterRefresh","localpromptExeAlert","setLocalpromptExeAlert","isSessionExpired","useSelector","state","commonSlice","getPromptsAPI","data","singlePrompt","isLoading","isLoadingSinglePrompt","isSuccess","isSucccessSinglePrompt","isError","isErrorSinglePrompt","error","errorSinglePrompt","usePublicPromptDetailsMutation","askGPTAPI","askGPTResponse","isAskGPTLoading","isAskGPTSuccess","isAskGPTError","askGPTError","usePublicAskGPTMutation","refineResultsGPTAPI","refineResulsResponse","refineResulsLoading","refineResulsSuccess","isRefineResulsError","refineResulsError","usePublicAskGPTRefineResultMutation","askGPTBlue","_singlePrompt$promptD","_singlePrompt$promptD2","promptExeAlert","undefined","GPTBluePromptId","parseInt","promptDetail","GPTBLUEPROMPTID","page","useEffect","_singlePrompt$promptD4","_singlePrompt$promptD5","_singlePrompt$promptD6","_singlePrompt$promptD7","_singlePrompt$promptD8","_singlePrompt$promptD9","_singlePrompt$promptD10","_singlePrompt$promptD11","_singlePrompt$promptD12","_singlePrompt$promptD13","fullPageLoader","updateAlertMessage","status","message","getTranslatedText","success","SURVEYPROMPT","statusCode","userPromptId","user","JSON","parse","localStorage","getItem","updateUser","setItem","stringify","id","payload","_jsx","_Fragment","children","className","_jsxs","PromptExecution","cardId","cardTitle","cardHelpTitle","cardHelpContent","prompt","askGptResponse","TriggerAskGpt","loading","pageType","AiResponse","onRatingPrompt","handleReloadCheck","refineLoading","refineResults","isRefineError","refineResult","html","_singlePrompt$promptD3","isSurveyPrompt","showResponseSection","setShowResponseSection","showSurveySuccessMsg","setShowSurveySuccessMsg"],"sourceRoot":""}