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