import{S as T,i as A,s as D,f as w,m as j,h as F,b as m,t as q,c as d,d as k,l as K,j as I,e as g,q as v,u as C,v as B,w as G,x as S,o as L,A as M,K as O,C as z,I as H,L as J,M as N,F as P,E as Q}from"./index.f808f2eb.js";import{B as R}from"./BlockTitle.3318e0df.js";import{B as U}from"./Block.58108406.js";import{S as V}from"./StatusTracker.9996b515.js";function y(a,e,t){const l=a.slice();return l[9]=e[t],l[11]=t,l}function W(a){let e;return{c(){e=F(a[3])},m(t,l){d(t,e,l)},p(t,l){l&8&&I(e,t[3])},d(t){t&&g(e)}}}function E(a){let e,t,l,u,c,o=a[9]+"",n,_,h;function s(){return a[7](a[9])}return{c(){e=w("label"),t=w("input"),u=j(),c=w("span"),n=F(o),t.disabled=a[2],t.checked=l=a[0].includes(a[9]),m(t,"type","checkbox"),m(t,"name","test"),m(t,"class","gr-check-radio gr-checkbox"),m(c,"class","ml-2"),m(e,"class","flex items-center text-gray-700 text-sm space-x-2 border py-1.5 px-3 rounded-lg cursor-pointer bg-white shadow-sm checked:shadow-inner"),q(e,"!cursor-not-allowed",a[2])},m(f,i){d(f,e,i),k(e,t),k(e,u),k(e,c),k(c,n),_||(h=K(t,"change",s),_=!0)},p(f,i){a=f,i&4&&(t.disabled=a[2]),i&3&&l!==(l=a[0].includes(a[9]))&&(t.checked=l),i&2&&o!==(o=a[9]+"")&&I(n,o),i&4&&q(e,"!cursor-not-allowed",a[2])},d(f){f&&g(e),_=!1,h()}}}function X(a){let e,t,l,u;e=new R({props:{show_label:a[4],$$slots:{default:[W]},$$scope:{ctx:a}}});let c=a[1],o=[];for(let n=0;n<c.length;n+=1)o[n]=E(y(a,c,n));return{c(){v(e.$$.fragment),t=j(),l=w("div");for(let n=0;n<o.length;n+=1)o[n].c();m(l,"class","flex flex-wrap gap-2"),m(l,"data-testid","checkbox-group")},m(n,_){C(e,n,_),d(n,t,_),d(n,l,_);for(let h=0;h<o.length;h+=1)o[h].m(l,null);u=!0},p(n,[_]){const h={};if(_&16&&(h.show_label=n[4]),_&4104&&(h.$$scope={dirty:_,ctx:n}),e.$set(h),_&39){c=n[1];let s;for(s=0;s<c.length;s+=1){const f=y(n,c,s);o[s]?o[s].p(f,_):(o[s]=E(f),o[s].c(),o[s].m(l,null))}for(;s<o.length;s+=1)o[s].d(1);o.length=c.length}},i(n){u||(B(e.$$.fragment,n),u=!0)},o(n){G(e.$$.fragment,n),u=!1},d(n){S(e,n),n&&g(t),n&&g(l),L(o,n)}}}function Y(a,e,t){let{value:l=[]}=e,{choices:u}=e,{disabled:c=!1}=e,{label:o}=e,{style:n=""}=e,{show_label:_}=e;const h=M(),s=i=>{l.includes(i)?l.splice(l.indexOf(i),1):l.push(i),h("change",l),t(0,l)},f=i=>s(i);return a.$$set=i=>{"value"in i&&t(0,l=i.value),"choices"in i&&t(1,u=i.choices),"disabled"in i&&t(2,c=i.disabled),"label"in i&&t(3,o=i.label),"style"in i&&t(6,n=i.style),"show_label"in i&&t(4,_=i.show_label)},[l,u,c,o,_,s,n,f]}class Z extends T{constructor(e){super(),A(this,e,Y,X,D,{value:0,choices:1,disabled:2,label:3,style:6,show_label:4})}}function p(a){let e,t,l,u,c;const o=[a[7]];let n={};for(let s=0;s<o.length;s+=1)n=O(n,o[s]);e=new V({props:n});function _(s){a[9](s)}let h={choices:a[1],style:a[3],label:a[4],show_label:a[6],disabled:a[2]==="static"};return a[0]!==void 0&&(h.value=a[0]),l=new Z({props:h}),z.push(()=>H(l,"value",_)),l.$on("change",a[10]),{c(){v(e.$$.fragment),t=j(),v(l.$$.fragment)},m(s,f){C(e,s,f),d(s,t,f),C(l,s,f),c=!0},p(s,f){const i=f&128?J(o,[N(s[7])]):{};e.$set(i);const b={};f&2&&(b.choices=s[1]),f&8&&(b.style=s[3]),f&16&&(b.label=s[4]),f&64&&(b.show_label=s[6]),f&4&&(b.disabled=s[2]==="static"),!u&&f&1&&(u=!0,b.value=s[0],P(()=>u=!1)),l.$set(b)},i(s){c||(B(e.$$.fragment,s),B(l.$$.fragment,s),c=!0)},o(s){G(e.$$.fragment,s),G(l.$$.fragment,s),c=!1},d(s){S(e,s),s&&g(t),S(l,s)}}}function x(a){let e,t;return e=new U({props:{form_position:a[5],type:"fieldset",$$slots:{default:[p]},$$scope:{ctx:a}}}),{c(){v(e.$$.fragment)},m(l,u){C(e,l,u),t=!0},p(l,[u]){const c={};u&32&&(c.form_position=l[5]),u&2271&&(c.$$scope={dirty:u,ctx:l}),e.$set(c)},i(l){t||(B(e.$$.fragment,l),t=!0)},o(l){G(e.$$.fragment,l),t=!1},d(l){S(e,l)}}}function $(a,e,t){let{value:l=[]}=e,{default_value:u=[]}=e,{choices:c}=e,{mode:o}=e,{style:n=""}=e,{label:_="Checkbox Group"}=e,{form_position:h="single"}=e,{show_label:s}=e,{loading_status:f}=e;u&&(l=u);function i(r){l=r,t(0,l)}function b(r){Q.call(this,a,r)}return a.$$set=r=>{"value"in r&&t(0,l=r.value),"default_value"in r&&t(8,u=r.default_value),"choices"in r&&t(1,c=r.choices),"mode"in r&&t(2,o=r.mode),"style"in r&&t(3,n=r.style),"label"in r&&t(4,_=r.label),"form_position"in r&&t(5,h=r.form_position),"show_label"in r&&t(6,s=r.show_label),"loading_status"in r&&t(7,f=r.loading_status)},[l,c,o,n,_,h,s,f,u,i,b]}class ee extends T{constructor(e){super(),A(this,e,$,x,D,{value:0,default_value:8,choices:1,mode:2,style:3,label:4,form_position:5,show_label:6,loading_status:7})}}var ne=ee;const oe=["static","dynamic"];export{ne as Component,oe as modes};
