import{p as M,a as b,b as V,t as X,g as Y,i as Z,k as j,r as z,u as A}from"./i18n-eTakDDhg.js";import{R as I,t as R,Z as C,a as x,T as S,V as q,X as v,W as G,x as P,w as s,M as D,a5 as y,a0 as T,Y as k,u as F,v as H,y as J,S as K,a7 as L,at as N,a8 as O}from"./index-BkylzejB.js";import{G as Q}from"./utils.svelte-DZ62NrTu.js";import{B as U}from"./Block-Bl_3z_UU.js";import{B as $}from"./BlockTitle-BP9HXeKy.js";import"./ScrollFade.svelte_svelte_type_style_lang-De9nUaYy.js";import{I as ee}from"./IconButtonWrapper-33oacT7w.js";import{S as te}from"./index-C-r_2iGV.js";import"./StreamingBar.svelte_svelte_type_style_lang-CFNH9sqm.js";import{c as ae}from"./input-l8ysRorr.js";import{default as Ie}from"./Example-CSoDdNXL.js";import"./clone-IGppQJ7B.js";import"./Info-ElNnmNxB.js";import"./html-DvOIMrhY.js";import"./snippet-CC9u6I34.js";import"./Clear-Daql2pLY.js";import"./index-B_pwUImq.js";let se=0;var re=G('<label><input type="radio" class="svelte-19qdtil"/> <span class="svelte-19qdtil"> </span></label>');function le(m,t){I(t,!0);const h=[];let e=M(t,"selected",15),i=y(()=>e()===t.internal_value);async function d(u){P(i,u.target.checked),s(i)&&(await D(),t.on_input())}var r=re();let f;var a=q(r);X(a);var n,o=v(a,2),g=q(o,!0);k(o),k(r),R(()=>{b(r,"data-testid",`${t.display_value??""}-radio-label`),f=V(r,1,"svelte-19qdtil",null,f,{disabled:t.disabled,selected:s(i),rtl:t.rtl}),a.disabled=t.disabled,b(a,"name",`radio-${++se}`),b(a,"aria-checked",s(i)),n!==(n=t.internal_value)&&(a.value=(a.__value=t.internal_value)??""),T(g,t.display_value)}),ae(h,[],a,()=>(t.internal_value,e()),e),C("input",a,d),x(m,r),S()}var ie=G('<!> <!> <!> <div class="wrap svelte-e4x47i"></div>',1);function we(m,t){I(t,!0);const h=z(t,["$$slots","$$events","$$legacy"]),e=new Q(h);let i=y(()=>!e.shared.interactive),d=F(H(e.props.value));J(()=>{s(d)!=e.props.value&&(P(d,e.props.value,!0),e.dispatch("change"))}),U(m,{get visible(){return e.shared.visible},type:"fieldset",get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get container(){return e.shared.container},get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},get rtl(){return e.props.rtl},children:(r,f)=>{var a=ie(),n=K(a);te(n,Y({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{on_clear_status:()=>e.dispatch("clear_status",e.shared.loading_status)}));var o=v(n,2);{var g=l=>{ee(l,{get buttons(){return e.props.buttons},on_custom_button_click:p=>{e.dispatch("custom_button_click",{id:p})}})};Z(o,l=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&l(g)})}var u=v(o,2);$(u,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(l,p)=>{O();var c=L();R(_=>T(c,_),[()=>e.shared.label||e.i18n("radio.radio")]),x(l,c)},$$slots:{default:!0}});var w=v(u,2);j(w,21,()=>e.props.choices,A,(l,p,c)=>{var _=y(()=>N(s(p),2));let W=()=>s(_)[0],B=()=>s(_)[1];le(l,{get display_value(){return W()},get internal_value(){return B()},get disabled(){return s(i)},get rtl(){return e.props.rtl},on_input:()=>{e.dispatch("input"),e.dispatch("select",{value:B(),index:c})},get selected(){return e.props.value},set selected(E){e.props.value=E}})}),k(w),x(r,a)},$$slots:{default:!0}}),S()}export{Ie as BaseExample,le as BaseRadio,we as default};
