"use strict";(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[424638],{749736:(e,t,i)=>{i.r(t),i.d(t,{CallingParkScreenContainer:()=>g});var s=i(957032),n=i(513432),o=i(653422),a=i(431256),l=i(986040),r=i(109019),c=i(370118),d=i(907888),p=i(337917),u=i(879749);const h=(0,i(391567).O)({isCallingScreenAvatarContainer:{qhf8xq:"f1euv43f",Bhzewxz:"f1i1t8d1",oyh7mz:["f1ktbn1t","ffenbu1"],Bz10aip:["foouk8k","fd9rb4b"],Es3by:"f1ihwxza",Bn62ygk:0,Cwk7ip:0,B3o57yi:0,Bmy1vo4:0,Bkqvd7p:0,Bi2q7bf:"fag2jiy",B6ecu15:"frs0m89"},isCallingScreenAvatar:{a9b677:"fcx7h3q",Bqenvij:"fbhg4qz",Beyfa6y:0,Bbmb7ep:0,Btl43ni:0,B7oj6ja:0,Dimara:"f5q2cvs",Es3by:"f1ycwb8u",zr6y0c:"f7bb724",Bygp6ph:"f1svlfk",Bbnxn5q:"f13vddht",khehk:"f1n8wp8b"},isCallStatus:{sj55zd:"f19n0e5",Bhrd7zp:"flh3ekv"},isCallStatusContainer:{qhf8xq:"f1euv43f",Bhzewxz:"f1i1t8d1",Brf1p80:"f4d9j23",B6of3ja:"fil1u0l",a9b677:"fly5x3f",fsow6f:"f17mccla",Es3by:"f1ihwxza",Bn62ygk:0,Cwk7ip:0,B3o57yi:0,Bmy1vo4:0,Bkqvd7p:0,Bi2q7bf:"feo8dw3",B6ecu15:"frs0m89",Bkaup7d:"f10ix316",Bugif0c:"f1rgj9le"},isCopyMeetingInfoButton:{a9b677:"frg13t0"},isCallingSidePanelIconOnlyButton:{sj55zd:"fkfq4zb",Bkfmm31:"fd2mlab"}});class C extends n.PureComponent{constructor(){super(...arguments),this.copyCodeButtonRef=n.createRef(),this.state={callCodeCopied:!1},this.RenderElements=()=>{const e=h();return(0,s.Y)(l.s,{column:!0,hAlign:"center",vAlign:"center",gap:"gap.large",className:e.isCallStatusContainer,children:[(0,s.Y)(this.RenderParkState,{}),(0,s.Y)(this.RenderPickupCodeText,{}),(0,s.Y)(this.RenderCopyButton,{})]})},this._copyPickupCode=()=>{const e=this.props.parkedCallDetails?.pickupCode,t=this.props.userContext.host;e&&((0,a.lW)(t,e),this.setState({callCodeCopied:!0},this._focusCopyCodeButton),t.clearTimeout(this.copyCodeButtonTimeoutId),this.copyCodeButtonTimeoutId=t.setTimeout((()=>this.setState({callCodeCopied:!1},this._focusCopyCodeButton)),2e3))},this._setCloseWindowTimer=()=>{const{userContext:{host:e}}=this.props;this.closeWindowTimeoutId=e.setTimeout((()=>{this.props.onTimedOut()}),3e5)},this._cancelTimeout=()=>{const{userContext:{host:e}}=this.props;this.closeWindowTimeoutId&&e.clearTimeout(this.closeWindowTimeoutId),this.closeWindowTimeoutId=void 0,this.copyCodeButtonTimeoutId&&e.clearTimeout(this.copyCodeButtonTimeoutId),this.copyCodeButtonTimeoutId=void 0},this.RenderParkeeAvatar=()=>{const e=h();return(0,s.Y)(l.s,{className:e.isCallingScreenAvatarContainer,children:(0,s.Y)(l.s,{className:e.isCallingScreenAvatar,children:(0,s.Y)(o.U,{userId:this.props.parkedCallDetails?.parkee||"",isFocusable:!1})})})},this.RenderCopyButton=()=>{const{i18n:e,parkedCallDetails:t}=this.props,i=h();return(0,s.Y)(r.$,{"data-tid":"copy-park-pickup-code-button",ref:this.copyCodeButtonRef,onClick:this._copyPickupCode,className:(0,c.z)(i.isCopyMeetingInfoButton,i.isCallingSidePanelIconOnlyButton),"aria-label":e.stringTranslate("calling","calling_park_pickup_code",{pickupCode:t?.pickupCode||""}),children:e.translate("calling",this.state.callCodeCopied?"copied_to_clipboard":"calling_park_copy_pickup_code")})},this.RenderParkState=()=>{const{i18n:e}=this.props,t=h();return(0,s.Y)(d.D,{id:"call-status-park-success",size:"larger",className:t.isCallStatus,children:e.translate("calling","calling_park_success_status")})},this.RenderPickupCodeText=()=>{const{i18n:e,parkedCallDetails:t}=this.props,i=h();return(0,s.Y)(d.D,{id:"park-pickup-code",size:"large",className:i.isCallStatus,children:e.translate("calling","calling_park_pickup_code",{pickupCode:t?.pickupCode||""})})},this._focusCopyCodeButton=()=>{this.copyCodeButtonRef.current&&this.copyCodeButtonRef.current.focus()}}componentDidMount(){this._focusCopyCodeButton(),this._setCloseWindowTimer(),this.props.onScreenReady()}componentWillUnmount(){this._cancelTimeout()}render(){return(0,s.Y)(l.s,{hAlign:"center",vAlign:"center",children:[(0,s.Y)(this.RenderParkeeAvatar,{}),(0,s.Y)(this.RenderElements,{})]})}}const f=(0,p.z)((0,u.$L)(C));var k=i(315854),m=i(650656);const B={kind:"Document",get definitions(){const e=(0,m.G)("fragment callingFieldsForParkedCall on Call {id,callId,state,isMuted,isServerMuted,extendedCallState,isHandRaised,isVideoOn,isScreenSharingOn,isReconciled,dominantSpeakerInfo {speakerList,timestamp}}");return delete this.definitions,this.definitions=e.definitions}},y={kind:"Document",get definitions(){const e=(0,m.G)("query parkedCallDetails($callId:ID!) {parkedCallDetails(callId:$callId) {parkee,pickupCode,call {...callingFieldsForParkedCall}}}");return delete this.definitions,this.definitions=[...e.definitions,...B.definitions]}};class g extends n.PureComponent{render(){const{callId:e,onTimedOut:t,onScreenReady:i}=this.props;return(0,s.Y)(k.X,{query:y,variables:{callId:e},children:({data:e,loading:n,error:o})=>(o&&t(),!n&&e&&e.parkedCallDetails?(0,s.Y)(f,{parkedCallDetails:e.parkedCallDetails,onTimedOut:t,onScreenReady:i}):null)})}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/components-calling-park-screen-347cd2cd9dcf4f03.js.map