PageSourceSearch

https://www.straitstimes.com/assets/Video-BbxsKzYF.js

js straitstimes.com collected 2026-09-24 07:41:59 UTC 4,649 bytes, 1 lines download raw bytes

1import{A as e,E as t,I as n,T as r,j as i,k as a}from"./chunk-KS7C4IRE-DIkipulk.js";import{t as o}from"./jsx-runtime-CsaOnxTR.js";import{l as s}from"./components-JSzoenoU.js";import{Ba as c,Bi as l,Ji as u,Pn as d,Pr as f,Qi as p,Va as m,X as h,Zi as g,aa as _,an as v,da as y,ea as b,ei as x,ha as S,ia as C,ki as w,ni as T,qi as E,ra as D,zi as O}from"./Elements-BJgAzht_.js";import{n as k,t as A}from"./ssr-CJ2n4bG3.js";import{t as j}from"./JSONLD-p5Fx8-kT.js";import{t as M}from"./PageLayout-VSFjvclv.js";import{n as N,t as P}from"./MetaTags-DxD1Vn5J.js";import{t as F}from"./StatusHandler-BAQGTOm7.js";import{r as I,t as L}from"./adsHelper-D-PUDSBN.js";import{t as R}from"./VideoPlayer-CnOIHHVD.js";var z=o();function B({testId:e=`featured-video-baseline-test-id`,className:t,id:n,uniqueId:r,thumbnail:i,formattedTime:a,name:o}){return n?(0,z.jsxs)(C,{type:_.CUSTOM,className:c(`video-card cursor-pointer`,t),url:`/videos/${n}`,"aria-label":`video card button for ${o}`,testId:e,children:[(0,z.jsxs)(`div`,{className:`relative self-stretch justify-items-center layer-disabled`,children:[(0,z.jsx)(`img`,{src:i,alt:o}),(0,z.jsxs)(`div`,{className:`video-card-overlay`,children:[(0,z.jsx)(T,{iconName:m.MULTIMEDIA_PLAY,className:`icon-inverse`}),(0,z.jsx)(E,{type:p.CAPTION,size:b.BASELINE,weight:D.FORTY,className:`text-on-primary pb-2`,children:a})]})]}),(0,z.jsx)(u,{type:g.HEADLINE,size:b.SM,weight:D.FORTY,className:`text-left text-primary pt-16 desktop:pb:00`,children:o})]},r):(0,z.jsx)(z.Fragment,{})}var V=n(i(),1),H=9,U=!1;function W(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.uniqueId==`number`&&typeof t.id==`string`&&typeof t.description==`string`&&typeof t.name==`string`&&typeof t.duration==`number`&&typeof t.thumbnail==`string`&&typeof t.poster==`string`&&typeof t.formattedTime==`string`}var G=e=>{let t=e.loaderData;if(t.type===A.SUCCESS){let e=t.payload.metaData;return N(e)}},K=e(function(){let[e,n]=(0,V.useState)(void 0),i=r(),{pathname:o}=t(),{videoId:s=``}=a();console.log(`Unique video ID, `,s);let c=I(v.DEFAULT,S(o)),l=y(c)?c[0]:void 0;if(U||=(L(c),!0),i.type===A.CLIENT_ERROR||i.type===A.SERVER_ERROR)return(0,z.jsx)(F,{response:i});let{latestVideos:u,gaData:p,metaData:m}=i.payload;return(0,V.useMemo)(()=>{async function e(){if(s!==``)try{let e=await f(`getvideobyid/`+s,`GET`);e&&W(e)?(n(e),P({...m,title:e.name,ogTitle:e.name,twitterTitle:e.name,description:e.description,ogDescription:e.description,image:e.thumbnail,slug:m?.slug??``,ogType:`video`}),h({...p,title:e.name,title_ga:e.name})):n(void 0)}catch{n(void 0)}else i.type===A.SUCCESS&&i.payload.videoDetail&&n(i.payload.videoDetail)}e()},[]),(0,z.jsxs)(M,{lb1Ad:l,children:[(0,z.jsx)(j,{type:w.VIDEO,schemaProps:i.payload.videoSchemaProps}),(0,z.jsx)(`div`,{children:(0,z.jsx)(`div`,{className:`container`,children:(0,z.jsx)(`div`,{className:`flex grid`,children:(0,z.jsxs)(`div`,{className:`w-full col-start-1 col-end-6 tablet:col-start-1 tablet:col-end-16 desktop:col-start-4 desktop:col-end-22`,children:[e&&(0,z.jsx)(R,{showAnyway:!0,showSocialShare:!0,autoPlay:o!=`/videos`,className:`p-00 mobile:pb-16 tablet:pt-16 tablet:pb-24 desktop:py-32`,videoClassName:`no-bleed`,id:e.id,uniqueId:e.uniqueId,poster:e.poster,name:e.name,description:e.description,variant:g.SECTION_SEO}),u?.title&&(0,z.jsx)(d,{title:u.title,className:`px-00`,variant:g.SECTION}),(0,z.jsx)(q,{videoCards:u?.videoCards}),(0,z.jsx)(`div`,{className:`pt-32`})]})})})})]})}),q=({videoCards:e})=>{let[t,n]=(0,V.useState)(H);return y(e)?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`grid grid-cols-1 tablet:grid-cols-3 gap-00 tablet:gap-x-24 desktop:gap-x-32 h-max`,children:e.slice(0,t).map((e,t)=>(0,z.jsx)(V.Fragment,{children:(0,V.createElement)(B,{...e,key:e.uniqueId,className:`px-00 tablet:py-16 desktop:py-24`,onClickHandler:()=>{s&&window.open(`/videos/${e.id}`,`_self`,`noopener noreferrer`)}})},`subsection-listing-latest-headline-headline-lg-${t}`))}),(0,z.jsx)(`div`,{className:c(`w-full text-center py-16 tablet:py-24 desktop:py-32`,(t>=39||e.length<=t)&&`hidden`,`transition-all duration-100 ease-linear`),children:(0,z.jsx)(x,{fill:O.OUTLINE,handler:()=>{n(e=>e+H)},size:l.DEFAULT,text:`Load more`})})]}):(0,z.jsx)(`div`,{})};async function J(e){let t=await k(e);if(!t.context)return console.error(`Error occured during client-side routing for video, returning server Loader Data`),await e.serverLoader();let n=t.context;return(!n||typeof n!=`object`||!(`payload`in n)||typeof n.payload!=`object`)&&console.error(`Client Loader: fetchContext() returned an invali
1d payload for video`),n}export{J as clientLoader,K as default,G as meta};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.