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