1import{_ as ze}from"./XUCf_oQm.js";import{b as Oe,e as Ge,f as qe,ae as He,g as Ue,au as Ye,a1 as se,q as je,N as Qe,a4 as Ze,aZ as Je,r as n,s as l,v as i,A as t,Q as oe,V as b,x as w,R as F,a2 as Ke,F as ie,z as ae,aC as Xe,bk as ne,y as le,a7 as et,a0 as tt,B as re,a6 as I,C as st,dp as ot,a8 as it,D as r,dq as at,dr as nt,bn as lt,G as a}from"./ByjodPhJ.js";import{_ as rt}from"./CHi6rdsj.js";import{_ as ct}from"./CesQfTDu.js";import{_ as dt}from"./SN_jJbpu.js";import{_ as _t}from"./DbLhsrLn.js";import{u as ut,F as vt}from"./Cfly741z.js";import{b as gt}from"./B9HbF4tI.js";import{u as pt}from"./t4VUW883.js";const mt={"g-scroll-trigger-item":""},ft={class:"media-2xl"},ht={class:"main__container"},yt={class:"content__container"},bt={class:"tags-box"},kt={key:0,class:"extra-tags-box"},Et={class:"item"},Ct={class:"ds-button btn btn-secondary-book btn--lg"},wt={class:"title-box"},St={class:"title"},Vt={class:"share-popup-box"},xt={class:"share-list"},At=["aria-label","onClick"],Pt={class:"media__container"},It=["data-index"],Nt={class:"banner-item"},$t={key:0,class:"video__outer"},Bt={class:"video__anime"},Lt=["id"],Dt=["src","type"],Ft={key:0,class:"action__container"},Rt={class:"flicking-sub-control-box"},Wt={class:"counter-box"},Mt={class:"arrows-box"},R=733,W=412,Tt=Oe({__name:"index",props:{id:{},type:{default:""},data:{default:null},blockIndex:{default:0}},emits:["widget:loaded","widget:not-exist","widget:empty"],setup(ce,{emit:de}){const{$useMedia:_e,$getSiteProperty:M}=Ge(),T=qe(),{isPageOpenDoneInProgress:ue}=He(T),{screenResizeState:z}=it(),O=gt(ce),{type:Ot,data:v,blockIndex:Gt,blockUniqueId:ve,isFirstWidget:ge}=O,pe=de;Ue();const S=r(),G=r(),N=r([]),d=r(null),$=`brand_video_${ve.value}`,_=r(!1),V=r(!1);Ye(G,()=>V.value=!1);const me=[{icon:"ds-ico-link",ariaLabel:"copy text",fn:()=>{at(window.location.href)}},{icon:"ds-ico-whatsapp",ariaLabel:"share whatsapp",fn:()=>q("whatsapp")},{icon:"ds-ico-facebook-solid",ariaLabel:"share facebook",fn:()=>q("facebook")}],q=async e=>{const s=nt(e,window.location.href);lt(s,{open:{target:"_blank"}})},fe=r(!1),he=a(()=>v.value?.field_main_title||""),H=a(()=>v.value?.field_tag),ye=a(()=>v.value?.field_categories?.list||[]),x=a(()=>v.value?.field_image?.list||[]),be=a(()=>v.value?.field_video_cover?.list||[]),ke=a(()=>v.value?.field_video_cover_mobile?.list||[]),Ee=a(()=>(v.value?.field_image?.list||[]).map((e,s)=>{if(I.isVideo(e.field_media_video_file?.filemime)&&T.isWechatDevice){const h=be.value[s]||void 0,p=ke.value[s]||void 0;return{field_media:_e.min("md")?h:p}}else return{field_media:e}})||[]),f=a(()=>x.value.length),Ce=a(()=>!x.value.some(e=>e.type===I.config.str_media_video_type)),we=a(()=>x.value.length===1),Se=a(()=>e=>e?I.isVideo(e):!1),Ve=a(()=>!M().med),B=()=>{d.value?(d.value?.play(),_.value=!0):(N.value.forEach(e=>{const{videoEl:s}=e;xe(s)}),_.value=!1)},xe=e=>{e&&(e.pause(),e.currentTime=0)},Ae=()=>{d.value?.pause(),_.value=!1},U=()=>{const e=A.value?.currentPanel?.element;if(e){const s=e.querySelector("video")?.id;d.value=N.value.findLast(g=>g.id===s)?.videoEl||null}},Y=()=>{const e=S.value;if(e)try{const s=e.querySelectorAll(".video__anime"),h=e.querySelector(".video__outer").getBoundingClientRect(),p=R,E=W,y=1,L=E/p,C=h.width,o=h.height;
1s.forEach(c=>{const m=c,P=c.querySelector(".brand-video");if(o/C<L){const D=E/p*C;P.style.width=m.style.width=`${C*y}px`,P.style.height=m.style.height=`${D*y}px`}else{const D=p/E*o;P.style.width=m.style.width=`${D*y}px`,P.style.height=m.style.height=`${o*y}px`}})}catch{}},A=r(),j=r(!1),Pe={align:"prev",circular:!0,preventDefaultOnDrag:!0,moveType:["strict",{count:1}]},Ie=Ce.value?{kind:"autoplay",autoplay:{duration:7}}:{kind:"default",group_item_length:1},{onFlickingReady:Ne,onFlickingChanged:$e,onFlickingHoldEnd:Be,slidePrev:Le,slideNext:De,_autoPlay:u,indexNextWill:Fe}=ut({flickingEl:A,...Ie}),Re=e=>{if(Ne(e),U(),f.value<=1&&A.value?.disableInput(),f.value>1){u?.au_createTimeline();const s=S.value;if(s){const{top:g}=s?.getBoundingClientRect();g>window.innerHeight&&u?.tlProgress()?.pause()}}j.value=!0},We=e=>{$e(),U(),B()},Q=r(!1),Z=()=>{const e=S.value;e&&e.classList.remove("start-will-change")},{onVgstCreated:J,onVgstEnter:K,onVgstLeaveBack:X,onVgstLeave:ee,onVgstEnterBack:te,vgstOn:k}=pt();k("enterOnce",()=>{Q.value=!0}),k("enter",()=>{u?.tlProgress()?.resume(),d.value?.play(),_.value=!0}),k("leaveBack",()=>{u?.tlProgress()?.pause(),d.value?.pause(),_.value=!1,Z()}),k("leave",()=>{u?.tlProgress()?.pause(),d.value?.pause(),_.value=!1,Z()}),k("enterBack",()=>{u?.tlProgress()?.resume(),d.value?.play(),_.value=!0});const Me=a(()=>Q.value&&ue.value&&j.value),Te=()=>{f.value>1?u?.au_autoPlay():f.value===1&&B()};return se(()=>Me.value,e=>{e&&Te()}),se(()=>z.resizeComplete||z.resizing,e=>{e&&Y()}),je(async()=>{await Qe(),Y(),pe("widget:loaded",O)}),Ze(()=>{u?.clearDeep()}),(e,s)=>{const g=ze,h=et,p=rt,E=ct,y=dt,L=_t,C=Je("g-scroll-trigger");return n(),l("div",st({class:"widget--details",ref_key:"sectionEl",ref:S},{"data-scroll":!0,"data-scroll-class":"CLASSNAME_IN_VIEW"in e?e.CLASSNAME_IN_VIEW:t(ne),"data-bg-img-loaded":t(fe)?"CLASSNAME_BG_IMG_READY"in e?e.CLASSNAME_BG_IMG_READY:t(ot):null,"data-no-image":t(f)<=0},{style:`--image-w: ${R}; --image-h: ${W};`}),[i("div",mt,[i("div",ft,[i("div",ht,[i("div",yt,[i("div",bt,[t(H)?(n(),l("div",kt,[i("div",Et,[i("label",Ct,oe(t(H).name),1)])])):b("",!0),i("div",null,[w(g,{"font-size":"l",categories:t(ye).map(o=>({title:o.name||"",path:o.path?.alias||""}))},null,8,["categories"])])]),i("div",wt,[i("h2",St,[i("span",null,oe(t(he)),1)])]),t(Ve)?(n(),l("div",{key:0,class:F(["share-box",{active:t(V)}]),ref_key:"shareBoxEl",ref:G},[i("button",{type:"button",class:"share-item --target","aria-label":"open share media",onClick:s[0]||(s[0]=o=>V.value=!t(V))},[i("i",{class:F(t(M)()[("ESiteProperty"in e?e.ESiteProperty:t(Ke)).sc]?"ds-ico-arrow-share":"ds-ico-share")},null,2)]),i("div",Vt,[i("div",xt,[(n(),l(ie,null,ae(me,(o,c)=>i("div",{class:"item",key:"share_"+c},[i("button",{type:"button",class:"share-item","aria-label":o.ariaLabel,onClick:m=>o.fn()},[i("i",{class:F(o.icon)},null,2)],8,At)])),64))])])],2)):b("",!0)]),t(x).length>0?Xe((n(),l("div",{key:0,class:"image__container",onVgstCreated:s[1]||(s[1]=(...o)=>t(J)&&t(J)(...o)),onVgstEnter:s[2]||(s[2]=(...o)=>t(K)&&t(K)(...o)),"on:vgst-leaveBack":s[3]||(s[3]=(...o)=>t(X)&&t(X)(...o)),onVgstLeave:s[4]||(s[4]=(...o)=>t(ee)&&t(ee)(...o)),"on:vgst-enterBack":s[5]||(s[5]=(...o)=>t(te)&&t(te)(...o))},[i("div",Pt,[w(t(vt),{ref_key:"flickingEl",ref:A,class:"widget--details-flicking",options:Pe,hideBeforeInit:!0,onReady:Re,onChanged:We,onHoldEnd:t(Be)},{default:le(()=>[(n(!0),l(ie,null,ae(t(Ee),(o,c)=>(n(),l("div",{class:"panel","data-index":c,key:`${$}-${c}`},[i("div",Nt,[t(Se)(o.field_media?.field_media_video_file?.filemime)?(n(),l("div",$t,[i("div",Bt,[w(h,null,{default:le(()=>[i("video",{id:`${$}-${c}`,class:"video brand-video",ref_for:!0,ref:m=>t(N).push({id:`${$}-${c}`,videoEl:m}),muted:"",loop:"",playsinline:"",onClick:Ae},[("publicEnv"in e?e.publicEnv:t(tt))().isDev?b("",!0):(n(),l("source",{key:0,src:`${o.field_media?.field_media_video_file?.uri?.url}#t=0.1`,type:o.field_media?.field_media_video_file?.filemime},null,8,Dt)),s[6]||(s[6]=i("p",null,"Your browser doesn't support HTML5 video.",-1))],8,Lt)]),_:2},1024),t(_)?b("",!0):(n(),re(p,{key:0,onClick:B}))])])):(n(),re(E,{key:1,src:o.field_media?.field_media_image?.image_style_uri?.large,srcset:("$DrupalUtils"in e?e.$DrupalUtils:t(I)).buildSrcset(o.field_media?.field_media_image),"sizes-config":[{breakpoint:768,size:"100vw"},{breakpoint:1280,size:"50vw"}],width:R,height:W,priority:t(ge),alt:o?.field_media?.field_media_image?.alt||""},null,8,["src","srcset","priority","alt"]))])],8,It))),128))]),_:1},8,["onHoldEnd"])]),t(we)?b("",!0):(n(),l("div",Ft,[i("div",Rt,[i("div",Wt,[w(y,{"current-index":(t(Fe)+1).pad(),total:t(f).pad()},null,8,["current-index","total"])]),i("div",Mt,[w(L,{onPrev:t(Le),onNext:t(De)},null,8,["onPrev","onNext"])])])]))],32)),[[C,{options:{scrub:.6,start:"0% 100%",end:"100% 0%"},toggleClassOnlyEnterClassName:"CLASSNAME_IN_VIEW"in e?e.CLASSNAME_IN_VIEW:t(ne),toggleClassOnlyEnter:!0}]]):b("",!0)])])])],16)}}}),Xt=Object.assign(Tt,{__name:"WidgetsWidgetDetailsWidget"});export{Xt as default};
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.