"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../utils/json2css.js"),v=require("../../utils/imgPreloader.js"),p=e.defineComponent({name:"zv-interaction-button-image"}),k=e.defineComponent({...p,props:{basicOption:{}},setup(c){const n=c,i=()=>{const o=e.ref(),a=e.ref(!1),s=t=>!t.startsWith("http")&&!t.startsWith("//")?"../"+t:t,d=t=>{if(o.value){r.autoInstallFont(n.basicOption.css.fontFamily);const m=`url(${t.backgroundImage})`,b=`url(${s(t.hover.backgroundImage)})`,f=`url(${s(t.active.backgroundImage)})`;return{...r.jsonToCssStyle(t),...r.jsonToCssStyle(t.hover,"hover"),...r.jsonToCssStyle(t.active,"active"),"background-image":m,"--hover-background-image":b,"--active-background-image":f}}return{}};return e.onMounted(()=>{v.imgsPreloader([n.basicOption.css.backgroundImage,n.basicOption.css.hover.backgroundImage,n.basicOption.css.active.backgroundImage]).finally(()=>{setTimeout(()=>a.value=!0,100)})}),{rendererDomStyle:d,buttonRef:o,loading:a}},{rendererDomStyle:u,buttonRef:l,loading:g}=i();return(o,a)=>e.unref(g)?(e.openBlock(),e.createElementBlock("button",{key:0,ref_key:"buttonRef",ref:l,class:"zv-button",style:e.normalizeStyle(e.unref(u)(o.basicOption.css))},e.toDisplayString(o.basicOption.value),5)):e.createCommentVNode("",!0)}});exports.default=k;
