Loading
function(e,t,n){"use strict";n.r(t),n.d(t,{attachFrameHostWindow:()=>b,attachFrameIframe:()=>y,clearMainFrameSlot:()=>p,demoteMainFrame:()=>m,detachFrameHostWindow:()=>v,detachFrameIframe:()=>D,launchFrame:()=>I,promoteFrame:()=>T,refreshProxyTicket:()=>P,resetFrameGuestClaims:()=>C,resetFrameLayoutModes:()=>L,setFramePictureInPictureInteractive:()=>N,setFrameRunsInBackground:()=>S,setFrameUserMuted:()=>O,updateFrameLayoutMode:()=>g,updateFramePanelMode:()=>R});var i=n(73153),r=n(730602),a=n(872142),s=n(933958),l=n(988534);function o(){let e=s.Ay.getCurrentEmbeddedActivity();null!=e&&(0,l.d)({location:e.location,applicationId:e.applicationId,showFeedback:!1})}var d=n(85982),c=n(982844),u=n(197184),_=n(91242),E=n(457827),A=n(165610),f=n(5867);let h=0;async function I(e){let{applicationId:t,surface:n,launch:s,analyticsContext:l,hostWindowKey:E,showErrorModal:f=!0,invite:I}=e,m=(0,A.VA)(t,n),S=_.A.getFrame(m);if(null!=S)return S.intent===A.sV.MAIN&&(T(m),g({frameId:m,layoutMode:A.y0.FOCUSED})),m;(0,A.Yf)(n)===A.sV.MAIN&&(o(),p());let N=++h;i.h.dispatch({type:"FRAME_LAUNCH_START",applicationId:t,frameId:m,surface:n,hostWindowKey:E,launch:s,invite:I,launchRequestId:N});try{let[e]=await Promise.all([(0,r.D2)(t,(0,u.A)(n),n.type,I),(0,c.A)(t)]);return i.h.dispatch({type:"FRAME_LAUNCH",applicationId:t,frameId:m,surface:n,proxyTicket:e,analyticsContext:l,launch:s??{},invite:I,hostWindowKey:E,launchRequestId:N}),m}catch(e){if(f){let n=await (0,a.f)(e,t);(0,d.A)(n.message)}throw i.h.dispatch({type:"FRAME_LAUNCH_FAIL",applicationId:t,frameId:m,launchRequestId:N,error:e,analyticsContext:l}),e}}function p(){let e=_.A.getMainFrame();null!=e&&(e.intent===A.sV.MAIN?(0,E.r)(e.id):m(e.id))}function m(e){_.A.getMainFrame()?.id===e&&(L(e),i.h.dispatch({type:"FRAME_CLEAR_MAIN_SLOT",frameId:e}))}function T(e){null!=_.A.getFrame(e)&&_.A.getMainFrame()?.id!==e&&(o(),p(),i.h.dispatch({type:"FRAME_PROMOTE",frameId:e}))}function g(e){let{frameId:t,layoutMode:n}=e,r=_.A.getFrame(t);null!=r&&i.h.dispatch({type:"FRAME_UPDATE_LAYOUT_MODE",applicationId:r.applicationId,frameId:t,layoutMode:n})}function S(e,t){i.h.dispatch({type:"FRAME_SET_RUNS_IN_BACKGROUND",frameId:e,enabled:t})}function N(e,t){i.h.dispatch({type:"FRAME_SET_PICTURE_IN_PICTURE_INTERACTIVE",frameId:e,enabled:t})}function C(e){N(e,!1)}function O(e,t){i.h.dispatch({type:"FRAME_SET_USER_MUTED",frameId:e,muted:t})}function R(e,t){i.h.dispatch({type:"FRAME_SET_PANEL_MODE",frameId:e,activityPanelMode:t})}function L(e){g({frameId:e,layoutMode:A.y0.FOCUSED}),R(e,f.Gd.PANEL)}function y(e,t){i.h.dispatch({type:"FRAME_IFRAME_MOUNT",frameId:e,iframeId:t})}function D(e,t){i.h.dispatch({type:"FRAME_IFRAME_UNMOUNT",frameId:e,iframeId:t})}function b(e,t){i.h.dispatch({type:"FRAME_HOST_WINDOW_MOUNT",frameId:e,windowKey:t})}function v(e,t){i.h.dispatch({type:"FRAME_HOST_WINDOW_UNMOUNT",frameId:e,windowKey:t})}async function P(e){let t=_.A.getFrame(e);if(null==t)return!1;let{applicationId:n,surface:s}=t,l=(0,A.x1)(t)?t.data.invite:t.invite;i.h.dispatch({type:"FRAME_SET_PROXY_TICKET_REFRESHING",applicationId:n,frameId:e,refreshing:!0});try{let t=await (0,r.D2)(n,(0,u.A)(s),s.type,l);i.h.dispatch({type:"FRAME_UPDATE_PROXY_TICKET",applicationId:n,frameId:e,proxyTicket:t})}catch(t){let e=await (0,a.f)(t,n);return(0,d.A)(e.message),!1}finally{i.h.dispatch({type:"FRAME_SET_PROXY_TICKET_REFRESHING",applicationId:n,frameId:e,refreshing:!1})}return!0}}