import"./svelte/svelte_internal_flags_async.js";import*as e from"./svelte/svelte_internal_client.js";import"./i18n-BldJSFLV.js";import{G as w}from"./utils.svelte-Ceck75cM.js";import{B as k,e as B,c as q}from"./IconButtonWrapper-Cljb5D-5.js";import"./svelte/svelte_internal_flags_legacy.js";import{tick as G}from"./svelte/svelte_svelte.js";import{S as I}from"./StreamingBar-b2qVLPYU.js";import{default as le}from"./Example-Cf5LgY5L.js";import"./svelte/svelte_store.js";import"./index-Ds2meNS5.js";import"./svelte/svelte_animate.js";import"./svelte/svelte_attachments.js";import"./svelte/svelte_easing.js";import"./svelte/svelte_internal_flags_tracing.js";import"./svelte/svelte_internal_server.js";import"./svelte/svelte_legacy.js";import"./svelte/svelte_motion.js";import"./svelte/svelte_reactivity.js";import"./svelte/svelte_reactivity_window.js";import"./svelte/svelte_server.js";import"./svelte/svelte_transition.js";import"./svelte/svelte_events.js";import"./MarkdownCode-C2b9iIxl.js";import"./prism-python-CpYAgONt.js";let P=0;var R=e.from_html('<label><input type="radio" class="svelte-19qdtil"/> <span class="svelte-19qdtil"> </span></label>');function S(v,r){e.push(r,!0);const m=[];let t=e.prop(r,"selected",15),i=e.derived(()=>t()===r.internal_value);async function d(u){e.set(i,u.target.checked),e.get(i)&&(await G(),r.on_input())}var l=R();let g;var a=e.child(l);e.remove_input_defaults(a);var n,o=e.sibling(a,2),h=e.child(o,!0);e.reset(o),e.reset(l),e.template_effect(()=>{e.set_attribute(l,"data-testid",`${r.display_value??""}-radio-label`),g=e.set_class(l,1,"svelte-19qdtil",null,g,{disabled:r.disabled,selected:e.get(i),rtl:r.rtl}),a.disabled=r.disabled,e.set_attribute(a,"name",`radio-${++P}`),e.set_attribute(a,"aria-checked",e.get(i)),n!==(n=r.internal_value)&&(a.value=(a.__value=r.internal_value)??""),e.set_text(h,r.display_value)}),e.bind_group(m,[],a,()=>(r.internal_value,t()),t),e.event("input",a,d),e.append(v,l),e.pop()}var E=e.from_html('<!> <!> <!> <div class="wrap svelte-e4x47i"></div>',1);function te(v,r){e.push(r,!0);const m=e.rest_props(r,["$$slots","$$events","$$legacy"]),t=new w(m);let i=e.derived(()=>!t.shared.interactive),d=e.state(e.proxy(t.props.value));e.user_effect(()=>{e.get(d)!=t.props.value&&(e.set(d,t.props.value,!0),t.dispatch("change"))}),k(v,{get visible(){return t.shared.visible},type:"fieldset",get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get container(){return t.shared.container},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},get rtl(){return t.props.rtl},children:(l,g)=>{var a=E(),n=e.first_child(a);I(n,e.spread_props({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}));var o=e.sibling(n,2);{var h=s=>{q(s,{get buttons(){return t.props.buttons},on_custom_button_click:p=>{t.dispatch("custom_button_click",{id:p})}})};e.if(o,s=>{t.shared.show_label&&t.props.buttons&&t.props.buttons.length>0&&s(h)})}var u=e.sibling(o,2);B(u,{get show_label(){return t.shared.show_label},get info(){return t.props.info},children:(s,p)=>{e.next();var c=e.text();e.template_effect(_=>e.set_text(c,_),[()=>t.shared.label||t.i18n("radio.radio")]),e.append(s,c)},$$slots:{default:!0}});var f=e.sibling(u,2);e.each(f,21,()=>t.props.choices,e.index,(s,p,c)=>{var _=e.derived(()=>e.to_array(e.get(p),2));let x=()=>e.get(_)[0],b=()=>e.get(_)[1];S(s,{get display_value(){return x()},get internal_value(){return b()},get disabled(){return e.get(i)},get rtl(){return t.props.rtl},on_input:()=>{t.dispatch("input"),t.dispatch("select",{value:b(),index:c})},get selected(){return t.props.value},set selected(y){t.props.value=y}})}),e.reset(f),e.append(l,a)},$$slots:{default:!0}}),e.pop()}export{le as BaseExample,S as BaseRadio,te as default};
