"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("lodash"),c=require("../../utils/json2css.js"),h=["ztitle"],y=t.defineComponent({name:"zv-text-text-dynamic"}),v=t.defineComponent({...y,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},setup(d,{expose:f}){const o=d,p=()=>{const n=t.ref(""),r=e=>{c.autoInstallFont(e.fontFamily);const a={};e.color&&e.color.includes("linear-gradient")&&(a.backgroundImage=e.color,a["-webkit-background-clip"]="text",a.color="transparent");const w={};return e.textAlign==="left"&&(e.justifyContent="flex-start"),e.textAlign==="center"&&(e.justifyContent="center"),e.textAlign==="right"&&(e.justifyContent="flex-end"),{...c.jsonToCssStyle(e),...a,...w,...e.textShadow.show?{"--text-shadow":`${e.textShadow.x}px ${e.textShadow.y}px ${e.textShadow.value}px ${e.textShadow.color}`}:{}}},s=()=>{window.SHJDatasourceV2({tId:o.uuid,sources:o.sources,callback:({data:e})=>{try{window.SHJParseEvent(o.useEvents,"dataListener",e),n.value=e[0].data[0].value}catch{window.SHJParseEvent(o.useEvents,"dataListener",null)}}})};return t.onMounted(()=>t.nextTick(()=>s())),{rendererDomStyle:r,init:s,value:n}},{rendererDomStyle:x,init:i,value:u}=p();return t.watch(()=>l.cloneDeep(o.basicOption),(n,r)=>{l.isEqual(n,r)||i()},{deep:!0}),t.watch(()=>l.cloneDeep(o.sources),(n,r)=>{l.isEqual(n,r)||i()},{deep:!0}),f({refresh:()=>i(),refreshView:()=>i(),refreshData:()=>i()}),(n,r)=>(t.openBlock(),t.createElementBlock("p",{class:"zerov-widget-text",style:t.normalizeStyle(t.unref(x)(n.basicOption.css)),ztitle:t.unref(u)},t.toDisplayString(t.unref(u)),13,h))}});exports.default=v;
