useBizAIUpdateMsgrInstructionMutation",["CometRelay","useBizAIUpdateMsgrInstructionMutation.graphql"],(function(t,n,r,o,a,i,l){"use strict";var e,s=e!==void 0?e:e=n("useBizAIUpdateMsgrInstructionMutation.graphql");function u(){return o("CometRelay").useMutation(s)}l.default=u}),98);
-----
BizWebCometOmniAiAddUpdateInstruction.react",["fbt","BizInboxMessagingAIOnboardingSandboxConsts","BizWebCometOmniAiInstructionExamples.react","BizWebCometOmniAiInstructionsHeader.react","BizWebCometOmniAiInstructionsNavigationContext.react","GeoButton.react","GeoFlexbox.react","GeoHStack.react","GeoHeading.react","GeoSelector.react","GeoSelectorItem.react","GeoTextArea.react","GeoTextInput.react","GeoVStack.react","MessagingAIOnboardingFlowLoggingUtils","meta-brand-container-with-lid-outline-16","react","useBizAICreateMsgrInstructionMutation","useBizAIDeleteMsgrInstructionMutation","useBizAIUpdateMsgrInstructionMutation","useBizKitPageNullable","useBizWebCometOmniAIResetConversationAfterDataChange","useBizWebCometOmniAiDeleteToast.react","useBizWebCometOmniAiSaveToast.react"],(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.useState;function p(){var e,t,n,a,i,l,c,p,_,f=o("BizWebCometOmniAiInstructionsNavigationContext.react").useBizAIInstructionContext(),g=f.addInstructionParams,h=f.commonInstructions,y=f.instructionID,C=f.navigateToHome,b=y!=null,v=(g==null?void 0:g.instructionType)==="COLLECT_LEADS",S=m((e=g==null?void 0:g.instruction)!=null?e:""),R=S[0],L=S[1],E=m((t=g==null?void 0:g.title)!=null?t:""),k=E[0],I=E[1],T=m([]),D=T[0],x=T[1],$=m((n=g==null||(a=g.whenToCollectConfig)==null?void 0:a.when_type)!=null?n:v?"WHEN_CUSTOMER_SHOWS_INTEREST":null),P=$[0],N=$[1],M=m((i=g==null||(l=g.whenToCollectConfig)==null?void 0:l.custom_text)!=null?i:""),w=M[0],A=M[1],F=g==null?void 0:g.instructionType,O=h==null?void 0:h.find(function(e){return e.instruction_type===F}),B=(c=r("useBizKitPageNullable")())!=null?c:"",W=r("useBizAICreateMsgrInstructionMutation")(),q=W[0],U=W[1],V=r("useBizAIUpdateMsgrInstructionMutation")(),H=V[0],G=V[1],z=r("useBizAIDeleteMsgrInstructionMutation")(),j=z[0],K=z[1],Q=r("useBizWebCometOmniAiSaveToast.react")(),X=Q.addFailureToast,Y=Q.addSuccessToast,J=r("useBizWebCometOmniAiDeleteToast.react")(),Z=J.addFailureToast,ee=J.addSuccessToast,te=r("useBizWebCometOmniAIResetConversationAfterDataChange")(),ne=d(function(){te(o("BizInboxMessagingAIOnboardingSandboxConsts").SANDBOX_INSTRUCTION_CHANGE_MESSAGE.toString())},[te]),re=U||G||K,oe=v,ae=oe&&P==null,ie=re||R.trim()===""||ae,le=function(){y!=null&&j({onCompleted:function(){o("MessagingAIOnboardingFlowLoggingUtils").logEvents("instruction_delete_success",B,null,null,null,{customWhenToCollect:w,instruction:R,instructionID:y,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),ee(),ne(),C()},onError:function(t){o("MessagingAIOnboardingFlowLoggingUtils").logExceptions("instruction_delete_exception",B,null,null,null,t,{customWhenToCollect:w,instruction:R,instructionID:y,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),Z()},variables:{input:{instruction_id:y,page_id:B}}})},se=function(){if(R.trim()!==""){var e=F!=null?F:"USER_CREATED_V2",t=P!=null?{custom_text:P==="CUSTOM"?w:null,when_type:P}:null;y!=null?H({onCompleted:function(){o("MessagingAIOnboardingFlowLoggingUtils").logEvents("instruction_update_success",B,null,null,null,{customWhenToCollect:w,instruction:R,instructionID:y,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),Y(),ne(),C()},onError:function(t){o("MessagingAIOnboardingFlowLoggingUtils").logExceptions("instruction_update_exception",B,null,null,null,t,{customWhenToCollect:w,instruction:R,instructionID:y,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),X()},variables:{input:{instruction_id:y,new_config:t,new_content:R,new_title:k.trim()!==""?k:null,page_id:B}}}):q({onCompleted:function(){o("MessagingAIOnboardingFlowLoggingUtils").logEvents("instruction_create_success",B,null,null,null,{customWhenToCollect:w,instruction:R,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),Y(),ne(),C()},onError:function(t){o("MessagingAIOnboardingFlowLoggingUtils").logExceptions("instruction_create_exception",B,null,null,null,t,{customWhenToCollect:w,instruction:R,instructionType:F!=null?F:"USER_CREATED_V2",title:k,whenToCollect:P!=null?P:""}),X()},variables:{input:{config:t,content:R,instruction_source:e,page_id:B,title:k.trim()!==""?k:R.substring(0,150)}}})}},ue=(p=g==null?void 0:g.examples)!=null?p:[],ce=ue.filter(function(e){return!D.includes(e)}),de=function(t){x(function(e){return[].concat(e,[t])}),L(function(e){return e.trim()===""?t:e+" "+t})},me=b?u.jsx(r("GeoFlexbox.react"),{children:u.jsxs(r("GeoHStack.react"),{context:"component",relation:"related",children:[u.jsx(r("GeoButton.react"),{icon:o("meta-brand-container-with-lid-outline-16").metaBrandContainerWithLidTrashOutline16,isDisabled:re,isLoading:K,label:s._(/*BTDS*/"Delete"),onClick:le}),u.jsx(r("GeoButton.react"),{isDisabled:ie,isLoading:U||G,label:s._(/*BTDS*/"Save"),onClick:se,variant:"primary"})]})}):u.jsx(r("GeoButton.react"),{isDisabled:ie,isLoading:re,label:s._(/*BTDS*/"Save"),onClick:se,variant:"primary"}),pe=(O==null?void 0:O.title)!=null?O.title:s._(/*BTDS*/"Custom instructions"),_e=(O==null?void 0:O.description)!=null?O.description:s._(/*BTDS*/"Describe how your AI should handle a customer scenario."),fe=s._(/*BTDS*/"Do not ask for data that is legally protected or sensitive personal information like passwords."),ge=F==="COLLECT_LEADS"||F==="COMPLETE_AN_ORDER"||F==="USER_CREATED_V2"||F==="CUSTOMIZE_AN_ORDER";return u.jsxs(r("GeoVStack.react"),{context:"content",relation:"section",children:[u.jsx(r("BizWebCometOmniAiInstructionsHeader.react"),{button:me,hasTwoButtons:b,shouldShowBackButton:!0,subtitle:_e,subtitleTooltip:ge?fe:null,title:pe}),b&&u.jsxs(u.Fragment,{children:[u.jsx(r("GeoHeading.react"),{level:4,children:s._(/*BTDS*/"Title")}),u.jsx(r("GeoTextInput.react"),{isLabelHidden:!0,label:"",onChange:I,placeholder:s._(/*BTDS*/"Ask for location before sending pricing info"),value:k})]}),u.jsx(r("GeoHeading.react"),{level:4,children:F==="COLLECT_LEADS"?s._(/*BTDS*/"What to collect"):s._(/*BTDS*/"Instructions")}),ce.length>0&&u.jsx(r("BizWebCometOmniAiInstructionExamples.react"),{examples:ce,onAddExample:de}),u.jsx(r("GeoTextArea.react"),{isLabelHidden:!0,label:"",onChange:L,placeholder:(_=g==null?void 0:g.placeholder)!=null?_:s._(/*BTDS*/"For example, "When a customer asks about prices, ask them for their location before sending price info.""),rows:10,value:R}),oe&&u.jsxs(r("GeoVStack.react"),{children:[u.jsx(r("GeoHeading.react"),{level:4,children:s._(/*BTDS*/"When to collect")}),u.jsxs(r("GeoFlexbox.react"),{direction:"row",gap:8,children:[u.jsx(r("GeoFlexbox.react"),{grow:1,style:{maxWidth:"40%"},children:u.jsxs(r("GeoSelector.react"),{isLabelHidden:!0,label:"",onChange:N,value:P,children:[u.jsx(r("GeoSelectorItem.react"),{label:s._(/*BTDS*/"When customer shows interest"),value:"WHEN_CUSTOMER_SHOWS_INTEREST"}),u.jsx(r("GeoSelectorItem.react"),{label:s._(/*BTDS*/"After initial greeting"),value:"AFTER_INITIAL_GREETING"}),u.jsx(r("GeoSelectorItem.react"),{label:s._(/*BTDS*/"Add custom"),value:"CUSTOM"})]})}),u.jsx(r("GeoFlexbox.react"),{grow:2,children:P==="CUSTOM"&&u.jsx(r("GeoTextInput.react"),{isLabelHidden:!0,label:s._(/*BTDS*/"Add custom"),onChange:A,placeholder:s._(/*BTDS*/"When your AI should collect info"),value:w})})]})]})]})}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),226);
-----
useBizAIUpdateMsgrInstructionMutation.graphql",["useBizAIUpdateMsgrInstructionMutation_facebookRelayOperation"],(function(t,n,r,o,a,i){"use strict";var e=(function(){var e=[{defaultValue:null,kind:"LocalArgument",name:"input"}],t=[{kind:"Variable",name:"input",variableName:"input"}],r={alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null};return{fragment:{argumentDefinitions:e,kind:"Fragment",metadata:null,name:"useBizAIUpdateMsgrInstructionMutation",selections:[{alias:null,args:t,concreteType:"XFBBizAIUpdateMsgrInstructionResponse",kind:"LinkedField",name:"xfb_biz_ai_update_msgr_instruction",plural:!1,selections:[{alias:null,args:null,concreteType:"Page",kind:"LinkedField",name:"page",plural:!1,selections:[r,{alias:null,args:null,concreteType:"BizAISMBData",kind:"LinkedField",name:"biz_ai_smb_data",plural:!1,selections:[{args:null,kind:"FragmentSpread",name:"BizWebCometOmniAiInstructionsSection_bizAISMBData"}],storageKey:null}],storageKey:null}],storageKey:null}],type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:e,kind:"Operation",name:"useBizAIUpdateMsgrInstructionMutation",selections:[{alias:null,args:t,concreteType:"XFBBizAIUpdateMsgrInstructionResponse",kind:"LinkedField",name:"xfb_biz_ai_update_msgr_instruction",plural:!1,selections:[{alias:null,args:null,concreteType:"Page",kind:"LinkedField",name:"page",plural:!1,selections:[r,{alias:null,args:null,concreteType:"BizAISMBData",kind:"LinkedField",name:"biz_ai_smb_data",plural:!1,selections:[{alias:null,args:null,concreteType:"BizAISMBDataInstructionsConnection",kind:"LinkedField",name:"instructions",plural:!1,selections:[{alias:null,args:null,concreteType:"XFBBusinessAIAgentMsgrInstruction",kind:"LinkedField",name:"nodes",plural:!0,selections:[r,{alias:null,args:null,kind:"ScalarField",name:"title",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"instruction",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"instruction_source",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"last_update_time",storageKey:null},{alias:null,args:null,concreteType:"XFBBizAIInstructionConfigShape",kind:"LinkedField",name:"when_to_collect_config",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"when_type",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"custom_text",storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}],storageKey:null}]},params:{id:n("useBizAIUpdateMsgrInstructionMutation_facebookRelayOperation"),metadata:{},name:"useBizAIUpdateMsgrInstructionMutation",operationKind:"mutation",text:null}}})();a.exports=e}),null);
-----
useBizAIUpdateMsgrInstructionMutation_facebookRelayOperation",[],(function(t,n,r,o,a,i){a.exports="33916611547929619"}),null);
-----