TPAGenericFBFormCreateFeedbackSourceMutation",["BizappsMutationUtils","TPAGenericFBFormCreateFeedbackSourceMutation.graphql"],(function(t,n,r,o,a,i,l){"use strict";var e,s=e!==void 0?e:e=n("TPAGenericFBFormCreateFeedbackSourceMutation.graphql");function u(){return o("BizappsMutationUtils").useCommitMutation(s)}l.useTPAGenericFBFormCreateFeedbackSourceMutation=u}),98);
-----
TPAGenericFBFormCreateFeedbackSourceMutation.graphql",[],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{alias:"create",args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"XFBTpaGenericFbFormFeedbackSourceCreateResponsePayload",kind:"LinkedField",name:"xfb_tpa_generic_fb_form_feedback_source_create",plural:!1,selections:[{alias:"newAttachmentFeedback",args:null,concreteType:"XFBPartnerAssessmentFBFormAttachmentAndFeedback",kind:"LinkedField",name:"attachment_and_feedback",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"TPAGenericFBFormCreateFeedbackSourceMutation",selections:t,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"TPAGenericFBFormCreateFeedbackSourceMutation",selections:t},params:{id:"25120055180930983",metadata:{},name:"TPAGenericFBFormCreateFeedbackSourceMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null);
-----
LegalComplianceCaseQuestionnaireFBFormQuestionFooter.react",["ix","$InternalEnum","BizappsMutationState","GeoDivider.react","GeoFlexbox.react","SRTPartnerAssessmentAttachmentsUtil","SRTPartnerAssessmentCircleButton.react","TPAGenericFBFormCreateFeedbackSourceMutation","TPAGenericQuestionnaireQuestionCommentThread.react","TPALegalComplianceCaseQuestionnaireGeneralContext","TPAQuestionnaireFBFormAttachmentsRenderer.react","TPAQuestionnaireFBFormCreateAttachmentMutation","fbicon","firstx","geoMargin","nullthrows","react","useBoolean","useFileInput"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=e||(e=o("react")),c=e,d=c.useCallback,m=c.useContext,p=c.useState,_=n("$InternalEnum").Mirrored(["CHAT","UPLOAD"]);function f(e){var t=e!=null?e:{},n=t.activity,r=t.attachmentAndFeedbackID,o=t.attachments;return{activityID:n==null?void 0:n.id,initialAttachmentAndFeedbackID:r,initialAttachments:o==null?void 0:o.nodes}}function g(e){var t=e.questionID,n=m(r("TPALegalComplianceCaseQuestionnaireGeneralContext")),a=n.attachmentQuestionData,i=n.instanceID,l=n.isReadOnly,c=f(a==null?void 0:a.get(t)),g=c.activityID,y=c.initialAttachmentAndFeedbackID,C=c.initialAttachments,b=r("useBoolean")(g!=null),v=b.toggle,S=b.value,R=p(y),L=R[0],E=R[1],k=p(C),I=k[0],T=k[1],D=o("TPAGenericFBFormCreateFeedbackSourceMutation").useTPAGenericFBFormCreateFeedbackSourceMutation(),x=D.commitMutation,$=D.mutationState,P=o("TPAQuestionnaireFBFormCreateAttachmentMutation").useTPAQuestionnaireFBFormCreateAttachmentMutation(),N=P.commitMutation,M=P.mutationState,w=p(),A=w[0],F=w[1],O=d(function(e,t){var n=r("firstx")(e);!o("SRTPartnerAssessmentAttachmentsUtil").PA_PERMITTED_FILE_TYPES.includes(n.type)||t==null||N({callbacks:{onCompleted:function(t){var e;T((e=t.xfb_partner_assessment_extern_create_attachment)==null||(e=e.attachment)==null||(e=e.partner_assessment_attachment_source)==null||(e=e.attachments)==null?void 0:e.nodes)}},uploadables:{file:n},variables:{input:{attachment_source_id:t,uploaded_files:["file"]}}})},[N]),B=d(function(e){var n=e!=null?e:{},r=n.onCompleted;x({callbacks:{onCompleted:r},variables:{input:{form_instance_id:i!=null?i:"",question_id:t!=null?t:""}}})},[x,i,t]),W=d(function(){if(L==null&&$!==r("BizappsMutationState").PENDING&&$!==r("BizappsMutationState").SUCCESS){F(_.CHAT),B({onCompleted:function(t){var e;E(r("nullthrows")((e=t.create)==null||(e=e.newAttachmentFeedback)==null?void 0:e.id)),v()}});return}v()},[L,B,$,v]),q=d(function(e){F(_.UPLOAD),L==null&&$!==r("BizappsMutationState").PENDING&&$!==r("BizappsMutationState").SUCCESS?B({onCompleted:function(n){var t;O(e,(t=n.create)==null||(t=t.newAttachmentFeedback)==null?void 0:t.id)}}):L!=null&&O(e,L)},[L,B,$,O]),U=r("useFileInput")(q,{accept:o("SRTPartnerAssessmentAttachmentsUtil").PA_PERMITTED_FILE_TYPES,allowMultiple:!0});return u.jsxs(r("GeoFlexbox.react"),{direction:"column",xstyle:h.root,children:[u.jsx(r("TPAQuestionnaireFBFormAttachmentsRenderer.react"),{attachmentAndFeedbackID:L,attachments:I!=null?I:[],submissionTime:0}),u.jsxs(r("GeoFlexbox.react"),{justifyContent:"end",children:[!l&&u.jsx(r("SRTPartnerAssessmentCircleButton.react"),{icon:o("fbicon")._(s("568446"),16),isBusy:M===r("BizappsMutationState").PENDING||A===_.UPLOAD&&$===r("BizappsMutationState").PENDING,onPress:U}),u.jsx(r("SRTPartnerAssessmentCircleButton.react"),{icon:o("fbicon")._(s("508553"),16),isBusy:A===_.CHAT&&$===r("BizappsMutationState").PENDING,xstyle:r("geoMargin").start12,onPress:W})]}),S&&u.jsxs(u.Fragment,{children:[u.jsx(r("GeoDivider.react"),{xstyle:r("geoMargin").top24}),L!=null&&u.jsx(r("TPAGenericQuestionnaireQuestionCommentThread.react"),{isReadOnly:l,sourceID:L,threadType:"TPA_LEGAL_COMPLIANCE_CASE_QUESTIONNAIRE"})]})]})}g.displayName=g.name+" [from "+i.id+"]";var h={root:{paddingTop:"x1p5oq8j",paddingInlineEnd:"x64bnmy",paddingBottom:"xwxc41k",paddingInlineStart:"x13jy36j",$$css:!0}};l.default=g}),98);
-----