import{S as D,i as E,s as I,b as u,g as c,a as _,C as y,k as d,v as w,c as b,d as m,h as g,j as v,x as k,f as L,m as z,t as A,p as B,q as F,H as G}from"./vendor.906e418a.js";function p(s,l){return Math.floor(Math.random()*(l-s)+s)}const J=(s,l=1)=>{let n=[[255,99,132],[54,162,235],[240,176,26],[153,102,255],[75,192,192],[255,159,64],[194,88,74],[44,102,219],[44,163,23],[191,46,217],[160,162,162],[163,151,27]];if(s<n.length)var e=n[s];else var e=[p(64,196),p(64,196),p(64,196)];return"rgba("+e[0]+", "+e[1]+", "+e[2]+", "+l+")"};function j(s,l,n){const e=s.slice();return e[8]=l[n][0],e[14]=l[n][1],e[11]=n,e}function H(s,l,n){const e=s.slice();return e[8]=l[n][0],e[9]=l[n][1],e[11]=n,e}function T(s,l,n){const e=s.slice();return e[9]=l[n][0],e[12]=l[n][1],e[11]=n,e}function K(s){let l,n,e=s[3]&&C(),o=s[1],a=[];for(let t=0;t<o.length;t+=1)a[t]=M(j(s,o,t));return{c(){e&&e.c(),l=m(),n=u("div");for(let t=0;t<a.length;t+=1)a[t].c();c(n,"class","textfield p-2 bg-white dark:bg-gray-800 rounded box-border max-w-full leading-8 break-word svelte-261fjf")},m(t,i){e&&e.m(t,i),_(t,l,i),_(t,n,i);for(let f=0;f<a.length;f+=1)a[f].m(n,null)},p(t,i){if(t[3]?e||(e=C(),e.c(),e.m(l.parentNode,l)):e&&(e.d(1),e=null),i&2){o=t[1];let f;for(f=0;f<o.length;f+=1){const r=j(t,o,f);a[f]?a[f].p(r,i):(a[f]=M(r),a[f].c(),a[f].m(n,null))}for(;f<a.length;f+=1)a[f].d(1);a.length=o.length}},d(t){e&&e.d(t),t&&d(l),t&&d(n),k(a,t)}}}function P(s){let l,n,e=s[3]&&N(s),o=s[1],a=[];for(let t=0;t<o.length;t+=1)a[t]=S(H(s,o,t));return{c(){e&&e.c(),l=m(),n=u("div");for(let t=0;t<a.length;t+=1)a[t].c();c(n,"class","textfield p-2 bg-white dark:bg-gray-800 rounded box-border max-w-full leading-8 break-word svelte-261fjf")},m(t,i){e&&e.m(t,i),_(t,l,i),_(t,n,i);for(let f=0;f<a.length;f+=1)a[f].m(n,null)},p(t,i){if(t[3]?e?e.p(t,i):(e=N(t),e.c(),e.m(l.parentNode,l)):e&&(e.d(1),e=null),i&11){o=t[1];let f;for(f=0;f<o.length;f+=1){const r=H(t,o,f);a[f]?a[f].p(r,i):(a[f]=S(r),a[f].c(),a[f].m(n,null))}for(;f<a.length;f+=1)a[f].d(1);a.length=o.length}},d(t){e&&e.d(t),t&&d(l),t&&d(n),k(a,t)}}}function C(s){let l;return{c(){l=u("div"),l.innerHTML=`<span class="svelte-261fjf">-1</span> 
				<span class="svelte-261fjf">0</span> 
				<span class="svelte-261fjf">+1</span>`,c(l,"class","color_legend flex px-2 py-1 justify-between rounded mb-3 font-semibold svelte-261fjf"),w(l,"background","-webkit-linear-gradient(to right,#8d83d6,(255,255,255,0),#eb4d4b)"),w(l,"background","linear-gradient(to right,#8d83d6,rgba(255,255,255,0),#eb4d4b)")},m(n,e){_(n,l,e)},d(n){n&&d(l)}}}function M(s){let l,n,e=s[8]+"",o,a,t;return{c(){l=u("span"),n=u("span"),o=b(e),a=m(),c(n,"class","text dark:text-white svelte-261fjf"),c(l,"class","textspan p-1 mr-0.5 bg-opacity-20 dark:bg-opacity-80 rounded-sm svelte-261fjf"),c(l,"style",t="background-color: rgba("+(s[14]<0?"141, 131, 214,"+-s[14]:"235, 77, 75,"+s[14])+")")},m(i,f){_(i,l,f),g(l,n),g(n,o),g(l,a)},p(i,f){f&2&&e!==(e=i[8]+"")&&v(o,e),f&2&&t!==(t="background-color: rgba("+(i[14]<0?"141, 131, 214,"+-i[14]:"235, 77, 75,"+i[14])+")")&&c(l,"style",t)},d(i){i&&d(l)}}}function N(s){let l,n=Object.entries(s[0]),e=[];for(let o=0;o<n.length;o+=1)e[o]=O(T(s,n,o));return{c(){l=u("div");for(let o=0;o<e.length;o+=1)e[o].c();c(l,"class","category-legend flex flex-wrap gap-1 mb-2 svelte-261fjf")},m(o,a){_(o,l,a);for(let t=0;t<e.length;t+=1)e[t].m(l,null)},p(o,a){if(a&1){n=Object.entries(o[0]);let t;for(t=0;t<n.length;t+=1){const i=T(o,n,t);e[t]?e[t].p(i,a):(e[t]=O(i),e[t].c(),e[t].m(l,null))}for(;t<e.length;t+=1)e[t].d(1);e.length=n.length}},d(o){o&&d(l),k(e,o)}}}function O(s){let l,n=s[9]+"",e,o,a;return{c(){l=u("div"),e=b(n),o=m(),c(l,"class","category-label px-2 py-1 rounded text-white font-semibold svelte-261fjf"),c(l,"style",a="background-color:"+s[12])},m(t,i){_(t,l,i),g(l,e),g(l,o)},p(t,i){i&1&&n!==(n=t[9]+"")&&v(e,n),i&1&&a!==(a="background-color:"+t[12])&&c(l,"style",a)},d(t){t&&d(l)}}}function q(s){let l,n=s[9]+"",e,o;return{c(){l=u("span"),e=b(n),c(l,"class","inline-category text-xs text-white ml-0.5 px-0.5 rounded-sm svelte-261fjf"),c(l,"style",o=s[9]===null?"":`background-color: ${s[0][s[9]]}`)},m(a,t){_(a,l,t),g(l,e)},p(a,t){t&2&&n!==(n=a[9]+"")&&v(e,n),t&3&&o!==(o=a[9]===null?"":`background-color: ${a[0][a[9]]}`)&&c(l,"style",o)},d(a){a&&d(l)}}}function S(s){let l,n,e=s[8]+"",o,a,t,i,f=!s[3]&&s[9]!==null&&q(s);return{c(){l=u("span"),n=u("span"),o=b(e),a=m(),f&&f.c(),t=m(),c(n,"class","text dark:text-white svelte-261fjf"),c(l,"class","textspan p-1 mr-0.5 bg-opacity-20 dark:bg-opacity-80 rounded-sm svelte-261fjf"),c(l,"style",i=s[9]===null?"":`color: ${s[0][s[9]]}; background-color: ${s[0][s[9]].replace("1)","var(--tw-bg-opacity))")}`)},m(r,h){_(r,l,h),g(l,n),g(n,o),g(l,a),f&&f.m(l,null),g(l,t)},p(r,h){h&2&&e!==(e=r[8]+"")&&v(o,e),!r[3]&&r[9]!==null?f?f.p(r,h):(f=q(r),f.c(),f.m(l,t)):f&&(f.d(1),f=null),h&3&&i!==(i=r[9]===null?"":`color: ${r[0][r[9]]}; background-color: ${r[0][r[9]].replace("1)","var(--tw-bg-opacity))")}`)&&c(l,"style",i)},d(r){r&&d(l),f&&f.d()}}}function Q(s){let l;function n(a,t){return a[4]==="categories"?P:K}let e=n(s),o=e(s);return{c(){l=u("div"),o.c(),c(l,"class","output-highlightedtext svelte-261fjf"),c(l,"theme",s[2])},m(a,t){_(a,l,t),o.m(l,null)},p(a,[t]){e===(e=n(a))&&o?o.p(a,t):(o.d(1),o=e(a),o&&(o.c(),o.m(l,null))),t&4&&c(l,"theme",a[2])},i:y,o:y,d(a){a&&d(l),o.d()}}}function R(s,l,n){let{value:e}=l,{theme:o="default"}=l,{show_legend:a=!1}=l,{color_map:t={}}=l,i;if(t===null&&(t={}),e.length>0){for(let[f,r]of e)if(r!==null)if(typeof r=="string"){if(i="categories",!(r in t)){let h=J(Object.keys(t).length);t[r]=h}}else i="scores"}return s.$$set=f=>{"value"in f&&n(1,e=f.value),"theme"in f&&n(2,o=f.theme),"show_legend"in f&&n(3,a=f.show_legend),"color_map"in f&&n(0,t=f.color_map)},[t,e,o,a,i]}class U extends D{constructor(l){super();E(this,l,R,Q,I,{value:1,theme:2,show_legend:3,color_map:0})}}function V(s){let l,n;return l=new U({props:{value:s[0],theme:s[1],style:s[2],show_legend:s[3],color_map:s[4]}}),{c(){L(l.$$.fragment)},m(e,o){z(l,e,o),n=!0},p(e,[o]){const a={};o&1&&(a.value=e[0]),o&2&&(a.theme=e[1]),o&4&&(a.style=e[2]),o&8&&(a.show_legend=e[3]),o&16&&(a.color_map=e[4]),l.$set(a)},i(e){n||(A(l.$$.fragment,e),n=!0)},o(e){B(l.$$.fragment,e),n=!1},d(e){F(l,e)}}}function W(s,l,n){let{value:e}=l,{theme:o}=l,{style:a}=l,{show_legend:t}=l,{color_map:i={}}=l;const f=G();return s.$$set=r=>{"value"in r&&n(0,e=r.value),"theme"in r&&n(1,o=r.theme),"style"in r&&n(2,a=r.style),"show_legend"in r&&n(3,t=r.show_legend),"color_map"in r&&n(4,i=r.color_map)},s.$$.update=()=>{s.$$.dirty&1&&f("change")},[e,o,a,t,i]}class X extends D{constructor(l){super();E(this,l,W,V,I,{value:0,theme:1,style:2,show_legend:3,color_map:4})}}var Z=X;const x=["static"];export{Z as Component,x as modes};
