import{d as V,t as D,r as l,o as w,c as m,b as a,e as f,u as e,Z as S,$ as B,a as H,Q as M,g as N}from"../../../../common/index.DXvi0yH9.js";import{u as T}from"../../../../common/settings-store.BEthvEFu.js";import{s as $}from"../../../../common/pinia.D9yoqqEz.js";/* empty css                                                                                       *//* empty css                                                                                 */import"../../../../common/Confirmation.vue_vue_type_script_setup_true_lang.BvpajMdU.js";import{_ as L}from"../../../../common/LabelControl.vue_vue_type_script_setup_true_lang.B_b65Eg0.js";import{_ as R}from"../../../../common/Tooltip.vue_vue_type_script_setup_true_lang.BBmniJxI.js";import"../../../../common/transition.CRNcmuQX.js";import"../../../../common/keyboard.D4P2wQc7.js";import"../../../../common/open-closed.CQX5sZkx.js";import"../../../../common/micro-task.CxIZtCgj.js";const U={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-mb-2 stwlite-tw-gap-2"},j={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-mb-2 stwlite-tw-gap-2"},q={class:"stwlite-tw-flex stwlite-tw-items-center stwlite-tw-space-x-2"},E=["id"],O=["for"],P=["innerHTML"],et=V({__name:"CheckboxControl",props:{params:{type:Object,required:!0}},emits:["fieldData"],setup(_,{emit:v}){var u;const b=_,{params:g}=D(b),h=T(),{showPopup:o,componentUpgrade:x}=$(h),t=g.value;let r=!1;(t.default==="yes"||t.default==="true")&&(r=!0);const s=l(r),y=l((u=t.disabled)!=null?u:!1),n=v,i=l([]);s.value&&!y.value&&(i.value[t.id]="yes",n("fieldData",i.value));const k=()=>{typeof t.pro<"u"&&t.pro!==null?(typeof t.pro_on_active<"u"&&t.pro_on_active!==null?t.pro_on_active&&s.value&&(o.value=!0,s.value=!1):(o.value=!0,s.value=!s.value),x.value=t.pro):(i.value[t.id]=s.value?"yes":"no",n("fieldData",i.value))};return(Q,p)=>{var c,d;return w(),m("div",null,[a("div",U,[f(e(L),{params:e(t)},null,8,["params"])]),a("div",j,[a("div",q,[S(a("input",{id:e(t).id,type:"checkbox",class:"stwlite-tw-h-4 stwlite-tw-w-4 stwlite-tw-rounded stwlite-tw-border-gray-300 stwlite-tw-text-blue-600 focus:stwlite-tw-ring-blue-500","onUpdate:modelValue":p[0]||(p[0]=C=>s.value=C),onChange:k},null,40,E),[[B,s.value]]),a("label",{for:e(t).id,class:"stwlite-tw-text-sm stwlite-tw-text-gray-700"},H(e(t).input_label),9,O)]),f(e(R),{params:e(t)},null,8,["params"])]),e(t).description!=="undefined"?(w(),m("p",{key:0,class:"stwlite-tw-text-sm stwlite-tw-text-gray-600 stwlite-tw-mt-2",innerHTML:e(M)((d=(c=e(t))==null?void 0:c.description)!=null?d:"")},null,8,P)):N("",!0)])}}});export{et as default};
