PageSourceSearch

https://www.tvb.com/assets/index-CuOsKUtN.js

js tvb.com collected 2026-09-24 17:15:20 UTC 7,689 bytes, 2 lines download raw bytes

1import{T as ut}from"./index-DC1iFGm2.js";import{u as dt,s as mt}from"./index-DJc6Tgko.js";import{_ as gt,aY as Y,b as o,c as i,F as $,r as z,j as L,h as F,m as O,d as q,t as J,e as x,az as U,A as ht,f as Z,x as A,i as pt,w as G,a4 as _t,o as ft,a8 as X,s as bt,k as H,aZ as vt,y as k}from"./index-B97kF60y.js";const wt={class:"tvb-photo-gallery"},yt={key:0,class:"photo-gallery-horizontal"},kt=["alt"],xt={key:0,class:"photo-gallery__remainder"},St={key:1,class:"photo-gallery-vertical"},$t=["alt"],At={key:0,class:"tvb-img_des"},Tt={__name:"index",props:{mode:{type:String,default:"horizontal"},images:{type:Array,default:()=>[]}},emits:["imgClick"],setup(b){const m=b,v=A(()=>m.mode==="horizontal"?m.images.slice(0,5):m.images),c=A(()=>m.images.length>5?m.images.length-5:0),T=g=>{switch(v.value.length){case 1:return"col-span-12";case 2:return"col-span-6";case 3:return"col-span-4";case 4:return"col-span-6";default:return g===0||g===1?"col-span-6":"col-span-4"}};return(g,C)=>{const h=ht,p=Y("lazy");return o(),i("div",wt,[b.mode==="horizontal"?(o(),i("div",yt,[(o(!0),i($,null,z(v.value,(n,_)=>(o(),L(h,U({key:_,to:n.jump_url},{ref_for:!0},n.jump_url?{linkRel:n.rel?2:1,linkTarget:n.target?2:1}:null,{class:["photo-gallery__image-wrap",T(_)],onClick:w=>g.$emit("imgClick",n)}),{default:F(()=>[O(q("img",{class:"photo-gallery__cover",alt:n.image_alt_text},null,8,kt),[[p,n.thumb.medium]]),v.value.length===_+1&&c.value>0?(o(),i("div",xt," +"+J(c.value),1)):x("",!0)]),_:2},1040,["to","class","onClick"]))),128))])):x("",!0),b.mode==="vertical"?(o(),i("div",St,[(o(!0),i($,null,z(v.value,(n,_)=>(o(),i("figure",{key:_},[Z(h,U({to:n.jump_url},{ref_for:!0},n.jump_url?{linkRel:n.rel?2:1,linkTarget:n.target?2:1}:null,{class:["photo-gallery__image-wrap",{"tvb-img_href":n.jump_url}],onClick:w=>g.$emit("imgClick",n)}),{default:F(()=>[O(q("img",{class:"photo-gallery__cover",alt:n.image_alt_text},null,8,$t),[[p,n.thumb.medium]])]),_:2},1040,["to","class","onClick"]),n.description?(o(),i("figcaption",At,J(n.description),1)):x("",!0)]))),128))])):x("",!0)])}}},Ct=gt(Tt,[["__scopeId","data-v-aeb96b6c"]]),It=["id"],zt=["innerHTML"],Nt={class:"article-editor-content-video"},Mt={__name:"index",props:{content:{type:Array,default:()=>[]},id:{type:[String,Number],default:null},img:{type:String,default:""},thumbnail:{type:String,default:""}},emits:["viewerShown","viewerChange"],setup(b,{expose:m,emit:v}){const c=b,T=v,g=pt("size"),C=A(()=>["s","xs"].includes(g.value)),h=A(()=>K(c.content)),p=k([]),n=A(()=>c.img?[{src:c.img,thumbnail:c.thumbnail},...p.value]:p.value),_=e=>{T("viewerChange",e),window.history.replaceState(history.state,null,X(location.origin+location.pathname+`?photo_id=${mt.sha1(e.currSlide.data.src)}`))},{lightbox:w}=dt(n,_),K=(e=[])=>{const a=JSON.parse(JSON.stringify(e));for(const s of a)s.type===1&&(s.rich_text.html=P(s.rich_text.html)),s.type===2&&tt(s.image);return a},Q=e=>`javascript:window.scrollBy({top: document.getElementById('${e.substr(1)}').getBoundingClientRect().top - (document.querySelector('.editor-content-view-mobile') ? 84 : 64)})`,W=e=>{let a=new RegExp(/(<img )([^>]*)(src=")([^"]*")([^>]*)(>)/,"g");return e.replace(a,function(u,t,l,y,d,R,I){return t+l+'data-src="'+d+R+I})},P=e=>{var a,s,u,t,l,y;try{const d=new DOMParser().parseFromString(e,"text/html"),R=d.querySelectorAll("img");let I=[];for(const r of R){const f=(a=r.dataset)==null?void 0:a.desc,D=(s=r.dataset)==null?void 0:s.href,lt=(u=r.dataset)!=null&&u.rel?r.dataset.rel??"follow":"follow",ct=(t=r.dataset)!=null&&t.target?r.dataset.target??"_self":"_self";let S=W(r.outerHTML);D?S=`<a class="tvb-img_href" href="${D}" target="${ct}" rel="${lt}" >${S}</a>`:I.push({src:r.src,"data-desc":f||""}),S=`<figure class="tvb-img_des-wrap">${S}${f?`<figcaption class='tvb-img_des'>${f}</figcaption>`:""}</figure>`,r.outerHTML=S}p.value.push(...I);const ot=d.querySelectorAll("a");for(const r of ot){const f=(y=(l=r==null?void 0:r.attributes)==null?void 0:l.href)==null?void 0:y.value;f&&f.trim().indexOf("#")===0&&(r.href=Q(f),r.target="")}const rt=d.querySelector(".instagram-media"),it=d.querySelector(".twitter-tweet");return rt&&(N.value=!0),it&&(B.value=!0),d.body.innerHTML}catch{return e}},N=k(!1),B=k(!1);G(()=>[N.value,B.value],()=>{N.value&&setTimeout(()=>{var e;(e=window.instgrm)==null||e.Embeds.process()},500),B.value&&setTimeout(()=>{var e;(e=window.twttr)==null||e.widgets.load(document.getElementById(`editor${c.id}`))},500)},{flush:"post"});const tt=e=>{if(e!=null&&e.images){const a=e.images.map(s=>({src:s.thumb.large,thumbnail:s.thumb.small,"data-desc":s.description||""}));p.value.push(...a)}},et=e=>n.value.findIndex(a=>a.src===e),j=(e,a=0)=>{var t;const s=e?et(e):a,u=s>-1?s:0;(t=w.value)==null||t.loadAndOpen(u)},st=e=>{var s;const a=e.target;if((a==null?void 0:a.localName)==="img")try{if((s=a==null?void 0:a.dataset)!=null&&s.href)return;j(a==null?void 0:a.src)}catch(u){console.warn(u)}},at=e=>{e.jump_url||j(e.thumb.large)};G(h,()=>{V()});const nt=k(),E=k([]),M=k(1e3),V=()=>
1{E.value=[],document.querySelectorAll("div[data-video-src]").forEach(e=>{M.value=M.value+1;const a=e.id?e.id:"tvb-video-"+M.value;e.id=a;var s={article_id:c.id,type:_t(e.getAttribute("data-video-type")),video_id:e.getAttribute("data-video-id"),video_url:e.getAttribute("data-video-src"),content_id:e.getAttribute("data-content-id"),title:e.getAttribute("data-title"),program_title:e.getAttribute("data-program-title"),cover:e.getAttribute("data-cover-large"),video_clarity:{},subtitle:{},element_id:a,id:""};e.getAttribute("data-video-clarity")&&(s.video_clarity=JSON.parse(e.getAttribute("data-video-clarity"))),e.getAttribute("data-subtitle")&&(s.subtitle=JSON.parse(e.getAttribute("data-subtitle"))),s.id=`tvb-player-article-video-${s.video_id}`,document.getElementById(s.id)==null&&E.value.push(s)})};return ft(()=>{w.value.on("initialLayout",()=>{T("viewerShown",w.value.pswp)}),w.value.on("close",()=>{window.history.replaceState(history.state,null,X(location.origin+location.pathname))}),bt(()=>{V()})}),m({showViewer:j,richTextImgs:n}),(e,a)=>{const s=ut,u=Y("lazy-container");return o(),i("div",{id:`editor${b.id}`,class:H(["editor-content-view article-editor-content-view",{"article-editor-content-view-mobile":C.value}])},[(o(!0),i($,null,z(h.value,(t,l)=>{var y;return o(),i($,{key:l},[t.type===1?O((o(),i("div",{key:0,class:H(["richtext",{"frist-child":l===0,"last-child":l===h.value.length-1}]),innerHTML:(y=t.rich_text)==null?void 0:y.html,onClick:st},null,10,zt)),[[u,{selector:"img"}]]):x("",!0),t.type===2&&t.image.images.length>0?(o(),L(Ct,{key:1,class:H(["e-photo-gallery",{"frist-child":l===0,"last-child":l===h.value.length-1,mobile:C.value}]),images:t.image.images,mode:t.image.layout===2?"vertical":"horizontal",onImgClick:at},null,8,["class","images","mode"])):x("",!0)],64)}),128)),(o(!0),i($,null,z(E.value,(t,l)=>(o(),i("div",{key:l},[(o(),L(vt,{to:`#${t.element_id}`,key:t.element_id},[q("div",Nt,[Z(s,{class:"article-editor-content-video-player",ref_for:!0,ref_key:"tvbPlayerRef",ref:nt,id:t.id,src:t.video_url,type:t.type,"content-id":t.content_id,"region-only":t==null?void 0:t.region_only,title:t==null?void 0:t.title,"video-clarity":t==null?void 0:t.video_clarity,subtitle:t==null?void 0:t.subtitle,"youbora-options":{videoTitle:t==null?void 0:t.title,programTitle:t==null?void 0:t.program_title,videoSrc:t==null?void 0:t.video_url,contentId:t==null?void 0:t.video_id,articleId:t==null?void 0:t.article_id},mute:!0,posterUrl:t.cover},null,8,["id","src","type","content-id","region-only","title","video-clarity","subtitle","youbora-options","posterUrl"])])],8,["to"]))]))),128))],10,It)}}};export{Mt as _};
2//# sourceMappingURL=index-CuOsKUtN.js.map

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.