import{ba as _,i as s,a2 as b,an as M,M as y,a3 as N}from"./app-JmgyQoR0.js";import{b as A,c as $,a as v,h as d,i as T,j as a,K as i,E as u,z as n,u as x,t as g,l as r,H as V,F as D,G as U}from"./vue-y3KLWBaS.js";const j={class:"_monolithic_"},E={key:0,class:"_section"},F={key:1,class:"_section _formRoot"},z=A({__name:"MkNotificationSettingWindow",props:{includingTypes:{default:()=>[]},showGlobalToggle:{type:Boolean,default:!0}},emits:["done","closed"],setup(h,{emit:w}){const f=w,k=h;let p=$(()=>k.includingTypes||[]);const m=v();let t=v({}),c=v((p.value===null||p.value.length===0)&&k.showGlobalToggle);for(const e of _.notificationTypes)t.value[e]=p.value.includes(e);function B(){c.value?f("done",{includingTypes:null}):f("done",{includingTypes:Object.keys(t.value).filter(e=>t.value[e])}),m.value.close()}function S(){for(const e in t.value)t.value[e]=!1}function C(){for(const e in t.value)t.value[e]=!0}return(e,o)=>(d(),T(N,{ref_key:"dialog",ref:m,width:400,height:450,"with-ok-button":!0,"ok-button-disabled":!1,onOk:o[1]||(o[1]=l=>B()),onClose:o[2]||(o[2]=l=>m.value.close()),onClosed:o[3]||(o[3]=l=>f("closed"))},{header:a(()=>[i(u(n(s).ts.notificationSetting),1)]),default:a(()=>[x("div",j,[e.showGlobalToggle?(d(),g("div",E,[r(b,{modelValue:c.value,"onUpdate:modelValue":o[0]||(o[0]=l=>c.value=l)},{caption:a(()=>[i(u(n(s).ts.useGlobalSettingDesc),1)]),default:a(()=>[i(u(n(s).ts.useGlobalSetting)+" ",1)]),_:1},8,["modelValue"])])):V("",!0),c.value?V("",!0):(d(),g("div",F,[r(M,{class:"_formBlock"},{default:a(()=>[i(u(n(s).ts.notificationSettingDesc),1)]),_:1}),r(y,{inline:"",onClick:S},{default:a(()=>[i(u(n(s).ts.disableAll),1)]),_:1}),r(y,{inline:"",onClick:C},{default:a(()=>[i(u(n(s).ts.enableAll),1)]),_:1}),(d(!0),g(D,null,U(n(_.notificationTypes),l=>(d(),T(b,{class:"_formBlock",key:l,modelValue:t.value[l],"onUpdate:modelValue":G=>t.value[l]=G},{default:a(()=>[i(u(n(s).t(`_notification._types.${l}`)),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))]))])]),_:1},512))}});export{z as default};
