MWInboxTrayNoteCreationDialogCreationStepContent.react",["fbt","CometRelay","Lexical","MAWSecureComposerText","MWInboxTrayNoteCreationDialogCreationStepContentMutation.graphql","MWInboxTrayNoteCreationDialogCreationStepContent_viewer.graphql","MWInboxTrayNotePopoverComposer.react","MWNoteBubbleWrapper.react","MWNoteContentBubbleWrapper.react","MWXButton.react","MWXCircleButton.react","MWXColumn.react","MWXColumnItem.react","MWXDialogHeader.react","MWXDialogPage.react","MWXIconMusic","MWXProfilePhoto.react","MWXText.react","MessengerNoteConsumptionClickImpressionEventsLoggerImpl","MessengerNoteCreationClickImpressionEventsLoggerImpl","StoriesGating","UnifiedShareSheetMessengerLexicalCreateEditor","isStringNullOrEmpty","react","react-compiler-runtime","uniqueID","useMWInboxTrayDeleteNote","useMWXConfirmationDialog","useMWXPushErrorToast","useUUID"],(function(a,b,c,d,e,f,g,h){"use strict";var i,j,k,l=k||(k=d("react"));e=k;var m=e.useEffect,n=e.useId,o=e.useMemo,p=e.useState,q=132,r=24*60*60,s=60,t=i!==void 0?i:i=b("MWInboxTrayNoteCreationDialogCreationStepContent_viewer.graphql");function u(a,e,f){var g=j!==void 0?j:j=b("MWInboxTrayNoteCreationDialogCreationStepContentMutation.graphql");g=d("CometRelay").useMutation(g);var i=g[0];g=g[1];var k=d("useUUID").useUUID(),n=p(""),q=n[0],t=n[1];n=p(!1);var u=n[0],v=n[1];n=o(function(){return{editor:c("UnifiedShareSheetMessengerLexicalCreateEditor")(),inputState:{__type:"lexical-editor-state-based"}}},[]);var w=n.editor;m(function(){return w.registerNodeTransform(d("Lexical").LineBreakNode,function(a){a.remove()})},[w]);m(function(){return w.registerUpdateListener(function(a){a=a.editorState;a=d("MAWSecureComposerText").getTextFromEditorState(a);t(a);v(!c("isStringNullOrEmpty")(a))})},[w]);var x=c("useMWXPushErrorToast")();n=function(){if(!u)return;i({onCompleted:function(){e()},onError:function(){x({title:h._(/*BTDS*/"We encountered an issue creating your note. Please try again later.")})},optimisticUpdater:function(a){var b=c("uniqueID")(),d=a.create(b,"MsgrUserRichStatus");d.setValue(b,"id");d.setValue(q,"description");(b=a.getRoot().getLinkedRecord("viewer"))==null?void 0:(a=b.getLinkedRecord("actor"))==null?void 0:a.setLinkedRecord(d,"msgr_user_rich_status");e()},updater:function(a){var b,c;b=(b=a.getRootField("xfb_rich_status_create"))==null?void 0:b.getLinkedRecord("status");c=(c=a.getRoot().getLinkedRecord("viewer"))==null?void 0:(c=c.getLinkedRecord("actor"))==null?void 0:c.getLinkedRecord("msgr_user_rich_status");if(b!=null){var d;d=(d=a.getRoot().getLinkedRecord("viewer"))==null?void 0:d.getLinkedRecord("actor");d!=null&&(d.setLinkedRecord(b,"msgr_user_rich_status"),d.setLinkedRecord(b,"active_lightweight_status"))}c!=null&&c.getValue("id")!==(b==null?void 0:b.getValue("id"))&&a["delete"](c.getDataID())},variables:{input:{description:q,duration:r,privacy:"PUBLIC",session_id:k}}});d("MessengerNoteCreationClickImpressionEventsLoggerImpl").logClickEvent({id:f,surface:{entry_point:"inbox_tray",major_surface:"note_creation_sheet",minor_surface:"note_creation_header"},targetType:"button"},"share_button")};return{composer:l.jsx(c("MWNoteBubbleWrapper.react"),{bubbleContent:l.jsx(c("MWInboxTrayNotePopoverComposer.react"),{editor:w,maxLength:s}),children:a}),content:q,createNote:n,hasStuffToSend:u,isCreatingNote:g}}function a(a){var b,e,f=d("react-compiler-runtime").c(38),g=a.onClose;a=a.viewer;a=d("CometRelay").useFragment(t,a);var i=a.actor;b=(b=i==null?void 0:(b=i.msgr_user_rich_status)==null?void 0:b.description)!=null?b:"";var j=i==null?void 0:(e=i.msgr_user_rich_status)==null?void 0:e.id;e=j!=null&&b!=="";b=(b=i==null?void 0:(b=i.profilePicture)==null?void 0:b.uri)!=null?b:"";var k=n(),m=p(!e),o=m[0],r=m[1];m=c("useMWInboxTrayDeleteNote")(g);var w=m.deleteNote;m=m.isDeletingNote;var x;f[0]!==b?(x={uri:b},f[0]=b,f[1]=x):x=f[1];f[2]!==k||f[3]!==x?(b=l.jsx(c("MWXProfilePhoto.react"),{"aria-labelledby":k,size:q,source:x}),f[2]=k,f[3]=x,f[4]=b):b=f[4];k=b;var y=c("useMWXConfirmationDialog")();f[5]!==(i==null?void 0:i.id)||f[6]!==w||f[7]!==j||f[8]!==y?(x=function(){j!=null&&y({body:h._(/*BTDS*/"Are you sure you want to delete this note?"),cancel:h._(/*BTDS*/"Cancel"),confirm:h._(/*BTDS*/"Delete"),title:h._(/*BTDS*/"Delete note")},function(){w(j),d("MessengerNoteConsumptionClickImpressionEventsLoggerImpl").logClickEvent({noteID:j,surface:{entry_point:"inbox_tray",major_surface:"combined_viewer",minor_surface:"combined_viewer_header"},targetType:"button",userID:i==null?void 0:i.id},"delete_button","user_note")})},f[5]=i==null?void 0:i.id,f[6]=w,f[7]=j,f[8]=y,f[9]=x):x=f[9];b=x;x=u(k,g,i==null?void 0:i.id);var z=x.composer,A=x.content,B=x.createNote,C=x.hasStuffToSend;x=x.isCreatingNote;A=s-A.length;var D;f[10]!==e?(D=e?h._(/*BTDS*/"My note"):h._(/*BTDS*/"New note"),f[10]=e,f[11]=D):D=f[11];e=D;f[12]!==g||f[13]!==e?(D=l.jsx(c("MWXDialogHeader.react"),{onClose:g,title:e,withBackButton:!1,withCloseButton:!0}),f[12]=g,f[13]=e,f[14]=D):D=f[14];f[15]===Symbol["for"]("react.memo_cache_sentinel")?(g={className:"x1t1ogtf x11408do"},f[15]=g):g=f[15];if(f[16]!==z||f[17]!==((e=a.actor)==null?void 0:e.msgr_user_rich_status)||f[18]!==o||f[19]!==k||f[20]!==A){g=l.jsx(c("MWXColumnItem.react"),{align:"center",children:l.jsx("div",babelHelpers["extends"]({},g,{children:o?l.jsxs(l.Fragment,{children:[z,l.jsx("div",babelHelpers["extends"]({className:"x78zum5 xl56j7k xw7yly9"},{"aria-label":h._(/*BTDS*/"Remaining characters:"),children:l.jsxs(c("MWXText.react"),{color:A<10?"negative":void 0,type:"meta3",children:[A,"/",s]})})),d("StoriesGating").shouldEnableNotesAdditionalEntrypoints()&&l.jsx("div",babelHelpers["extends"]({className:"x78zum5 xl56j7k xw7yly9"},{children:l.jsx(c("MWXCircleButton.react"),{color:"primary",icon:c("MWXIconMusic"),label:"Music creation button",onPress:v,size:36})}))]}):l.jsx(c("MWNoteContentBubbleWrapper.react"),{note:(e=a.actor)==null?void 0:e.msgr_user_rich_status,children:k})}))});f[16]=z;f[17]=(e=a.actor)==null?void 0:e.msgr_user_rich_status;f[18]=o;f[19]=k;f[20]=A;f[21]=g}else g=f[21];f[22]!==o?(z=l.jsx(c("MWXColumnItem.react"),{align:"center",paddingVertical:8,children:l.jsx(c("MWXText.react"),{type:"meta3",children:o?h._(/*BTDS*/"Share with Friends and connections for 24 hours."):h._(/*BTDS*/"Shared with Friends and connections for 24 hours.")})}),f[22]=o,f[23]=z):z=f[23];f[24]!==B||f[25]!==C||f[26]!==x||f[27]!==m||f[28]!==o||f[29]!==b?(a=l.jsx(c("MWXColumnItem.react"),{paddingTop:16,paddingVertical:4,children:o?l.jsx(c("MWXButton.react"),{disabled:!C||x,label:h._(/*BTDS*/"Share"),loading:x,onPress:B}):l.jsxs("div",babelHelpers["extends"]({className:"xfex06f x78zum5"},{children:[l.jsx(c("MWXButton.react"),{disabled:m,label:h._(/*BTDS*/"Delete note"),loading:m,onPress:b,type:"secondary"}),l.jsx(c("MWXButton.react"),{label:h._(/*BTDS*/"New note"),onPress:function(){return r(!0)}})]}))}),f[24]=B,f[25]=C,f[26]=x,f[27]=m,f[28]=o,f[29]=b,f[30]=a):a=f[30];f[31]!==g||f[32]!==z||f[33]!==a?(e=l.jsxs(c("MWXColumn.react"),{children:[g,z,a]}),f[31]=g,f[32]=z,f[33]=a,f[34]=e):e=f[34];f[35]!==e||f[36]!==D?(k=l.jsx(c("MWXDialogPage.react"),{footer:null,hasTextOnlyContent:!0,header:D,children:e}),f[35]=e,f[36]=D,f[37]=k):k=f[37];return k}function v(){}g["default"]=a}),226);
-----
MWInboxTrayNoteCreationDialogCreationStepContentMutation.graphql",["MWInboxTrayNoteCreationDialogCreationStepContentMutation_facebookRelayOperation"],(function(a,b,c,d,e,f){"use strict";a=function(){var a=[{defaultValue:null,kind:"LocalArgument",name:"input"}],c=[{alias:null,args:[{kind:"Variable",name:"data",variableName:"input"}],concreteType:"XFBRichStatusCreateResponsePayload",kind:"LinkedField",name:"xfb_rich_status_create",plural:!1,selections:[{alias:null,args:null,concreteType:"MsgrUserRichStatus",kind:"LinkedField",name:"status",plural:!1,selections:[{alias:null,args:null,kind:"ScalarField",name:"id",storageKey:null},{alias:null,args:null,kind:"ScalarField",name:"description",storageKey:null}],storageKey:null}],storageKey:null}];return{fragment:{argumentDefinitions:a,kind:"Fragment",metadata:null,name:"MWInboxTrayNoteCreationDialogCreationStepContentMutation",selections:c,type:"Mutation",abstractKey:null},kind:"Request",operation:{argumentDefinitions:a,kind:"Operation",name:"MWInboxTrayNoteCreationDialogCreationStepContentMutation",selections:c},params:{id:b("MWInboxTrayNoteCreationDialogCreationStepContentMutation_facebookRelayOperation"),metadata:{},name:"MWInboxTrayNoteCreationDialogCreationStepContentMutation",operationKind:"mutation",text:null}}}();e.exports=a}),null);
-----
MWInboxTrayNoteCreationDialogCreationStepContentMutation_facebookRelayOperation",[],(function(a,b,c,d,e,f){e.exports="9826567940731581"}),null);
-----