"use strict";const e=require("../../../../common/vendor.js"),t=require("../common/base64.js"),o=require("../common/util.js"),s=require("./types.js"),i=e.defineComponent({name:"wd-loading",options:{virtualHost:!0,addGlobalClass:!0,styleIsolation:"shared"},props:s.loadingProps,setup(s){const i=o.context.id++,n=o.context.id++,r=o.context.id++,a={outline:(e="#4D80F0")=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="${i}"><stop stop-color="#FFF" offset="0%" stop-opacity="0"/><stop stop-color="#FFF" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#${i}) " stroke-width="3.5" stroke-linecap="round"/></g></svg>`,ring:(e="#4D80F0",t="#a6bff7")=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><linearGradient id="${n}" gradientUnits="userSpaceOnUse" x1="50" x2="50" y2="180"><stop offset="0" stop-color="${e}"></stop> <stop offset="1" stop-color="${t}"></stop></linearGradient> <path fill="url(#${n})" d="M20 100c0-44.1 35.9-80 80-80V0C44.8 0 0 44.8 0 100s44.8 100 100 100v-20c-44.1 0-80-35.9-80-80z"></path> <linearGradient id="${r}" gradientUnits="userSpaceOnUse" x1="150" y1="20" x2="150" y2="180"><stop offset="0" stop-color="#fff" stop-opacity="0"></stop> <stop offset="1" stop-color="${t}"></stop></linearGradient> <path fill="url(#${r})" d="M100 0v20c44.1 0 80 35.9 80 80s-35.9 80-80 80v20c55.2 0 100-44.8 100-100S155.2 0 100 0z"></path> <circle cx="100" cy="10" r="10" fill="${e}"></circle></svg>`},l=s,d=e.ref(""),c=e.ref(""),p=e.ref(null);e.watch((()=>l.size),(e=>{p.value=o.addUnit(e)}),{deep:!0,immediate:!0}),e.watch((()=>l.type),(()=>{u()}),{deep:!0,immediate:!0});const f=e.computed((()=>{const e={};return o.isDef(p.value)&&(e.height=o.addUnit(p.value),e.width=o.addUnit(p.value)),`${o.objToStyle(e)} ${l.customStyle}`}));function u(){const{type:e,color:s}=l;let i=o.isDef(e)?e:"ring";const n=`"data:image/svg+xml;base64,${t.encode("ring"===i?a[i](s,c.value):a[i](s))}"`;d.value=n}return e.onBeforeMount((()=>{c.value=o.gradient(l.color,"#ffffff",2)[1],u()})),(t,o)=>({a:e.s(`background-image: url(${d.value});`),b:e.n(`wd-loading ${l.customClass}`),c:e.s(f.value)})}}),n=e._export_sfc(i,[["__scopeId","data-v-6988bbf2"]]);wx.createComponent(n);
