import{aX as j,az as a,bu as E,aj as C,b4 as R,bw as i,dm as S,cp as F,eb as U,ec as k,fb as A,p as I,fe as G,fd as L,bN as O,bO as T,ao as s,aZ as H,ff as K,h5 as N}from"./app-k0jcl5PQ.js";import{u as B}from"./CtFw3Moj.chunk.js";import{u as _}from"./CAxN5LKv.chunk.js";import{u as z}from"./DDxzgH2W.chunk.js";import{u as D}from"./DgW9Cwsn.chunk.js";import{u as X,P as Z,a as J}from"./B2qQOI1p.chunk.js";import{u as Q}from"./4IZETxJX.chunk.js";import"./DIAJ896Y.chunk.js";import"./1YwtoG9U.chunk.js";import"./BZa85bFL.chunk.js";import"./BYBYoVkn.chunk.js";import"./D1WNsOm8.chunk.js";import"./U4M4wGTR.chunk.js";import"./BgZMo0y9.chunk.js";import"./BhYYYlpK.chunk.js";import"./FGhEvk_q.chunk.js";import"./WCBjpMHJ.chunk.js";import"./DoFMWlew.chunk.js";import"./CMnqIsoM.chunk.js";import"./CX9BGBTP.chunk.js";import"./uoUaCILN.chunk.js";import"./DXJ2-V8v.chunk.js";import"./DH1mz64H.chunk.js";import"./BlKMjFEf.chunk.js";import"./CofWDDSQ.chunk.js";import"./DwvfEevL.chunk.js";import"./D9SGbB34.chunk.js";import"./BwBaQklX.chunk.js";import"./ByBCp1MC.chunk.js";import"./eerUhItV.chunk.js";import"./Cukd0Qmt.chunk.js";import"./B31bqZwo.chunk.js";import"./f_twTV5Z.chunk.js";import"./BDeUEvb2.chunk.js";import"./Daim1zo7.chunk.js";import"./B3XH0kWB.chunk.js";import"./BRhv_AHY.chunk.js";import"./BDviDDog.chunk.js";import"./wCY37Ze3.chunk.js";import"./CIN5bTKK.chunk.js";import"./DdN4NAtQ.chunk.js";import"./CBiwFpxE.chunk.js";import"./BUtU6IOA.chunk.js";import"./DAIetGMf.chunk.js";import"./TReHo2Ua.chunk.js";import"./Bj7bJt_4.chunk.js";import"./CGYNvpr2.chunk.js";import"./Bw9otuBi.chunk.js";import"./BvnABNse.chunk.js";import"./Bh7bFXwG.chunk.js";import"./DCdUbbLx.chunk.js";import"./t24_x3Gi.chunk.js";import"./CCtuxSlD.chunk.js";import"./CPXlV0fg.chunk.js";import"./0f3cnETk.chunk.js";import"./BqNArZps.chunk.js";import"./D62ACZel.chunk.js";import"./BBUCoOir.chunk.js";import"./BrY2bcAL.chunk.js";import"./BHJbqrq4.chunk.js";import"./BAuuQuuB.chunk.js";const W={notFound:N,forbidden:{privacy:K}};function Y(t){return(t==null?void 0:t._parentClip)||(t==null?void 0:t._parentVideo)}function me(t){var P,f,y,b,l;const{hasPermissions:q}=j(),d=a(E.config()),m=a(C.token()),r=a(C.currentUser()),h=a(((P=r.data)==null?void 0:P.isAuthenticated)&&R.yearGroups(r.data.customerId)),e=a(i.interactiveMetadata(t.id)),o=X(),V=a(e.statusCode===S.Forbidden&&i.interactiveMetadata(t.id,F.StripMetadata)),c=a(o&&e.data&&i.interactive(e.data.interactiveId)),g=a(o&&e.data&&i.videoInteractives(Y(e.data).id)),p=D(),u=a(U.createViewKey(t.id,k.MasterObject)),n=A({video:e.data,context:t.queryParams.context,contextId:t.queryParams.contextId,moviesAndTv:t.queryParams.mtv,currentUser:r.data}),x=o?I.PreviewInteractive:I.PlayInteractive,{commonVideoProps:v,hasCommonVideoPropsCompleted:M}=z({locationContext:x,mtv:t.queryParams.mtv});G({id:t.id,app:"interactives"}),_(e,W,{forbidden:!0}),L(V),O(T.getInteractiveMetadata({content:e.data})),Q(n.videos??[]);const w=B({name:(f=e.data)==null?void 0:f.name});return e.data&&d.hasCompleted&&r.hasCompleted&&(!o||c.hasCompleted)&&u.hasCompleted&&m.hasCompleted&&M?o?s.jsx(Z,{currentUser:r.data,queryParams:t.queryParams,interactive:e.data,interactives:(y=g.data)==null?void 0:y.data,isPreviewPreventScrubbingEnabled:c.data.preventScrubbing,audiences:p.data,relatedVideos:n,canManageVideoAccess:q(H.ManageVideoAccess),breadcrumbs:w,token:m.data,commonVideoProps:v}):s.jsx(J,{interactive:e.data,currentUser:r.data,config:d.data,yearGroups:h.data,audiences:p.data,queryParams:t.queryParams,viewKey:u.data,relatedVideos:n,startTime:((b=t.queryParams)==null?void 0:b.t)??((l=t.queryParams)==null?void 0:l.startTime),token:m.data,commonVideoProps:v}):s.jsx(s.Fragment,{})}export{me as InteractiveView};
//# sourceMappingURL=BDw__X7c.chunk.js.map
