;/*FB_PKG_DELIM*/ __d("WAWebSingleCallDropdownContent.react",["fbt","WAWebActionMenuItem.react","WAWebAddUserIcon.react","WAWebCalendarFilledRefreshedIcon.react","WAWebCallCollection","WAWebCallDropdownMenuItems.react","WAWebContactImage.react","WAWebEnvironment","WAWebFlex.react","WAWebFrontendChatGetters","WAWebFrontendContactGetters","WAWebLinkRefreshedIcon.react","WAWebModalManager","WAWebText.react","WAWebUISpacing","WAWebUserSubtitle.react","WAWebVoipCallsTabScheduleCallModal.react","WAWebVoipCreateCallLinksPopupLoadable.react","WAWebVoipNewGroupCallContactPicker.react","WAWebWamEnumSubSurface","WDSIconIcCallFilled.react","WDSIconIcVideocamFilled.react","react"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c=u||(u=r("react")),d=(e||(e=o("react"))).useEffect,m={dropdownContainer:{width:"xj6ak53",overflowX:"x6ikm8r",overflowY:"x10wlt62",$$css:!0},contactTextContainer:{minWidth:"xeuugli",overflowX:"x6ikm8r",overflowY:"x10wlt62",$$css:!0},callButtonsRow:{width:"xh8yej3",rowGap:"x1qvou4u",columnGap:"x1s70e7g",marginTop:"x1380le5",marginBottom:"xat24cr",$$css:!0},callButtonWrapper:{flex:"x1cqoux5",minWidth:"xeuugli",$$css:!0},callButtonMenuItemIcon:{color:"x1pse0pq",height:"xxk0z11",width:"xvy4d1p",$$css:!0},actionsContainer:{width:"xh8yej3",$$css:!0},actionItemIcon:{color:"xhslqc4",$$css:!0}};function p(e){var t,n=e.chat,a=e.enableWebGroupCalling,i=e.handleCall,l=e.isCallingDisabled,u=e.logger,p=e.onActionTaken,_=e.onClose,f=n.contact,g=o("WAWebFrontendContactGetters").getFormattedUser(f),h=o("WAWebFrontendChatGetters").getPresence(n);return d(function(){var e=r("WAWebCallCollection").activeCall;e!=null&&e.shouldShowPostCallSurvey===!0&&r("WAWebCallCollection").setActiveCall(null),u.clickCallDropdown(o("WAWebWamEnumSubSurface").SUB_SURFACE.CHAT_HEADER)},[u]),c.jsxs((t=o("WAWebFlex.react")).FlexColumn,{xstyle:[o("WAWebUISpacing").uiPadding.all8,m.dropdownContainer],grow:1,gap:8,children:[c.jsxs(t.FlexRow,{align:"center",children:[c.jsx(r("WAWebContactImage.react"),{contact:f,size:40,loadPicture:!0}),c.jsxs(t.FlexColumn,{xstyle:[o("WAWebUISpacing").uiPadding.start12,m.contactTextContainer],grow:1,children:[c.jsx(t.FlexItem,{children:c.jsx(o("WAWebText.react").WAWebTextTitle,{textWrap:"ellipsis",children:g})}),c.jsx(t.FlexItem,{children:c.jsx(r("WAWebUserSubtitle.react"),{contact:f,presence:h,chatstate:h.chatstate,location:"title",chatId:n.id})})]})]}),c.jsxs(t.FlexRow,{xstyle:m.callButtonsRow,children:[c.jsx(t.FlexItem,{grow:1,xstyle:m.callButtonWrapper,children:c.jsx(o("WAWebCallDropdownMenuItems.react").CallButtonMenuItem,{optionId:"voice-call",testid:void 0,icon:c.jsx(r("WDSIconIcCallFilled.react"),{iconXstyle:m.callButtonMenuItemIcon}),disabled:l,label:s._(/*BTDS*/"Voz"),onSelect:function(){u.clickAudioCall(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),p(),i(!1),_()}})}),c.jsx(o("WAWebFlex.react").FlexItem,{grow:1,xstyle:m.callButtonWrapper,children:c.jsx(o("WAWebCallDropdownMenuItems.react").CallButtonMenuItem,{optionId:"video-call",testid:void 0,icon:c.jsx(r("WDSIconIcVideocamFilled.react"),{iconXstyle:m.callButtonMenuItemIcon}),disabled:l,label:s._(/*BTDS*/"Video"),onSelect:function(){u.clickVideoCall(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),p(),i(!0),_()}})})]}),(!r("WAWebEnvironment").isWeb||a)&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"xjm9jq1 x3x0x6p xh8yej3 xav9cv8 x4tpdpg"}),c.jsxs(o("WAWebFlex.react").FlexColumn,{xstyle:m.actionsContainer,children:[c.jsx(o("WAWebActionMenuItem.react").ActionMenuItem,{optionId:"new-group-call",detailLeft:c.jsx(o("WAWebAddUserIcon.react").AddUserIcon,{xstyle:m.actionItemIcon}),primary:c.jsx(o("WAWebText.react").WAWebTextTitle,{color:"secondary",children:s._(/*BTDS*/"Nueva llamada grupal")}),onSelect:function(){p(),u.clickAddContact(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),o("WAWebModalManager").ModalManager.open(c.jsx(r("WAWebVoipNewGroupCallContactPicker.react"),{chat:n,showCallTypeButtons:!0})),_()}}),c.jsx(o("WAWebActionMenuItem.react").ActionMenuItem,{optionId:"send-call-link",detailLeft:c.jsx(o("WAWebLinkRefreshedIcon.react").LinkRefreshedIcon,{xstyle:m.actionItemIcon}),primary:c.jsx(o("WAWebText.react").WAWebTextTitle,{color:"secondary",children:s._(/*BTDS*/"Enviar enlace de llamada")}),onSelect:function(){p(),u.clickCreateVideoCallLinkChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),o("WAWebModalManager").ModalManager.open(c.jsx(o("WAWebVoipCreateCallLinksPopupLoadable.react").WAWebVoipCreateCallLinksPopupLoadable,{targetChat:n})),_()}}),c.jsx(o("WAWebActionMenuItem.react").ActionMenuItem,{optionId:"schedule-call",detailLeft:c.jsx(o("WAWebCalendarFilledRefreshedIcon.react").CalendarFilledRefreshedIcon,{xstyle:m.actionItemIcon}),primary:c.jsx(o("WAWebText.react").WAWebTextTitle,{color:"secondary",children:s._(/*BTDS*/"Programar llamada")}),onSelect:function(){p(),u.clickCreateEventChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),o("WAWebVoipCallsTabScheduleCallModal.react").handleScheduleCallForChat(n),_()}})]})]})]})}p.displayName=p.name+" [from "+i.id+"]",l.default=p}),226); __d("WAWebVoipBetaCallingUpsellPopover.react",["fbt","WAWebFlex.react","WAWebText.react","WAWebUISpacing","WDSButton.react","react"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=e||(e=r("react")),c={container:{minWidth:"x1h80ny7",$$css:!0},textContainer:{maxWidth:"x1jkqq1h",$$css:!0},buttonContainer:{height:"x5yr21d",$$css:!0}};function d(e){var t,n,a=e.onClick;return u.jsxs((t=o("WAWebFlex.react")).FlexRow,{xstyle:[c.container,(n=o("WAWebUISpacing")).uiPadding.horiz20,n.uiPadding.bottom14,n.uiPadding.top12],align:"center",justify:"all",children:[u.jsxs(t.FlexColumn,{xstyle:c.textContainer,children:[u.jsx(t.FlexItem,{children:u.jsx(o("WAWebText.react").WAWebTextTitle,{children:s._(/*BTDS*/"Prueba las nuevas llamadas individuales en la web")})}),u.jsx(t.FlexItem,{xstyle:n.uiMargin.top2,children:u.jsx(o("WAWebText.react").WAWebTextMuted,{children:s._(/*BTDS*/"\u00danete al programa beta de WhatsApp para empezar a hacer llamadas en la web. Nota: Es posible que la versi\u00f3n de prueba sea inestable.")})})]}),u.jsx(t.FlexColumn,{xstyle:c.buttonContainer,align:"center",justify:"center",children:u.jsx(t.FlexItem,{xstyle:n.uiMargin.start16,children:u.jsx(r("WDSButton.react"),{variant:"filled",size:"medium",label:s._(/*BTDS*/"Cambiar a la versi\u00f3n beta"),onPress:a})})})]})}d.displayName=d.name+" [from "+i.id+"]",l.default=d}),226); __d("WAWebVoipCallingNux.react",["fbt","WAWebBox.react","WAWebClickable.react","WAWebDropdownV2.react","WAWebFbtCommon","WAWebFlex.react","WAWebNux","WAWebPopoverContext.react","WAWebTooltip.react","WDSIconIcClose.react","WDSText.react","react","useWAWebNux"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=e||(e=o("react")),c=e.useEffect,d={row:{minHeight:"xu0aao5",$$css:!0},tooltip:{paddingTop:"x1xrf6ya",paddingInlineEnd:"xde1mab",paddingBottom:"xscbp6u",paddingInlineStart:"x1iw51ew",borderStartStartRadius:"xlr9sxt",borderStartEndRadius:"xvvg52n",borderEndEndRadius:"xwd4zgb",borderEndStartRadius:"xq8v1ta",$$css:!0},arrow:{marginTop:"xdj266r",marginInlineEnd:"x14z9mp",marginBottom:"xat24cr",marginInlineStart:"x1sbwfh8",$$css:!0},button:{borderStartStartRadius:"xt8t1vi",borderStartEndRadius:"x1xc408v",borderEndEndRadius:"x129tdwq",borderEndStartRadius:"x15urzxu",$$css:!0},content:{rowGap:"x1b73lln",columnGap:"x46w9ns",$$css:!0},closeButton:{marginInlineStart:"x150mmf0",$$css:!0}};function m(e){var t=e.nuxKey,n=e.targetRef,a=r("useWAWebNux")(t),i=a[0],l=a[2],m=o("WAWebPopoverContext.react").useWAWebPopoverControllerRef();c(function(){if(i&&n.current!=null){var e;(e=m.current)==null||e.showPopover()}},[i,m,n]);var p=function(){var e;l(),(e=m.current)==null||e.hidePopover()};if(!i)return null;var _=t===o("WAWebNux").NUX.WEB_CALLING_1_1_NUX?s._(/*BTDS*/"One-on-one web calls"):s._(/*BTDS*/"Calling on web"),f=s._(/*BTDS*/"Habla en vivo por audio o video.");return u.jsx(r("WAWebBox.react"),{testid:void 0,children:u.jsx(o("WAWebPopoverContext.react").WAWebPopoverController,{targetRef:n,controllerRef:m,popover:u.jsx(o("WAWebTooltip.react").WAWebControllableTooltip,{target:"context",alignment:o("WAWebDropdownV2.react").PopoverAlignment.Center,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,enableEnterTransition:!0,tooltipXStyle:d.tooltip,arrowXStyle:d.arrow,includeArrow:!0,element:u.jsxs(o("WAWebFlex.react").FlexRow,{xstyle:d.row,align:"center",justify:"all",children:[u.jsxs(o("WAWebFlex.react").FlexColumn,{xstyle:d.content,children:[u.jsx(r("WDSText.react"),{type:"Body2Emphasized",colorName:"contentInverse",children:_}),u.jsx(r("WDSText.react"),{type:"Body3",colorName:"contentInverse",children:f})]}),u.jsx(o("WAWebClickable.react").Clickable,{as:"button",onClick:p,xstyle:[d.button,d.closeButton],ariaLabel:r("WAWebFbtCommon")("Close"),children:u.jsx(r("WDSIconIcClose.react"),{colorName:"contentInverse",width:20,height:20})})]})})})})}m.displayName=m.name+" [from "+i.id+"]",l.default=m}),226); __d("WAWebVoipCoexCallingPermissionDisabledModal.react",["fbt","WAWebConfirmPopup.react","WAWebModalManager","react"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u=e||(e=r("react"));function c(){var e=function(){o("WAWebModalManager").ModalManager.close()};return u.jsx(o("WAWebConfirmPopup.react").ConfirmPopup,{title:s._(/*BTDS*/"No puedes llamar a este cliente en este momento"),onOK:e,okText:s._(/*BTDS*/"OK"),testid:void 0,children:s._(/*BTDS*/"Rechaz\u00f3 tu solicitud de llamada. A\u00fan puedes enviarle mensajes o aceptar sus llamadas.")})}c.displayName=c.name+" [from "+i.id+"]",l.default=c}),226); __d("useWAWebVoipIsCallingEnabledAndInited",["WAWebCmd","WAWebVoipBackendLoadable","WAWebVoipGatingUtils","WAWebVoipInit","asyncToGeneratorRuntime","react","useWAWebEventTargetValue","useWAWebListener","useWAWebStableCallback"],(function(t,n,r,o,a,i,l){"use strict";var e,s=(e||(e=o("react"))).useEffect;function u(){var e=r("useWAWebStableCallback")(n("asyncToGeneratorRuntime").asyncToGenerator(function*(){if(o("WAWebVoipGatingUtils").isCallingEnabled()&&!o("WAWebVoipInit").VoipInitEventEmitter.getIsVoipInited()){var e=yield o("WAWebVoipBackendLoadable").requireVoipJsBackend(),t=e.WAWebVoipInit;yield t.initWAWebVoip()}}));s(function(){e()},[e]),o("useWAWebListener").useListener(o("WAWebCmd").Cmd,"on_ab_props_update_from_bridge",e);var t=r("useWAWebEventTargetValue")(o("WAWebVoipInit").VoipInitEventEmitter,"voipInitSuccess",function(){return o("WAWebVoipInit").VoipInitEventEmitter.getIsVoipInited()});return o("WAWebVoipGatingUtils").isCallingEnabled()&&t}l.useWAWebVoipIsCallingEnabledAndInited=u}),98); __d("WAWebCallButtons.react",["fbt","$InternalEnum","WALogger","WANullthrows","WAWebActionMenuItem.react","WAWebAddUserIcon.react","WAWebButton.react","WAWebCallButtonsSurface","WAWebCallCollection","WAWebCallRefreshedIcon.react","WAWebChatGetters","WAWebChatsOutlineIcon.react","WAWebContactCollection","WAWebDesktopUpsellCallingUnavailablePopover.react","WAWebDesktopUpsellUtils","WAWebDrawerManager","WAWebDropdownV2.react","WAWebEnvironment","WAWebFrontendContactGetters","WAWebGroupCallParticipantSelector.react","WAWebGroupMetadataCollection","WAWebLidMigrationUtils","WAWebMenuBar.react","WAWebMenuBarStyles","WAWebMobilePlatforms","WAWebModalManager","WAWebMsgGetters","WAWebNux","WAWebPopoverContext.react","WAWebPreCallUserJourneyLogger","WAWebScreenWidthThresholds","WAWebSettingsConst","WAWebSettingsFlowLoadable","WAWebSingleCallDropdownContent.react","WAWebTabOrder","WAWebUnstyledButton.react","WAWebUserPrefsMeUser","WAWebVideoCallRefreshedIcon.react","WAWebVoipActionRequestOpenChat","WAWebVoipBetaCallingUpsellPopover.react","WAWebVoipCallingNux.react","WAWebVoipCoexCallingPermissionDisabledModal.react","WAWebVoipGatingUtils","WAWebVoipOngoingCallCollection","WAWebVoipStackInterface","WAWebVoipStartCall","WAWebWamEnumLobbyEntryPointType","WAWebWamEnumSubSurface","WDSButton.react","WDSIconIcArrowDropDown.react","WDSIconIcVideocam.react","WDSMenuBarItem.react","WDSText.react","asyncToGeneratorRuntime","fbs","isStringNullOrEmpty","nullthrows","react","stylex","useWAWebABPropConfigValue","useWAWebEventTargetValue","useWAWebExternalBetaOptIn","useWAWebIsWinHybridJoinableCallsEnabled","useWAWebVoipCanStartCall","useWAWebVoipIsCallingEnabledAndInited","useWAWebWindowSize"],(function(t,n,r,o,a,i,l,s){"use strict";var e,u,c,d,m,p,_,f,g,h,y,C,b,v,S,R=S||(S=o("react")),L=b||(b=r("react")),E=R.useMemo,k=R.useRef,I=R.useState,T=n("$InternalEnum").Mirrored(["NONE","BETA","DESKTOP"]),D={callDropdownShadow:{boxShadow:"xs2e80n",$$css:!0},callButtonIcon:{color:"x14ug900",height:"x1qx5ct2",width:"xw4jnvo",$$css:!0},customCallButton:{alignItems:"x6s0dn4",backgroundColor:"x1280gxy x1ubxc9n",borderTopColor:"xnj1f2r",borderInlineEndColor:"x2uibgs",borderBottomColor:"xkveyfu",borderInlineStartColor:"x12llq9",borderStartStartRadius:"xt8t1vi",borderStartEndRadius:"x1xc408v",borderEndEndRadius:"x129tdwq",borderEndStartRadius:"x15urzxu",borderTopStyle:"x13fuv20",borderInlineEndStyle:"x18b5jzi",borderBottomStyle:"x1q0q8m5",borderInlineStartStyle:"x1t7ytsu",borderTopWidth:"x178xt8z",borderInlineEndWidth:"x1lun4ml",borderBottomWidth:"xso031l",borderInlineStartWidth:"xpilrb4",columnGap:"x1s70e7g",cursor:"x1ypdohk x1s07b3s",display:"x78zum5",minHeight:"x1ba4aug",opacity:"x1hc1fzr x1lfpgzf",paddingTop:"x16ovd2e",paddingBottom:"x12xbjc7",paddingInlineStart:"xdx6fka",paddingInlineEnd:"xvtqlqk",paddingLeft:null,paddingRight:null,$$css:!0},buttonMargin:{marginInlineStart:"x150mmf0",$$css:!0},unifiedButtonMargin:{marginInlineStart:"x150mmf0",marginInlineEnd:"xqf2s3x",$$css:!0}};function x(t){var a=t.callFromUI,i=a===void 0?0:a,l=t.callLinkCode,b=l===void 0?"":l,S=t.chat,R=t.isCallLinkVideo,x=R===void 0?!1:R,$=t.lobbyEntryPoint,P=$===void 0?0:$,N=t.participants,M=t.surface,w=o("useWAWebVoipIsCallingEnabledAndInited").useWAWebVoipIsCallingEnabledAndInited(),A=o("useWAWebIsWinHybridJoinableCallsEnabled").useIsWinHybridJoinableCallsEnabled(),F=o("useWAWebABPropConfigValue").useABPropConfigValue("enable_lid_call_link"),O=o("useWAWebABPropConfigValue").useABPropConfigValue("add_to_call_in_chat_thread")>0,B=r("useWAWebEventTargetValue")(o("WAWebVoipOngoingCallCollection").WAWebVoipOngoingCallCollection,"all",function(){return o("WAWebVoipOngoingCallCollection").WAWebVoipOngoingCallCollection.getByChat(S)}),W=o("WAWebChatGetters").getIsGroup(S),q=!o("useWAWebVoipCanStartCall").useWAWebVoipCanStartCall(S),U=o("useWAWebVoipCanStartCall").useWAWebVoipIsCapiCallingPermissionAllowed(S),V=k(null),H=k(null),G=k(null),z=o("WAWebPopoverContext.react").useWAWebPopoverControllerRef(),j=o("WAWebPopoverContext.react").useWAWebPopoverControllerRef(),K=o("WAWebPopoverContext.react").useWAWebPopoverControllerRef(),Q=k(!1),X=I(!1),Y=X[0],J=X[1],Z=E(function(){return new(o("WAWebPreCallUserJourneyLogger")).PreCallUserJourneyLogger},[]),ee=o("useWAWebABPropConfigValue").useABPropConfigValue("wds_web_button"),te=o("WAWebVoipGatingUtils").isGroupCallingEnabled(),ne=o("useWAWebABPropConfigValue").useABPropConfigValue("enable_web_calling_nux"),re=o("useWAWebABPropConfigValue").useABPropConfigValue("enable_web_calling_beta_upsell"),oe=o("useWAWebABPropConfigValue").useABPropConfigValue("group_call_max_participants"),ae=r("useWAWebWindowSize")(),ie=ae.widthoe)return null;if(!o("WAWebVoipGatingUtils").isGroupCallingEnabled())if(pe!=null)_e=T.DESKTOP;else return null}else if(!o("WAWebVoipGatingUtils").isCallingEnabled())if(!me&&re)_e=T.BETA;else if(pe!=null)_e=T.DESKTOP;else return null}var be=_e!==T.NONE,ve=W?s._(/*BTDS*/"Llamada grupal"):s._(/*BTDS*/"Llamada"),Se=W?s._(/*BTDS*/"Videollamada grupal"):s._(/*BTDS*/"Videollamada"),Re=function(n){if(o("WALogger").LOG(e||(e=babelHelpers.taggedTemplateLiteralLoose(["voip: header: start call, isVideo: ",", groupType: ",""])),n,S.groupType),!U){o("WAWebModalManager").ModalManager.open(L.jsx(r("WAWebVoipCoexCallingPermissionDisabledModal.react"),{}));return}N!=null&&N.length>1?(o("WALogger").LOG(u||(u=babelHelpers.taggedTemplateLiteralLoose(["voip: header: starting ad hoc group call"]))),o("WAWebVoipStartCall").startWAWebVoipGroupCallFromWids(N,n,i,P)):S.groupType===void 0?(o("WALogger").LOG(c||(c=babelHelpers.taggedTemplateLiteralLoose(["voip: header: starting 1:1 call"]))),o("WAWebVoipStartCall").startWAWebVoipCall(S.contact.id,n,i,P)):(o("WALogger").LOG(d||(d=babelHelpers.taggedTemplateLiteralLoose(["voip: header: starting group call"]))),o("WAWebVoipStartCall").startWAWebVoipGroupCallFromChat(S,n,i,P))},Le=function(t){var e,n=t?z:j;(e=n.current)==null||e.hidePopover()};if(A&&B!=null&&!o("WAWebMsgGetters").getIsCallLink(B)&&S.id.isGroup())return L.jsx("div",babelHelpers.extends({},(v||(v=r("stylex"))).props(r("WAWebMenuBarStyles").itemButton,D.buttonMargin),{children:L.jsxs(o("WAWebButton.react").WAWebButtonPrimaryCompact,{onClick:function(){o("WAWebVoipStartCall").joinOngoingWAWebVoipGroupCallPN(r("nullthrows")(o("WAWebMsgGetters").getCallId(B)),S,o("WAWebMsgGetters").getIsVideoCall(B),M===o("WAWebCallButtonsSurface").WAWebCallButtonsSurface.CallLogDetails?o("WAWebWamEnumLobbyEntryPointType").LOBBY_ENTRY_POINT_TYPE.CALL_LOG:o("WAWebWamEnumLobbyEntryPointType").LOBBY_ENTRY_POINT_TYPE.CHAT_HEADER)},children:[B.isVideoCall?L.jsx(o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,{}):L.jsx(o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,{}),ce()?r("fbs")._(/*BTDS*/"Volver"):r("fbs")._(/*BTDS*/"Unirme")]})}));if(M===o("WAWebCallButtonsSurface").WAWebCallButtonsSurface.CallLogDetails&&!r("isStringNullOrEmpty")(b))return L.jsx("div",babelHelpers.extends({},(v||(v=r("stylex"))).props(r("WAWebMenuBarStyles").itemButton,D.buttonMargin),{children:L.jsxs(o("WAWebButton.react").WAWebButtonPrimaryCompact,{onClick:n("asyncToGeneratorRuntime").asyncToGenerator(function*(){o("WALogger").LOG(m||(m=babelHelpers.taggedTemplateLiteralLoose(["voip: preview call link: CallLinkCode=",", isVideo=",""])),b,x);try{var e=yield o("WAWebVoipStackInterface").getVoipStackInterface();if(b){var t=o("WAWebContactCollection").ContactCollection.getMeContact(),n=t?o("WAWebFrontendContactGetters").getUsername(t):null;yield e==null?void 0:e.previewCallLink(b,x!=null?x:!1,F,o("WAWebWamEnumLobbyEntryPointType").LOBBY_ENTRY_POINT_TYPE.CALL_LINK_CALL_LOG,n),o("WALogger").LOG(p||(p=babelHelpers.taggedTemplateLiteralLoose(["voip: preview call link initiated successfully"])))}else o("WALogger").ERROR(_||(_=babelHelpers.taggedTemplateLiteralLoose(["voip: preview call link failed - CallLinkCode is empty"])))}catch(e){o("WALogger").ERROR(f||(f=babelHelpers.taggedTemplateLiteralLoose(["voip: preview call link failed with error: ",""])),String(e))}}),children:[x?L.jsx(o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,{}):L.jsx(o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,{}),r("fbs")._(/*BTDS*/"Unirme")]})}));var Ee=function(t){var e=t?L.jsx(o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,{}):L.jsx(o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,{}),n=t?Se:ve,a=t?V:H,i=t?z:j;return ee?L.jsxs(L.Fragment,{children:[L.jsx(r("WDSMenuBarItem.react"),{ref:a,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,title:n,icon:t?o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon:o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,disabled:q,marginInlineXstyle:D.buttonMargin}),L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:i,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:a,maxHeight:488,onClose:function(){Q.current||Z.dismissChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.ADD_PARTICIPANT_PICKER),Q.current=!1},children:L.jsx(r("WAWebGroupCallParticipantSelector.react"),{chat:S,icon:e,isCallingDisabled:q,isVideo:t,logger:Z,onActionTaken:function(){Q.current=!0},onCallStart:Le,useUnifiedUI:!1},S.id.toString())})]}):L.jsxs(L.Fragment,{children:[L.jsx(o("WAWebMenuBar.react").MenuBarItem,{ref:a,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:e,disabled:q,title:n}),L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:i,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:a,maxHeight:488,onClose:function(){Q.current||Z.dismissChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.ADD_PARTICIPANT_PICKER),Q.current=!1},children:L.jsx(r("WAWebGroupCallParticipantSelector.react"),{chat:S,icon:e,isCallingDisabled:q,isVideo:t,logger:Z,onActionTaken:function(){Q.current=!0},onCallStart:Le},S.id.toString())})]})},ke=function(){return _e===T.BETA?L.jsx(r("WAWebVoipBetaCallingUpsellPopover.react"),{onClick:function(){var e,t,n;(e=z.current)==null||e.hidePopover(),(t=j.current)==null||t.hidePopover(),(n=K.current)==null||n.hidePopover(),o("WAWebDrawerManager").DrawerManager.openDrawerLeft(L.jsx(o("WAWebSettingsFlowLoadable").SettingsFlowLoadable,{onEnd:o("WAWebDrawerManager").closeDrawerLeft,initialStep:o("WAWebSettingsConst").SettingsSteps.Help}))}}):_e===T.DESKTOP?L.jsx(r("WAWebDesktopUpsellCallingUnavailablePopover.react"),{userDesktopOs:r("WANullthrows")(pe),isGroupCall:W}):null},Ie=function(){if(be){var e=ke();return L.jsxs(L.Fragment,{children:[L.jsxs(r("WAWebUnstyledButton.react"),{ref:V,xstyle:[D.customCallButton,D.unifiedButtonMargin],dataTab:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,"aria-label":Se,"aria-haspopup":"menu","aria-expanded":Y,children:[L.jsx(r("WDSIconIcVideocam.react"),{iconXstyle:D.callButtonIcon}),L.jsx(r("WDSText.react"),{type:"Body2Emphasized",textAlign:"center",selectable:!1,colorName:"contentDefault",children:s._(/*BTDS*/"Llamar")}),L.jsx(r("WDSIconIcArrowDropDown.react"),{iconXstyle:D.callButtonIcon})]}),L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:z,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:V,maxHeight:488,children:e})]})}var t=L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:z,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:V,maxHeight:488,onOpen:function(){J(!0)},onClose:function(){J(!1),Q.current||Z.dismissChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.ADD_PARTICIPANT_PICKER),Q.current=!1},children:L.jsx(r("WAWebGroupCallParticipantSelector.react"),{chat:S,icon:L.jsx(o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,{}),isCallingDisabled:q,isVideo:!0,logger:Z,onActionTaken:function(){Q.current=!0},onCallStart:Le,useUnifiedUI:!0},S.id.toString())});return se===0?L.jsxs(L.Fragment,{children:[L.jsxs(r("WAWebUnstyledButton.react"),{ref:V,xstyle:[D.customCallButton,D.unifiedButtonMargin],disabled:q,dataTab:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,"aria-label":Se,children:[L.jsx(r("WDSIconIcVideocam.react"),{iconXstyle:D.callButtonIcon}),L.jsx(r("WDSText.react"),{type:"Body2Emphasized",textAlign:"center",selectable:!1,colorName:"contentDefault",children:s._(/*BTDS*/"Llamar")}),L.jsx(r("WDSIconIcArrowDropDown.react"),{iconXstyle:D.callButtonIcon})]}),t]}):L.jsxs(L.Fragment,{children:[L.jsx(r("WDSButton.react"),{variant:"borderless",size:"medium",type:"default",ref:V,Icon:r("WDSIconIcVideocam.react"),showEndDropdownIcon:!0,disabled:q,onPress:function(){var e;Z.clickCallDropdown(o("WAWebWamEnumSubSurface").SUB_SURFACE.CHAT_HEADER),(e=z.current)==null||e.showPopover()},"aria-label":Se}),t]})},Te=function(){if(ue==null)return!1;if(W&&ue.isGroup){var e,t;return(e=(t=ue.groupJid)==null?void 0:t.equals(S.id))!=null?e:!1}if(!W&&ue.groupCallParticipants!=null)return ue.groupCallParticipants.some(function(e){var t,n=o("WAWebLidMigrationUtils").toCommonAddressingMode(e,S.id),r=n[0],a=n[1];return(t=r==null?void 0:r.equals(a))!=null?t:!1});if(!W&&!ue.isGroup){var n,r=o("WAWebLidMigrationUtils").toCommonAddressingMode(ue.peerJid,S.id),a=r[0],i=r[1];return(n=a==null?void 0:a.equals(i))!=null?n:!1}return!1},De=ie||o("WAWebMobilePlatforms").isSMB(),xe=function(){if(be){var e=ke();return L.jsxs(L.Fragment,{children:[L.jsxs(r("WAWebUnstyledButton.react"),{testid:void 0,ref:G,xstyle:[D.customCallButton,D.unifiedButtonMargin],dataTab:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,"aria-label":Se,role:"button",children:[L.jsx(r("WDSIconIcVideocam.react"),{iconXstyle:D.callButtonIcon}),!De&&L.jsx(r("WDSText.react"),{type:"Body2Emphasized",textAlign:"center",selectable:!1,colorName:"contentDefault",children:s._(/*BTDS*/"Llamar")}),L.jsx(r("WDSIconIcArrowDropDown.react"),{iconXstyle:D.callButtonIcon})]}),L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:K,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:G,maxHeight:488,children:e})]})}return L.jsxs(L.Fragment,{children:[L.jsxs(r("WAWebUnstyledButton.react"),{testid:void 0,ref:G,xstyle:[D.customCallButton,D.unifiedButtonMargin],disabled:q,dataTab:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,"aria-label":Se,role:"button",children:[L.jsx(r("WDSIconIcVideocam.react"),{iconXstyle:D.callButtonIcon}),!De&&L.jsx(r("WDSText.react"),{type:"Body2Emphasized",textAlign:"center",selectable:!1,colorName:"contentDefault",children:s._(/*BTDS*/"Llamar")}),L.jsx(r("WDSIconIcArrowDropDown.react"),{iconXstyle:D.callButtonIcon})]}),L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:K,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:G,maxHeight:488,onClose:function(){Q.current||Z.dismissChatThread(o("WAWebWamEnumSubSurface").SUB_SURFACE.CALL_DROPDOWN_MENU),Q.current=!1},children:L.jsx(r("WAWebSingleCallDropdownContent.react"),{chat:S,handleCall:Re,isCallingDisabled:q,logger:Z,onActionTaken:function(){Q.current=!0},onClose:function(){var e;return(e=K.current)==null?void 0:e.hidePopover()},enableWebGroupCalling:te})})]})},$e=function(t){if(!O||ue==null)return!1;var e=Te();return e?!1:ue.isGroup&&ue.groupJid==null?!0:ue.isGroup?!1:t&&ue.isVideo||!t&&!ue.isVideo},Pe=function(t){if(t?Z.clickVideoCall(o("WAWebWamEnumSubSurface").SUB_SURFACE.CHAT_HEADER):Z.clickAudioCall(o("WAWebWamEnumSubSurface").SUB_SURFACE.CHAT_HEADER),$e(t)){var e,n=t?z:j;(e=n.current)==null||e.showPopover()}else Re(t)},Ne=function(){if(le&&se===0)return xe();var e=q,t=q;if(O){var a=Te();a?(e=!0,t=!0):ue!=null&&(ue.isGroup&&ue.groupJid!=null?(e=!0,t=!0):(e=!ue.isVideo,t=ue.isVideo))}var i=ee?L.jsx(r("WDSMenuBarItem.react"),{ref:V,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,onClick:function(){return Pe(!0)},disabled:e,title:Se,marginInlineXstyle:D.buttonMargin}):L.jsx(o("WAWebMenuBar.react").MenuBarItem,{ref:V,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:L.jsx(o("WAWebVideoCallRefreshedIcon.react").VideoCallRefreshedIcon,{}),onClick:function(){return Pe(!0)},disabled:e,title:Se}),l=ee?L.jsx(r("WDSMenuBarItem.react"),{ref:H,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,onClick:function(){return Pe(!1)},disabled:t,title:ve,marginInlineXstyle:D.buttonMargin}):L.jsx(o("WAWebMenuBar.react").MenuBarItem,{ref:H,tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:L.jsx(o("WAWebCallRefreshedIcon.react").CallRefreshedIcon,{}),onClick:function(){return Pe(!1)},disabled:t,title:ve}),u=$e(!0)?L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:z,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:V,maxHeight:488,children:L.jsx(o("WAWebActionMenuItem.react").ActionMenuItem,{optionId:"add-to-call-video",detailLeft:L.jsx(o("WAWebAddUserIcon.react").AddUserIcon,{}),primary:s._(/*BTDS*/"A\u00f1adir a la llamada"),onSelect:n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e;o("WALogger").LOG(g||(g=babelHelpers.taggedTemplateLiteralLoose(["voip: add to call clicked for video call with chat: ",""])),S.id.toString());try{yield o("WAWebVoipStartCall").inviteToCall(S.id)}catch(e){o("WALogger").ERROR(h||(h=babelHelpers.taggedTemplateLiteralLoose(["voip: add to call failed for ",": ",""])),S.id.toString(),String(e))}(e=z.current)==null||e.hidePopover()})})}):null,c=$e(!1)?L.jsx(o("WAWebDropdownV2.react").DropdownV2Menu,{xstyle:D.callDropdownShadow,controllerRef:j,position:o("WAWebDropdownV2.react").PopoverPosition.Bottom,alignment:o("WAWebDropdownV2.react").PopoverAlignment.End,target:H,maxHeight:488,children:L.jsx(o("WAWebActionMenuItem.react").ActionMenuItem,{optionId:"add-to-call-voice",detailLeft:L.jsx(o("WAWebAddUserIcon.react").AddUserIcon,{}),primary:s._(/*BTDS*/"A\u00f1adir a la llamada"),onSelect:n("asyncToGeneratorRuntime").asyncToGenerator(function*(){var e;o("WALogger").LOG(y||(y=babelHelpers.taggedTemplateLiteralLoose(["voip: add to call clicked for voice call with chat: ",""])),S.id.toString());try{yield o("WAWebVoipStartCall").inviteToCall(S.id)}catch(e){o("WALogger").ERROR(C||(C=babelHelpers.taggedTemplateLiteralLoose(["voip: add to call failed for ",": ",""])),S.id.toString(),String(e))}(e=j.current)==null||e.hidePopover()})})}):null;return L.jsxs(L.Fragment,{children:[i,u,l,c]})},Me=function(){if(S.id.isGroup())return!0;if(N==null)return!1;var e=N.filter(function(e){return!o("WAWebUserPrefsMeUser").isMeAccount(e)});return e.length<=1},we=Ne();return L.jsxs(L.Fragment,{children:[M===o("WAWebCallButtonsSurface").WAWebCallButtonsSurface.CallLogDetails&&Me()&&ee&&L.jsx(r("WDSMenuBarItem.react"),{tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:o("WAWebChatsOutlineIcon.react").ChatsOutlineIcon,onClick:function(){return o("WAWebVoipActionRequestOpenChat").requestOpenChat(S.id)},title:r("fbs")._(/*BTDS*/"Mensajes"),marginInlineXstyle:D.buttonMargin}),M===o("WAWebCallButtonsSurface").WAWebCallButtonsSurface.CallLogDetails&&Me()&&!ee&&L.jsx(o("WAWebMenuBar.react").MenuBarItem,{tabOrder:o("WAWebTabOrder").TAB_ORDER.CHAT_HEADER_BUTTON,testid:void 0,icon:L.jsx(o("WAWebChatsOutlineIcon.react").ChatsOutlineIcon,{}),onClick:function(){return o("WAWebVoipActionRequestOpenChat").requestOpenChat(S.id)},title:r("fbs")._(/*BTDS*/"Mensajes")}),W&&le&&Ie(),W&&le&&se===1&&L.jsx("div",{className:"xamitd3 x3x0x6p xxk0z11 x1i1rx1s"}),W&&!le&&L.jsxs(L.Fragment,{children:[Ee(!0),Ee(!1)]}),!W&&we,!W&&ne&&o("WAWebVoipGatingUtils").isCallingEnabled()&&L.jsx(r("WAWebVoipCallingNux.react"),{targetRef:G,nuxKey:o("WAWebNux").NUX.WEB_CALLING_1_1_NUX}),W&&le&&ne&&o("WAWebVoipGatingUtils").isGroupCallingEnabled()&&L.jsx(r("WAWebVoipCallingNux.react"),{targetRef:V,nuxKey:o("WAWebNux").NUX.WEB_CALLING_GROUP_NUX})]})}x.displayName=x.name+" [from "+i.id+"]",l.WAWebCallButtons=x}),226); __d("WAWebOrchestratorJobEventSampling",[],(function(t,n,r,o,a,i){var e={sendMessage:10,createLidPnMappings:10,updateLidMetadata:10,getAllUserDisclosures:10,handleBusinessNotification:5,syncMyDeviceList:5,receiptBatcherRunActiveBatches:5,updateDraftMessageChat:5},l={JOB_EVENT_SAMPLING_RATE:e};i.default=l}),66);