import{S as K,i as T,s as V,j as A,b as h,e as m,k as v,d as j,a as r,V as C,f as _,g as L,h as b,m as F,t as p,n as M,o as S,q,u as g,v as w,w as B,z as G,J as H,K as I,L as O,x as P,y as Q}from"./index.c156a17d.js";import{B as R}from"./Block.dfe8f898.js";import{S as U}from"./StatusTracker.f0d63e01.js";function N(f,e,n){const t=f.slice();return t[4]=e[n],t}function z(f){let e,n=f[0].confidences,t=[];for(let s=0;s<n.length;s+=1)t[s]=E(N(f,n,s));return{c(){for(let s=0;s<t.length;s+=1)t[s].c();e=A()},m(s,o){for(let a=0;a<t.length;a+=1)t[a].m(s,o);h(s,e,o)},p(s,o){if(o&1){n=s[0].confidences;let a;for(a=0;a<n.length;a+=1){const l=N(s,n,a);t[a]?t[a].p(l,o):(t[a]=E(l),t[a].c(),t[a].m(e.parentNode,e))}for(;a<t.length;a+=1)t[a].d(1);t.length=n.length}},d(s){F(t,s),s&&b(e)}}}function D(f){let e,n,t,s=Math.round(f[4].confidence*100)+"",o,a;return{c(){e=m("div"),n=v(),t=m("div"),o=j(s),a=j("%"),r(e,"class","flex-1 border border-dashed border-gray-100 px-4"),r(t,"class","text-right ml-auto")},m(l,i){h(l,e,i),h(l,n,i),h(l,t,i),_(t,o),_(t,a)},p(l,i){i&1&&s!==(s=Math.round(l[4].confidence*100)+"")&&L(o,s)},d(l){l&&b(e),l&&b(n),l&&b(t)}}}function E(f){let e,n,t,s,o,a,l=f[4].label+"",i,u,y,c=f[0].confidences&&D(f);return{c(){e=m("div"),n=m("div"),t=m("div"),s=v(),o=m("div"),a=m("div"),i=j(l),u=v(),c&&c.c(),y=v(),r(t,"class","h-1 mb-1 rounded bg-gradient-to-r group-hover:from-orange-500 from-orange-400 to-orange-200 dark:from-orange-400 dark:to-orange-600"),C(t,"width",f[4].confidence*100+"%"),r(a,"class","leading-snug"),r(o,"class","flex items-baseline space-x-2 group-hover:text-orange-500"),r(n,"class","flex-1"),r(e,"class","flex items-start justify-between font-mono text-sm leading-none group")},m(d,k){h(d,e,k),_(e,n),_(n,t),_(n,s),_(n,o),_(o,a),_(a,i),_(o,u),c&&c.m(o,null),_(e,y)},p(d,k){k&1&&C(t,"width",d[4].confidence*100+"%"),k&1&&l!==(l=d[4].label+"")&&L(i,l),d[0].confidences?c?c.p(d,k):(c=D(d),c.c(),c.m(o,null)):c&&(c.d(1),c=null)},d(d){d&&b(e),c&&c.d()}}}function W(f){let e,n,t=f[0].label+"",s,o,a=f[0].confidences&&z(f);return{c(){e=m("div"),n=m("div"),s=j(t),o=v(),a&&a.c(),r(n,"class","output-class font-bold text-2xl py-6 px-4 flex-grow flex items-center justify-center"),p(n,"sr-only",!f[3]),p(n,"no-confidence",!("confidences"in f[0])),r(e,"class","output-label"),r(e,"space-y-4",""),r(e,"theme",f[2]),r(e,"style",f[1])},m(l,i){h(l,e,i),_(e,n),_(n,s),_(e,o),a&&a.m(e,null)},p(l,[i]){i&1&&t!==(t=l[0].label+"")&&L(s,t),i&8&&p(n,"sr-only",!l[3]),i&1&&p(n,"no-confidence",!("confidences"in l[0])),l[0].confidences?a?a.p(l,i):(a=z(l),a.c(),a.m(e,null)):a&&(a.d(1),a=null),i&4&&r(e,"theme",l[2]),i&2&&r(e,"style",l[1])},i:M,o:M,d(l){l&&b(e),a&&a.d()}}}function X(f,e,n){let{value:t}=e,{style:s=""}=e,{theme:o="default"}=e,{show_label:a}=e;return f.$$set=l=>{"value"in l&&n(0,t=l.value),"style"in l&&n(1,s=l.style),"theme"in l&&n(2,o=l.theme),"show_label"in l&&n(3,a=l.show_label)},[t,s,o,a]}class Y extends K{constructor(e){super(),T(this,e,X,W,V,{value:0,style:1,theme:2,show_label:3})}}function J(f){let e,n;return e=new Y({props:{style:f[1],value:f[0],show_label:f[3]}}),{c(){S(e.$$.fragment)},m(t,s){q(e,t,s),n=!0},p(t,s){const o={};s&2&&(o.style=t[1]),s&1&&(o.value=t[0]),s&8&&(o.show_label=t[3]),e.$set(o)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){w(e.$$.fragment,t),n=!1},d(t){B(e,t)}}}function Z(f){let e,n,t,s;const o=[f[2]];let a={};for(let i=0;i<o.length;i+=1)a=H(a,o[i]);e=new U({props:a});let l=f[0]!==void 0&&f[0]!==null&&J(f);return{c(){S(e.$$.fragment),n=v(),l&&l.c(),t=A()},m(i,u){q(e,i,u),h(i,n,u),l&&l.m(i,u),h(i,t,u),s=!0},p(i,u){const y=u&4?I(o,[O(i[2])]):{};e.$set(y),i[0]!==void 0&&i[0]!==null?l?(l.p(i,u),u&1&&g(l,1)):(l=J(i),l.c(),g(l,1),l.m(t.parentNode,t)):l&&(P(),w(l,1,1,()=>{l=null}),Q())},i(i){s||(g(e.$$.fragment,i),g(l),s=!0)},o(i){w(e.$$.fragment,i),w(l),s=!1},d(i){B(e,i),i&&b(n),l&&l.d(i),i&&b(t)}}}function x(f){let e,n;return e=new R({props:{$$slots:{default:[Z]},$$scope:{ctx:f}}}),{c(){S(e.$$.fragment)},m(t,s){q(e,t,s),n=!0},p(t,[s]){const o={};s&79&&(o.$$scope={dirty:s,ctx:t}),e.$set(o)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){w(e.$$.fragment,t),n=!1},d(t){B(e,t)}}}function $(f,e,n){let{value:t}=e,{default_value:s}=e,{style:o=""}=e,{loading_status:a}=e,{show_label:l}=e;const i=G();return s&&(t=s),f.$$set=u=>{"value"in u&&n(0,t=u.value),"default_value"in u&&n(4,s=u.default_value),"style"in u&&n(1,o=u.style),"loading_status"in u&&n(2,a=u.loading_status),"show_label"in u&&n(3,l=u.show_label)},f.$$.update=()=>{f.$$.dirty&1&&i("change")},[t,o,a,l,s]}class ee extends K{constructor(e){super(),T(this,e,$,x,V,{value:0,default_value:4,style:1,loading_status:2,show_label:3})}}var se=ee;const ae=["static"];export{se as Component,ae as modes};
