import{cc as h,cd as l,cz as g,fu as x,ao as n,cu as m,dg as f,dh as p,ba as v,aq as j}from"./app-k0jcl5PQ.js";import{L as y}from"./Cukd0Qmt.chunk.js";import{I}from"./B31bqZwo.chunk.js";import{u as k}from"./f_twTV5Z.chunk.js";import{E as L,I as S}from"./uoUaCILN.chunk.js";const b="_captionsBadge_1hxkj_1",C={captionsBadge:b};function N(e){var s,r,u,d,i,t;if(!e.video.description&&!((s=m.getCanBeConsumed(e.video))!=null&&s.canNavigate))return n.jsx("em",{children:m.getPrivacyReasoning(e.video,e.showSignIn)});const a=!!((d=(u=(r=e.video)==null?void 0:r.subtitles)==null?void 0:u.data)!=null&&d.length);return n.jsxs(n.Fragment,{children:[a&&n.jsx("span",{className:`d-inline-block align-middle ${C.captionsBadge}`,children:n.jsx(f,{type:p.Captions,data:(i=e.video)==null?void 0:i.subtitles})}),!!((t=e.video)!=null&&t.productionYear)&&n.jsxs("span",{className:"fw-semibold align-middle",children:[a?" • ":"",e.video.productionYear]}),!!e.video.description&&n.jsx("span",{className:"align-middle",dangerouslySetInnerHTML:{__html:`${e.video.productionYear||a?" • ":""}${y.linkifyText(e.video.description)}`}})]})}function F(e){var r;const a=h(l.XS),s=!!g.getRestrictionByType((r=e.video)==null?void 0:r._restrictions,x.User);return a?n.jsx(n.Fragment,{}):s&&!e.hasStudentExperience&&!e.hasGuestExperience?n.jsx(n.Fragment,{}):n.jsx("div",{className:"position-relative overflow-hidden clamp-2",children:n.jsx("p",{className:"m-0",children:n.jsx(N,{video:e.video,showSignIn:e.showSignIn})})})}const w="shared.interactiveItem";function T(e){const a=k();return typeof e=="number"?e:a===l.XS?3:a===l.SM?1:a===l.MD||a===l.LG?2:3}function R(e){var d;const a=T(e.totalToDisplay);if(!((d=e.timepoints)!=null&&d.length))return n.jsx(n.Fragment,{});const s=[];let r=0;e.timepoints.forEach(i=>{i==null||i.interactions.forEach(t=>{if(L[t.typeId]||r>=a)return;r++;const c=t.typeId===S.Annotation&&typeof t.data=="string"?JSON.parse(t.data):t.data,o={...t,data:{...c,appLink:e.appLink&&{...e.appLink,params:{t:Math.floor(i.visibleAt/1e3)}}}};s.push(o)})});const u=e.timepoints.reduce((i,t)=>{var o;const c=((o=t==null?void 0:t.interactions)==null?void 0:o.length)??0;return i+=c,i},0);return s.length?n.jsxs(n.Fragment,{children:[s.map((i,t)=>{var c,o;return n.jsx("div",{className:"d-flex align-items-center mb-1",children:n.jsx("div",{className:"clamp-1",children:n.jsx(I,{interaction:i,appLink:(c=i.data)==null?void 0:c.appLink,onClick:(o=i.data)!=null&&o.appLink?e.onClickAppLink:null,smallIcon:!0})})},t)}),n.jsx("div",{className:"mb-1 text-link",children:n.jsx(v,{className:"cursor-pointer hover-text-underline",appLink:e.previewAppLink,onClick:e.onClickAppLink,children:n.jsx(j,{namespace:w,phrase:"previewQuestions",options:{questionsShown:s.length,smartCount:u}})})})]}):n.jsx(n.Fragment,{})}export{R as I,F as V};
//# sourceMappingURL=eerUhItV.chunk.js.map
