import{S as j,i as q,s as D,f as B,q as c,m as T,b as k,c as v,u as d,d as N,a5 as S,l as C,ah as A,v as g,w as h,e as y,x as w,r as F,A as I,h as K,j as L,_ as M,K as z,C as G,I as H,L as J,M as O,F as P,E}from"./index.43a672aa.js";import{B as Q}from"./Block.dd660513.js";import{B as R}from"./BlockTitle.0dbc5573.js";import{S as U}from"./StatusTracker.a32689a5.js";function V(n){let e;return{c(){e=K(n[2])},m(t,l){v(t,e,l)},p(t,l){l&4&&L(e,t[2])},d(t){t&&y(e)}}}function W(n){let e,t,l,s,o,b,m;return t=new R({props:{show_label:n[3],$$slots:{default:[V]},$$scope:{ctx:n}}}),{c(){e=B("label"),c(t.$$.fragment),l=T(),s=B("input"),k(s,"type","number"),k(s,"class","gr-box gr-input w-full gr-text-input"),s.disabled=n[1],k(e,"class","block")},m(u,r){v(u,e,r),d(t,e,null),N(e,l),N(e,s),S(s,n[0]),o=!0,b||(m=[C(s,"input",n[6]),C(s,"keypress",n[4])],b=!0)},p(u,[r]){const a={};r&8&&(a.show_label=u[3]),r&516&&(a.$$scope={dirty:r,ctx:u}),t.$set(a),(!o||r&2)&&(s.disabled=u[1]),r&1&&A(s.value)!==u[0]&&S(s,u[0])},i(u){o||(g(t.$$.fragment,u),o=!0)},o(u){h(t.$$.fragment,u),o=!1},d(u){u&&y(e),w(t),b=!1,F(m)}}}function X(n,e,t){let{value:l=0}=e,{disabled:s=!1}=e,{label:o}=e,{style:b=""}=e,{show_label:m}=e;const u=I();function r(f){u("change",f)}async function a(f){await M(),f.key==="Enter"&&(f.preventDefault(),u("submit"))}function _(){l=A(this.value),t(0,l)}return n.$$set=f=>{"value"in f&&t(0,l=f.value),"disabled"in f&&t(1,s=f.disabled),"label"in f&&t(2,o=f.label),"style"in f&&t(5,b=f.style),"show_label"in f&&t(3,m=f.show_label)},n.$$.update=()=>{n.$$.dirty&1&&r(l)},[l,s,o,m,a,b,_]}class Y extends j{constructor(e){super(),q(this,e,X,W,D,{value:0,disabled:1,label:2,style:5,show_label:3})}}function Z(n){let e,t,l,s,o;const b=[n[4]];let m={};for(let a=0;a<b.length;a+=1)m=z(m,b[a]);e=new U({props:m});function u(a){n[7](a)}let r={label:n[1],show_label:n[3],style:n[5],disabled:n[6]==="static"};return n[0]!==void 0&&(r.value=n[0]),l=new Y({props:r}),G.push(()=>H(l,"value",u)),l.$on("change",n[8]),l.$on("submit",n[9]),{c(){c(e.$$.fragment),t=T(),c(l.$$.fragment)},m(a,_){d(e,a,_),v(a,t,_),d(l,a,_),o=!0},p(a,_){const f=_&16?J(b,[O(a[4])]):{};e.$set(f);const i={};_&2&&(i.label=a[1]),_&8&&(i.show_label=a[3]),_&32&&(i.style=a[5]),_&64&&(i.disabled=a[6]==="static"),!s&&_&1&&(s=!0,i.value=a[0],P(()=>s=!1)),l.$set(i)},i(a){o||(g(e.$$.fragment,a),g(l.$$.fragment,a),o=!0)},o(a){h(e.$$.fragment,a),h(l.$$.fragment,a),o=!1},d(a){w(e,a),a&&y(t),w(l,a)}}}function p(n){let e,t;return e=new Q({props:{form_position:n[2],$$slots:{default:[Z]},$$scope:{ctx:n}}}),{c(){c(e.$$.fragment)},m(l,s){d(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.form_position=l[2]),s&1147&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(g(e.$$.fragment,l),t=!0)},o(l){h(e.$$.fragment,l),t=!1},d(l){w(e,l)}}}function x(n,e,t){let{label:l="Number"}=e,{value:s=0}=e,{form_position:o="single"}=e,{show_label:b}=e,{loading_status:m}=e,{style:u=""}=e,{mode:r}=e;function a(i){s=i,t(0,s)}function _(i){E.call(this,n,i)}function f(i){E.call(this,n,i)}return n.$$set=i=>{"label"in i&&t(1,l=i.label),"value"in i&&t(0,s=i.value),"form_position"in i&&t(2,o=i.form_position),"show_label"in i&&t(3,b=i.show_label),"loading_status"in i&&t(4,m=i.loading_status),"style"in i&&t(5,u=i.style),"mode"in i&&t(6,r=i.mode)},[s,l,o,b,m,u,r,a,_,f]}class $ extends j{constructor(e){super(),q(this,e,x,p,D,{label:1,value:0,form_position:2,show_label:3,loading_status:4,style:5,mode:6})}}var ne=$;const se=["static","dynamic"];export{ne as Component,se as modes};
