import{u as g,r as S,a as $,c as k,n as w,o as _,b as x,d as z,w as I,e as D,v as B,f as j,g as F,h as H,j as L,t as M,i as y,m as N}from"./index-DmCbOAxb.js";import{l as R,a as T}from"./containers-B-x1Py5x.js";import{_ as U}from"./_plugin-vue_export-helper-DlAUqK2U.js";const V={__name:"ClockContainer",props:{id:String,layoutId:String,partner:String,code:String},setup(v){g();const u="https://display24.ru",i=v,l=S(!1),h=S("");let d=null;const e=$({id:null,displayCode:null,layoutId:null}),b=k(()=>{var o,t,a,n,r,c,s,m,f;return{top:"".concat(e.top,"px"),left:"".concat(e.left,"px"),width:"".concat(e.width,"px"),height:"".concat(e.height,"px"),backgroundColor:w((o=e.background)==null?void 0:o.color)||w("#000"),zIndex:e.zIndex||0,border:"".concat(((t=e.border)==null?void 0:t.width)||0,"px ").concat(((a=e.border)==null?void 0:a.style)||"solid"," ").concat(((n=e.border)==null?void 0:n.color)||"#fff"),borderRadius:"".concat((r=e.border)==null?void 0:r.radius,"px"),boxShadow:"".concat((c=e.shadow)==null?void 0:c.x,"px ").concat((s=e.shadow)==null?void 0:s.y,"px ").concat((m=e.shadow)==null?void 0:m.b,"px ").concat((f=e.shadow)==null?void 0:f.color)}}),C=()=>{var o,t,a,n,r,c,s;switch((o=e.content)==null?void 0:o.mediaMode){case 1:return{objectFit:"fill",width:"100%",height:"100%",fontSize:((t=e.content)==null?void 0:t.fontSize)+"px",color:(a=e.content)==null?void 0:a.color};case 2:return{objectFit:"cover",width:"100%",height:"100%",fontSize:((n=e.content)==null?void 0:n.fontSize)+"px",color:(r=e.content)==null?void 0:r.color};default:return{objectFit:"none",fontSize:((c=e.content)==null?void 0:c.fontSize)+"px",color:(s=e.content)==null?void 0:s.color}}},p=()=>{var t;const o=N();h.value=o.format((t=e.content)!=null&&t.showSeconds?"HH:mm:ss":"HH:mm")};return _(async()=>{e.id=i.id,e.displayCode=i.code,e.layoutId=i.layoutId,await R(e,u,"ClockContainer (layouts)"),await T(e,l,u,"ClockContainer (schedule)"),p(),d=setInterval(()=>{p(),l.value=x(e==null?void 0:e.scheduleData)},1e3)}),z(()=>{d&&clearInterval(d)}),I(()=>e.scheduleData,o=>{l.value=x(o)}),(o,t)=>D((F(),j("div",{class:"container",style:y(b.value)},[H("",!0),L("div",{class:"content-clock",style:y(C())},M(h.value),5)],4)),[[B,l.value]])}},G=U(V,[["__scopeId","data-v-331a71a2"]]);export{G as default};
