import{S as E,i as T,s as A,f as B,h as F,c as k,d as S,j as I,e as D,q as h,m as K,b as L,a9 as M,u as m,aa as C,l as z,v as g,w,x as v,o as G,A as H,ab as J,K as N,C as O,I as P,L as Q,M as R,F as U,E as V}from"./index.f808f2eb.js";import{B as W}from"./Block.58108406.js";import{B as X}from"./BlockTitle.3318e0df.js";import{S as Y}from"./StatusTracker.9996b515.js";function j(n,e,t){const a=n.slice();return a[8]=e[t],a[10]=t,a}function Z(n){let e;return{c(){e=F(n[1])},m(t,a){k(t,e,a)},p(t,a){a&2&&I(e,t[1])},d(t){t&&D(e)}}}function q(n){let e,t=n[8]+"",a,s;return{c(){e=B("option"),a=F(t),e.__value=s=n[8],e.value=e.__value},m(i,_){k(i,e,_),S(e,a)},p(i,_){_&4&&t!==(t=i[8]+"")&&I(a,t),_&4&&s!==(s=i[8])&&(e.__value=s,e.value=e.__value)},d(i){i&&D(e)}}}function y(n){let e,t,a,s,i,_,d;t=new X({props:{show_label:n[4],$$slots:{default:[Z]},$$scope:{ctx:n}}});let r=n[2],u=[];for(let l=0;l<r.length;l+=1)u[l]=q(j(n,r,l));return{c(){e=B("label"),h(t.$$.fragment),a=K(),s=B("select");for(let l=0;l<u.length;l+=1)u[l].c();L(s,"class","gr-box gr-input w-full disabled:cursor-not-allowed"),s.disabled=n[3],n[0]===void 0&&M(()=>n[6].call(s))},m(l,o){k(l,e,o),m(t,e,null),S(e,a),S(e,s);for(let b=0;b<u.length;b+=1)u[b].m(s,null);C(s,n[0]),i=!0,_||(d=z(s,"change",n[6]),_=!0)},p(l,[o]){const b={};if(o&16&&(b.show_label=l[4]),o&2050&&(b.$$scope={dirty:o,ctx:l}),t.$set(b),o&4){r=l[2];let c;for(c=0;c<r.length;c+=1){const f=j(l,r,c);u[c]?u[c].p(f,o):(u[c]=q(f),u[c].c(),u[c].m(s,null))}for(;c<u.length;c+=1)u[c].d(1);u.length=r.length}(!i||o&8)&&(s.disabled=l[3]),o&5&&C(s,l[0])},i(l){i||(g(t.$$.fragment,l),i=!0)},o(l){w(t.$$.fragment,l),i=!1},d(l){l&&D(e),v(t),G(u,l),_=!1,d()}}}function p(n,e,t){let{label:a}=e,{value:s=void 0}=e,{choices:i}=e,{style:_=""}=e,{disabled:d=!1}=e,{show_label:r}=e;const u=H();function l(){s=J(this),t(0,s),t(2,i)}return n.$$set=o=>{"label"in o&&t(1,a=o.label),"value"in o&&t(0,s=o.value),"choices"in o&&t(2,i=o.choices),"style"in o&&t(5,_=o.style),"disabled"in o&&t(3,d=o.disabled),"show_label"in o&&t(4,r=o.show_label)},n.$$.update=()=>{n.$$.dirty&1&&u("change",s)},[s,a,i,d,r,_,l]}class x extends E{constructor(e){super(),T(this,e,p,y,A,{label:1,value:0,choices:2,style:5,disabled:3,show_label:4})}}function $(n){let e,t,a,s,i;const _=[n[6]];let d={};for(let l=0;l<_.length;l+=1)d=N(d,_[l]);e=new Y({props:d});function r(l){n[9](l)}let u={style:n[2],choices:n[3],label:n[1],show_label:n[5],disabled:n[7]==="static"};return n[0]!==void 0&&(u.value=n[0]),a=new x({props:u}),O.push(()=>P(a,"value",r)),a.$on("change",n[10]),{c(){h(e.$$.fragment),t=K(),h(a.$$.fragment)},m(l,o){m(e,l,o),k(l,t,o),m(a,l,o),i=!0},p(l,o){const b=o&64?Q(_,[R(l[6])]):{};e.$set(b);const c={};o&4&&(c.style=l[2]),o&8&&(c.choices=l[3]),o&2&&(c.label=l[1]),o&32&&(c.show_label=l[5]),o&128&&(c.disabled=l[7]==="static"),!s&&o&1&&(s=!0,c.value=l[0],U(()=>s=!1)),a.$set(c)},i(l){i||(g(e.$$.fragment,l),g(a.$$.fragment,l),i=!0)},o(l){w(e.$$.fragment,l),w(a.$$.fragment,l),i=!1},d(l){v(e,l),l&&D(t),v(a,l)}}}function ee(n){let e,t;return e=new W({props:{form_position:n[4],$$slots:{default:[$]},$$scope:{ctx:n}}}),{c(){h(e.$$.fragment)},m(a,s){m(e,a,s),t=!0},p(a,[s]){const i={};s&16&&(i.form_position=a[4]),s&2287&&(i.$$scope={dirty:s,ctx:a}),e.$set(i)},i(a){t||(g(e.$$.fragment,a),t=!0)},o(a){w(e.$$.fragment,a),t=!1},d(a){v(e,a)}}}function le(n,e,t){let{label:a="Dropdown"}=e,{value:s=""}=e,{default_value:i=""}=e,{style:_=""}=e,{choices:d}=e,{form_position:r="single"}=e,{show_label:u}=e,{loading_status:l}=e,{mode:o}=e;i&&(s=i);function b(f){s=f,t(0,s)}function c(f){V.call(this,n,f)}return n.$$set=f=>{"label"in f&&t(1,a=f.label),"value"in f&&t(0,s=f.value),"default_value"in f&&t(8,i=f.default_value),"style"in f&&t(2,_=f.style),"choices"in f&&t(3,d=f.choices),"form_position"in f&&t(4,r=f.form_position),"show_label"in f&&t(5,u=f.show_label),"loading_status"in f&&t(6,l=f.loading_status),"mode"in f&&t(7,o=f.mode)},[s,a,_,d,r,u,l,o,i,b,c]}class te extends E{constructor(e){super(),T(this,e,le,ee,A,{label:1,value:0,default_value:8,style:2,choices:3,form_position:4,show_label:5,loading_status:6,mode:7})}}var ie=te;const fe=["static","dynamic"];export{ie as Component,fe as modes};
