import{g as Y,i as x,r as Z,b as B,a as r,t as j}from"./i18n-Dnhn5Rxr.js";import{R as q,u as z,v as A,y as C,w as I,x as F,S,t as d,a as u,Z as o,X as l,T as H,V as G,W as c,M as J,a0 as N,a5 as K,a8 as L,Y as P}from"./index-DWyDLubb.js";import{b as O}from"./input-DrerMDOL.js";import{G as Q}from"./utils.svelte-CCyS_0CY.js";import{B as U}from"./Block-J4oodUWp.js";import{B as ee}from"./BlockTitle-BMm9LakX.js";import"./ScrollFade.svelte_svelte_type_style_lang-DPHOQHBm.js";import{I as te}from"./IconButtonWrapper-D0s9l4wW.js";import{S as ae}from"./index-CglBvmLb.js";import"./StreamingBar.svelte_svelte_type_style_lang-Y9omZ2gK.js";import"./clone-BkeCM4Nl.js";import"./Info-Dzjhnd64.js";import"./html-Ih_5QVTo.js";import"./snippet-BWgYNF9D.js";import"./Clear-BF6j078A.js";import"./index-B_pwUImq.js";var re=c('<div class="validation-error svelte-16ty2ow"> </div>'),se=c(" <!>",1),oe=c('<!> <label><!> <!> <input type="number"/></label>',1);function ke(T,_){q(_,!0);const W=Z(_,["$$slots","$$events","$$legacy"]),e=new Q(W);e.props.value??=0;let m=z(A(e.props.value));C(()=>{I(m)!=e.props.value&&(F(m,e.props.value,!0),e.dispatch("change"))});async function D(s){await J(),s.key==="Enter"&&(s.preventDefault(),e.dispatch("submit"))}const E=K(()=>!e.shared.interactive);U(T,{get visible(){return e.shared.visible},get elem_id(){return e.shared.elem_id},get elem_classes(){return e.shared.elem_classes},get padding(){return e.shared.container},allow_overflow:!1,get scale(){return e.shared.scale},get min_width(){return e.shared.min_width},children:(s,le)=>{var v=oe(),h=S(v);ae(h,Y({get autoscroll(){return e.shared.autoscroll},get i18n(){return e.i18n}},()=>e.shared.loading_status,{show_validation_error:!1,on_clear_status:()=>{e.dispatch("clear_status",e.shared.loading_status)}}));var i=l(h,2);let f;var b=G(i);{var M=a=>{te(a,{get buttons(){return e.props.buttons},on_custom_button_click:$=>{e.dispatch("custom_button_click",{id:$})}})};x(b,a=>{e.shared.show_label&&e.props.buttons&&e.props.buttons.length>0&&a(M)})}var g=l(b,2);ee(g,{get show_label(){return e.shared.show_label},get info(){return e.props.info},children:(a,$)=>{L();var y=se(),k=S(y),R=l(k);{var V=n=>{var p=re(),X=G(p,!0);P(p),d(()=>N(X,e.shared.loading_status?.validation_error)),u(n,p)};x(R,n=>{e.shared.loading_status?.validation_error&&n(V)})}d(()=>N(k,`${(e.shared.label||"Number")??""} `)),u(a,y)},$$slots:{default:!0}});var t=l(g,2);j(t);let w;P(i),d(()=>{f=B(i,1,"block svelte-16ty2ow",null,f,{container:e.shared.container}),r(t,"aria-label",e.shared.label||"Number"),r(t,"min",e.props.minimum),r(t,"max",e.props.maximum),r(t,"step",e.props.step),r(t,"placeholder",e.props.placeholder),t.disabled=I(E),w=B(t,1,"svelte-16ty2ow",null,w,{"validation-error":e.shared.loading_status?.validation_error})}),O(t,()=>e.props.value,a=>e.props.value=a),o("keypress",t,D),o("input",t,()=>e.dispatch("input")),o("blur",t,()=>e.dispatch("blur")),o("focus",t,()=>e.dispatch("focus")),u(s,v)},$$slots:{default:!0}}),H()}export{ke as default};
