import{d as h,k as _,l as y,m as g,o as i,x as r,z as w,D as v,u,F as k,h as x,A as C}from"./vue.1703796278973.js";import{_ as A}from"./_plugin-vue_export-helper.1703796278973.js";const O={1:"星期一",2:"星期二",3:"星期三",4:"星期四",5:"星期五",6:"星期六",7:"星期日"},S={class:"timer-when-warp"},B=["onClick"],W=h({name:"WhenOption"}),z=h({...W,props:{value:{type:Array,default:[]},type:{type:String,default:""}},emits:["update:value","change"],setup(m,{emit:d}){const n=m,p=_([]),a=_(n.value),o=t=>{const e=new Set(a.value);t===0?e.clear():e.has(t)?e.delete(t):e.add(t),a.value=[...e.values()].sort((s,l)=>s-l),d("update:value",a.value),d("change",a.value)},f=y(()=>!a.value.length);return g(()=>n.type,()=>{const t=n.type==="month",e=t?31:7;n.value.length||o(0),p.value=new Array(e).fill(1).map((s,l)=>{const c=l+1;return{label:t?`${c}号`:O[c],value:c}})},{immediate:!0}),(t,e)=>(i(),r("div",S,[w("div",{class:v(["when-item-option",u(f)?"active":""]),onClick:e[0]||(e[0]=()=>o(0))},"每天",2),(i(!0),r(k,null,x(u(p),s=>(i(),r("div",{class:v(["when-item-option",u(a).includes(s.value)?"active":""]),onClick:()=>o(s.value)},C(s.label),11,B))),256))]))}});const E=A(z,[["__scopeId","data-v-47de6d7d"]]);export{E as default};
