import{i as x,r as w,g as $}from"./i18n-Dnhn5Rxr.js";import{R as y,u as k,v as T,y as B,S,w as a,a as G,X as E,a5 as o,T as I,x as M,M as u,W as P}from"./index-DWyDLubb.js";import{s as R}from"./clone-BkeCM4Nl.js";import{T as W}from"./Textbox-BuFR2fNz.js";import{S as X}from"./index-CglBvmLb.js";import"./StreamingBar.svelte_svelte_type_style_lang-Y9omZ2gK.js";import{B as j}from"./Block-J4oodUWp.js";import"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import{G as q}from"./utils.svelte-CCyS_0CY.js";import{default as mt}from"./Example-BC6WbF6q.js";import"./actions-CLThs9VH.js";import"./input-DrerMDOL.js";import"./BlockTitle-BMm9LakX.js";import"./Info-Dzjhnd64.js";import"./html-Ih_5QVTo.js";import"./Check-DUAHzS2-.js";import"./Copy-ChCbTvli.js";import"./Send-B_rl9Hxa.js";import"./Square-CcB54dqq.js";import"./IconButtonWrapper-D0s9l4wW.js";import"./snippet-BWgYNF9D.js";import"./Clear-BF6j078A.js";import"./index-B_pwUImq.js";import"./size-CtOeLwIl.js";/* empty css                                              */var z=P("<!> <!>",1);function ut(d,p){y(p,!0);let c=w(p,["$$slots","$$events","$$legacy"]);const t=new q(c);let m=o(()=>t.shared.label||"Textbox");t.props.value=t.props.value??"";let n=k(T(t.props.value));async function h(){a(n)!==t.props.value&&(M(n,t.props.value,!0),await u(),t.dispatch("change",R(t.props.value)))}async function _(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e,await u(),t.dispatch("input"))}B(()=>{h()});function g(e){!t.shared||!t.props||(t.props.validation_error=null,t.props.value=e)}j(d,{get visible(){return t.shared.visible},get elem_id(){return t.shared.elem_id},get elem_classes(){return t.shared.elem_classes},get scale(){return t.shared.scale},get min_width(){return t.shared.min_width},allow_overflow:!1,get padding(){return t.shared.container},get rtl(){return t.props.rtl},children:(e,A)=>{var i=z(),l=S(i);{var f=s=>{X(s,$({get autoscroll(){return t.shared.autoscroll},get i18n(){return t.i18n}},()=>t.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>t.dispatch("clear_status",t.shared.loading_status)}))};x(l,s=>{t.shared.loading_status&&s(f)})}var v=E(l,2);{let s=o(()=>t.shared?.loading_status?.validation_error||t.shared?.validation_error),b=o(()=>!t.shared.interactive);W(v,{get label(){return a(m)},get info(){return t.props.info},get show_label(){return t.shared.show_label},get lines(){return t.props.lines},get type(){return t.props.type},get rtl(){return t.props.rtl},get text_align(){return t.props.text_align},get max_lines(){return t.props.max_lines},get placeholder(){return t.props.placeholder},get submit_btn(){return t.props.submit_btn},get stop_btn(){return t.props.stop_btn},get buttons(){return t.props.buttons},get autofocus(){return t.props.autofocus},get container(){return t.shared.container},get autoscroll(){return t.shared.autoscroll},get max_length(){return t.props.max_length},get html_attributes(){return t.props.html_attributes},get validation_error(){return a(s)},onchange:g,oninput:_,onsubmit:()=>{t.shared.validation_error=null,t.dispatch("submit")},onblur:()=>t.dispatch("blur"),onselect:r=>t.dispatch("select",r),onfocus:()=>t.dispatch("focus"),onstop:()=>t.dispatch("stop"),oncopy:r=>t.dispatch("copy",r),oncustombuttonclick:r=>{t.dispatch("custom_button_click",{id:r})},get disabled(){return a(b)},get value(){return t.props.value},set value(r){t.props.value=r}})}G(e,i)},$$slots:{default:!0}}),I()}export{mt as BaseExample,W as BaseTextbox,ut as default};
