vendor: 4,230 bytes, lines 1-4
1import{B as Lo}from"./Block-CJdXVpa7.js";import"./MarkdownCode.svelte_svelte_type_style_lang-583j2ysC.js";/* empty css */import{x as Me,w as jo}from"./index-Dk9f0nDu.js";import{d as Un}from"./index-tFQomdd2.js";import{d as zo}from"./dsv-DB8NKgIY.js";import{d as Vt}from"./index-CnqicUFC.js";import{a as Bo}from"./Upload-BQf5EiHc.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import{M as Do}from"./MarkdownCode-CjP5Lux8.js";import"./StreamingBar.svelte_svelte_type_style_lang-DlRzv56K.js";import{C as To}from"./Checkbox-CjOIpf6b.js";import{C as ds}from"./Check-CEkiXcyC.js";import{C as No}from"./Copy-CxQ9EyK2.js";import{F as Ho}from"./FullscreenButton-BpiJhaIL.js";import{S as Oo}from"./index-DZMPOpBC.js";import Po from"./Index-VWmmb9aC.js";import{default as kf}from"./Example-CqPGqNav.js";import"./prism-python-DxQhhusZ.js";import"./svelte/svelte.js";/* empty css */import"./IconButton-C_HS7fTi.js";import"./Clear-By3xiIwg.js";import"./ImagePreview-BiQ5aC2K.js";import"./utils-BsGrhMNe.js";import"./BlockLabel-3KxTaaiM.js";import"./Empty-ZqppqzTN.js";import"./ShareButton-DovO8KAw.js";import"./Community-Dw1micSV.js";import"./Download-DVtk-Jv3.js";import"./Image-Bsh8Umrh.js";import"./IconButtonWrapper--EIOWuEM.js";import"./utils-Gtzs_Zla.js";import"./Image-CnqB5dbD.js";import"./file-url-DoxvUUVV.js";import"./DownloadLink-QIttOhoR.js";/* empty css */import"./ImageUploader-B7BVVU7p.js";import"./SelectSource-Dq7UbX7k.js";import"./DropdownArrow-DYWFcSFn.js";import"./Square-oAGqOwsh.js";import"./index-Cvn1BJB1.js";import"./StreamingBar-BpqwJkLy.js";import"./UploadText-0jAiRdwP.js";import"./Example-CC8yxxGn.js";/* empty css */function sn(t,e,n){if(!e.length)return"none";const l=e.find(i=>{const s=i.col;return s<0||s>=n.length?!1:n[s]===t});return l?l.direction:"none"}function Ro(t,e){if(!t||!t.length||!t[0])return[];if(e.length>0){const n=[...Array(t.length)].map((l,i)=>i);return n.sort((l,i)=>{const s=t[l],o=t[i];for(const{col:r,direction:u}of e){if(!s||!o||r<0||r>=s.length||r>=o.length||!s[r]||!o[r])continue;const c=s[r].value,_=o[r].value,a=c<_?-1:c>_?1:0;if(a!==0)return u==="asc"?a:-a}return 0}),n}return[...Array(t.length)].map((n,l)=>l)}function Fo(t,e,n,l,i,s){let o=null;i&&i[0]in t&&i[1]in t[i[0]]&&(o=t[i[0]][i[1]].id),ms(t,e,n,l);let r=i;if(o){const[u,c]=s(o,t);r=[u,c]}return{data:t,selected:r}}function Io(t){if(!t||!t.length)return[];let e=t[0].slice();for(let n=0;n<t.length;n++)for(let l=0;l<t[n].length;l++)`${e[l].value}`.length<`${t[n][l].value}`.length&&(e[l]=t[n][l]);return e}function ms(t,e,n,l){if(!l.length||!t||!t.length)return;const i=Ro(t,l),s=i.map(o=>t[o]);if(t.splice(0,t.length,...s),e){const o=i.map(r=>e[r]);e.splice(0,e.length,...o)}if(n){const o=i.map(r=>n[r]);n.splice(0,n.length,...o)}}async function gs(t,e){if(!t||!t.length)return;const l=(e||t.flatMap((r,u)=>r.map((c,_)=>[u,_]))).reduce((r,[u,c])=>{r[u]=r[u]||{};const _=String(t[u][c].value);return r[u][c]=_.includes(",")||_.includes('"')||_.includes(` 2`)?`"${_.replace(/"/g,'""')}"`:_,r},{}),i=Object.keys(l).sort((r,u)=>+r-+u);if(!i.length)return;const s=Object.keys(l[i[0]]).sort((r,u)=>+r-+u),o=i.map(r=>s.map(u=>l[r][u]||"").join(",")).join(` 3`);try{await navigator.clipboard.writeText(o)}catch(r){throw new Error("Failed to copy to clipboard: "+r.message)}}function Jo(t,e){return e.filter(n);function n(l){var i=-1;return t.split(` 4`).every(s);function s(o){if(!o)return!0;var r=o.split(l).length;return i<0&&(i=r),i===r&&r>1}}}function Ko(t){const e=atob(t.split(",")[1]),n=t.split(",")[0].split(":")[1].split(";")[0],l=new ArrayBuffer(e.length),i=new Uint8Array(l);for(let s=0;s<e.length;s++)i[s]=e.charCodeAt(s);return new Blob([l],{type:n})}function Vo(t,e,n){const l=Ko(t),i=new FileReader;i.addEventListener("loadend",s=>{if(!s?.target?.result||typeof s.target.result!="string")return;const[o]=Jo(s.target.result,[","," "]),[r,...u]=zo(o).parseRows(s.target.result);e(r),n(u)}),i.readAsText(l)}function Uo(t,e){const[n,l]=t;return e.some(([i,s])=>i===n&&s===l)}function Wo(t,e){const[n,l]=t;
4if(!e.some(([u,c])=>u===n&&c===l))return"";const i=e.some(([u,c])=>u===n-1&&c===l),s=e.some(([u,c])=>u===n+1&&c===l),o=e.some(([u,c])=>u===n&&c===l-1),r=e.some(([u,c])=>u===n&&c===l+1);return`cell-selected${i?" no-top":""}${s?" no-bottom":""}${o?" no-left":""}${r?" no-right":""}`}function ml(t,e){const[n,l]=t,[i,s]=e,o=Math.min(n,i),r=Math.max(n,i),u=Math.min(l,s),c=Math.max(l,s),_=[];_.push(t);for(let a=o;a<=r;a++)for(let f=u;f<=c;f++)a===n&&f===l||_.push([a,f]);return _}function Yo(t,e,n){if(n.shiftKey&&e.length>0)return ml(e[e.length-1],t);if(n.metaKey||n.ctrlKey){const l=([s,o])=>s===t[0]&&o===t[1],i=e.findIndex(l);return i===-1?[...e,t]:e.filter((s,o)=>o!==i)}return[t]}function Xo(t,e){const n=t.map(l=>[...l]);return e.forEach(([l,i])=>{n[l]&&n[l][i]&&(n[l][i]={...n[l][i],value:""})}),n}function Go(t,e,n){const[l,i]=t;return n&&e.length===1&&e[0][0]===l&&e[0][1]===i}function Qo(t,e,n){const[l,i]=t,s=n?-1:1;if(e[l]?.[i+s])return[l,i+s];const o=l+(s>0?1:0),r=l+(s<0?-1:0);return s>0&&e[o]?.[0]?[o,0]:s<0&&e[r]?.[e[0].length-1]?[r,e[0].length-1]:!1}function Zo(t,e,n){const l=t.key,i={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]}[l];let s,o;if(t.metaKey||t.ctrlKey)if(l==="ArrowRight")s=e[0],o=n[0].length-1;else if(l==="ArrowLeft")s=e[0],o=0;else if(l==="ArrowDown")s=n.length-1,o=e[1];else if(l==="ArrowUp")s=0,o=e[1];else return!1;else s=e[0]+i[0],o=e[1]+i[1];return s<0&&o<=0?!1:n[s]?.[o]?[s,o]:!1}function $o(t,e){return e.reduce((n,l,i)=>{const s=l.reduce((o,r,u)=>t===r.id?u:o,-1);return s===-1?n:[i,s]},[-1,-1])}function xo(t,e){const[n]=t.composedPath();return!e.contains(n)}function er(t,e,n,l,i){const[s,o]=t;if(!e[s]?.[o])return{col_pos:"0px",row_pos:void 0};const r=e[s][o].id,u=n[r]?.cell;if(!u)return{col_pos:"0px",row_pos:void 0};const c=u.getBoundingClientRect(),_=i.getBoundingClientRect(),a=`${c.left-_.left+c.width/2}px`,f=`${c.top-_.top+c.height/2}px`;return{col_pos:a,row_pos:f}}const{getContext:mf,setContext:Il}=window.__gradio__svelte__internal,{tick:Jl}=window.__gradio__svelte__internal,tr=Symbol("dataframe");function nr(t,e){const n=s=>t.update(o=>({...o,...s(o)})),l=(s,o,r)=>{const u=s[0]?.length?Array(s[0].length).fill(null).map(()=>({value:"",id:o()})):[{value:"",id:o()}],c=[...s];return r!==void 0?c.splice(r,0,u):c.push(u),c},i=(s,o,r,u)=>{const c=e.headers?[...o.map(a=>e.headers[o.indexOf(a)].value)]:[...o,`Header ${o.length+1}`],_=s.map(a=>[...a,{value:"",id:r()}]);return u!==void 0&&(c.splice(u,0,c.pop()),_.forEach(a=>a.splice(u,0,a.pop()))),{data:_,headers:c}};return{handle_search:s=>n(o=>({current_search_query:s})),handle_sort:(s,o)=>n(r=>{const u=r.sort_state.sort_columns.filter(_=>_.col!==s);r.sort_state.sort_columns.some(_=>_.col===s&&_.direction===o)||u.push({col:s,direction:o});const c=r.sort_state.initial_data||(e.data&&u.length>0?{data:JSON.parse(JSON.stringify(e.data)),display_value:e.display_value?JSON.parse(JSON.stringify(e.display_value)):null,styling:e.styling?JSON.parse(JSON.stringify(e.styling)):null}:null);return{sort_state:{...r.sort_state,sort_columns:u.slice(-3),initial_data:c}}}),get_sort_status:(s,o)=>{const u=Me(t).sort_state.sort_columns.find(c=>o[c.col]===s);return u?u.direction:"none"},sort_data:(s,o,r)=>{const{sort_state:{sort_columns:u}}=Me(t);u.length&&ms(s,o,r,u)},update_row_order:s=>n(o=>({sort_state:{...o.sort_state,row_order:o.sort_state.sort_columns.length&&s[0]?[...Array(s.length)].map((r,u)=>u).sort((r,u)=>{for(const{col:c,direction:_}of o.sort_state.sort_columns){const a=(s[r]?.[c]?.value??"")<(s[u]?.[c]?.value??"")?-1:1;if(a)return _==="asc"?a:-a}return 0}):[...Array(s.length)].map((r,u)=>u)}})),filter_data:s=>{const o=Me(t).current_search_query?.toLowerCase();return o?s.filter(r=>r.some(u=>String(u?.value).toLowerCase().includes(o))):s},add_row:l,add_col:i,add_row_at:(s,o,r,u)=>l(s,u,r==="above"?o:o+1),add_col_at:(s,o,r,u,c)=>i(s,o,c,u==="left"?r:r+1),delete_row:(s,o)=>s.length>1?s.filter((r,u)=>u!==o):s,delete_col:(s,o,r)=>o.length>1?{data:s.map(u=>u.filter((c,_)=>_!==r)),headers:o.filter((u,c)=>c!==r)}:{data:s,headers:o},delete_row_at:(s,o)=>s.length>1?[...s.slice(0,o),...s.slice(o+1)]:s,delete_col_at:(s,o,r)=>o.length>1?{data:s.map(u=>[...u.slice(0,r),...u.slice(r+1)]),headers:[...o.slice(0,r),...o.slice(r+1)]}:{data:s,headers:o},trigger_change:async(s,o,r,u,c,_)=>{if(Me(t).current_search_query)return;const f=o.map(A=>A.value),k=s.map(A=>A.map(C=>String(C.value)));(!Un(k,r)||!Un(f,u))&&(Un(f,u)||n(A=>({sort_state:{sort_columns:[],row_order:[],initial_data:null}})),_("change",{data:s.map(A=>A.map(C=>C.value)),headers:f,metadata:null}),c||_("input"))},reset_sort_state:()=>n(s=>{if(s.sort_state.initial_data&&e.data){const o=s.sort_state.initial_data,r=(u,c)=>{u&&c&&c.splice(0,c.length,...JSON.parse(JSON.stringify(u)))};r(o.data,e.data),r(o.display_value,e.display_value),r(o.styling,e.styling)}return{sort_state:{sort_columns:[],row_order:[],initial_data:null}}}),set_active_cell_menu:s=>n(o=>({ui_state:{...o.ui_state,active_cell_menu:s}})),set_active_header_menu:s=>n(o=>({ui_state:{...o.ui_state,active_header_menu:s}})),set_selected_cells:s=>n(o=>({ui_state:{...o.ui_state,selected_cells:s}})),set_selected:s=>n(o=>({ui_state:{...o.ui_state,selected:s}})),set_editing:s=>n(o=>({ui_state:{...o.ui_state,editing:s}})),clear_ui_state:()=>n(s=>({ui_state:{active_cell_menu:null,active_header_menu:null,selected_cells:[],selected:!1,editing:!1,header_edit:!1,selected_header:!1,active_button:null,copy_flash:!1}})),set_header_edit:s=>n(o=>({ui_state:{...o.ui_state,selected_cells:[],selected_header:s,header_edit:s}})),set_selected_header:s=>n(o=>({ui_state:{...o.ui_state,selected_header:s,selected:!1,selected_cells:[]}})),handle_header_click:(s,o)=>n(r=>({ui_state:{...r.ui_state,active_cell_menu:null,active_header_menu:null,selected:!1,selected_cells:[],selected_header:s,header_edit:o?s:!1}})),end_header_edit:s=>{["Escape","Enter","Tab"].includes(s)&&n(o=>({ui_state:{...o.ui_state,selected:!1,header_edit:!1}}))},get_selected_cells:()=>Me(t).ui_state.selected_cells,get_active_cell_menu:()=>Me(t).ui_state.active_cell_menu,get_active_button:()=>Me(t).ui_state.active_button,set_active_button:s=>n(o=>({ui_state:{...o.ui_state,active_button:s}})),set_copy_flash:s=>n(o=>({ui_state:{...o.ui_state,copy_flash:s}})),handle_cell_click:(s,o,r)=>{s.preventDefault(),s.stopPropagation();const u=Me(t);if(u.config.show_row_numbers&&r===-1)return;let c=o;if(u.current_search_query&&e.data){const a=[];e.data.forEach((f,k)=>{f.some(A=>String(A?.value).toLowerCase().includes(u.current_search_query?.toLowerCase()||""))&&a.push(k)}),c=a[o]??o}const _=Yo([c,r],u.ui_state.selected_cells,s);n(a=>({ui_state:{...a.ui_state,active_cell_menu:null,active_header_menu:null,selected_header:!1,header_edit:!1,selected_cells:_,selected:_[0]}})),u.config.editable&&_.length===1?(n(a=>({ui_state:{...a.ui_state,editing:[c,r]}})),Jl().then(()=>e.els[e.data[c][r].id]?.input?.focus())):Jl().then(()=>{e.parent_element&&e.parent_element.focus()}),e.dispatch?.("select",{index:[c,r],col_value:e.get_column(r),row_value:e.get_row(c),value:e.get_data_at(c,r)})},toggle_cell_menu:(s,o,r)=>{s.stopPropagation();const u=Me(t).ui_state.active_cell_menu;if(u?.row===o&&u.col===r)n(c=>({ui_state:{...c.ui_state,active_cell_menu:null}}));else{const c=s.target.closest("td");if(c){const _=c.getBoundingClientRect();n(a=>({ui_state:{...a.ui_state,active_cell_menu:{row:o,col:r,x:_.right,y:_.bottom}}}))}}},toggle_cell_button:(s,o)=>{const r=Me(t).ui_state.active_button,u=r?.type==="cell"&&r.row===s&&r.col===o?null:{type:"cell",row:s,col:o};n(c=>({ui_state:{...c.ui_state,active_button:u}}))},handle_select_column:s=>{if(!e.data)return;const o=e.data.map((r,u)=>[u,s]);n(r=>({ui_state:{...r.ui_state,selected_cells:o,selected:o[0],editing:!1}})),setTimeout(()=>
4e.parent_element?.focus(),0)},handle_select_row:s=>{if(!e.data||!e.data[0])return;const o=e.data[0].map((r,u)=>[s,u]);n(r=>({ui_state:{...r.ui_state,selected_cells:o,selected:o[0],editing:!1}})),setTimeout(()=>e.parent_element?.focus(),0)},get_next_cell_coordinates:Qo,get_range_selection:ml,move_cursor:Zo}}function lr(t){const e=jo({config:t,current_search_query:null,sort_state:{sort_columns:[],row_order:[],initial_data:null},ui_state:{active_cell_menu:null,active_header_menu:null,selected_cells:[],selected:!1,editing:!1,header_edit:!1,selected_header:!1,active_button:null,copy_flash:!1}}),n={state:e,actions:null};n.actions=nr(e,n);const l=Symbol(`dataframe_${Math.random().toString(36).substring(2)}`);return Il(l,n),Il(tr,{instance_id:l,context:n}),n}const{SvelteComponent:ir,append:Wn,attr:Ye,detach:sr,element:Kl,flush:Yn,init:or,insert:rr,listen:_r,noop:Vl,null_to_empty:Ul,safe_not_equal:ar,stop_propagation:ur,svg_element:Wl}=window.__gradio__svelte__internal;function cr(t){let e,n,l,i,s,o,r,u,c;return{c(){e=Kl("button"),n=Kl("span"),l=Wl("svg"),i=Wl("path"),Ye(i,"d","m16.707 13.293-4-4a1 1 0 0 0-1.414 0l-4 4A1 1 0 0 0 8 15h8a1 1 0 0 0 .707-1.707z"),Ye(i,"data-name",t[3]),Ye(l,"xmlns","http://www.w3.org/2000/svg"),Ye(l,"viewBox","0 0 24 24"),Ye(l,"class","svelte-1mp8yw1"),Ye(n,"class",s=Ul(t[3])+" svelte-1mp8yw1"),Ye(e,"class",o="selection-button selection-button-"+t[0]+" "+(t[2]?`move-${t[3]}`:"")+" svelte-1mp8yw1"),Ye(e,"aria-label",r=`Select ${t[0]}`)},m(_,a){rr(_,e,a),Wn(e,n),Wn(n,l),Wn(l,i),u||(c=_r(e,"click",ur(t[5])),u=!0)},p(_,[a]){a&8&&Ye(i,"data-name",_[3]),a&8&&s!==(s=Ul(_[3])+" svelte-1mp8yw1")&&Ye(n,"class",s),a&13&&o!==(o="selection-button selection-button-"+_[0]+" "+(_[2]?`move-${_[3]}`:"")+" svelte-1mp8yw1")&&Ye(e,"class",o),a&1&&r!==(r=`Select ${_[0]}`)&&Ye(e,"aria-label",r)},i:Vl,o:Vl,d(_){_&&sr(e),u=!1,c()}}}function fr(t,e,n){let l,i,{position:s}=e,{coords:o}=e,{on_click:r=null}=e;const u=()=>r&&r();return t.$$set=c=>{"position"in c&&n(0,s=c.position),"coords"in c&&n(4,o=c.coords),"on_click"in c&&n(1,r=c.on_click)},t.$$.update=()=>{t.$$.dirty&17&&n(2,l=s==="column"?o[0]===0:o[1]===0),t.$$.dirty&5&&n(3,i=s==="column"?l?"down":"up":l?"right":"left")},[s,r,l,i,o,u]}class Yl extends ir{constructor(e){super(),or(this,e,fr,cr,ar,{position:0,coords:4,on_click:1})}get position(){return this.$$.ctx[0]}set position(e){this.$$set({position:e}),Yn()}get coords(){return this.$$.ctx[4]}set coords(e){this.$$set({coords:e}),Yn()}get on_click(){return this.$$.ctx[1]}set on_click(e){this.$$set({on_click:e}),Yn()}}const{SvelteComponent:hr,add_flush_callback:dr,attr:Xn,bind:mr,binding_callbacks:gr,create_component:br,destroy_component:wr,detach:kr,element:pr,flush:Gn,init:vr,insert:yr,listen:Xl,mount_component:Cr,run_all:Sr,safe_not_equal:qr,transition_in:Mr,transition_out:Ar}=window.__gradio__svelte__internal;function Er(t){let e,n,l,i,s,o;function r(c){t[5](c)}let u={label:"",interactive:t[0]};return t[1]!==void 0&&(u.value=t[1]),n=new To({props:u}),gr.push(()=>mr(n,"value",r)),n.$on("change",t[2]),{c(){e=pr("div"),br(n.$$.fragment),Xn(e,"class","bool-cell checkbox svelte-1s702wr"),Xn(e,"role","button"),Xn(e,"tabindex","-1")},m(c,_){yr(c,e,_),Cr(n,e,null),i=!0,s||(o=[Xl(e,"click",Lr),Xl(e,"keydown",jr)],s=!0)},p(c,[_]){const a={};_&1&&(a.interactive=c[0]),!l&&_&2&&(l=!0,a.value=c[1],dr(()=>l=!1)),n.$set(a)},i(c){i||(Mr(n.$$.fragment,c),i=!0)},o(c){Ar(n.$$.fragment,c),i=!1},d(c){c&&kr(e),wr(n),s=!1,Sr(o)}}}function Lr(t){t.stopPropagation()}function jr(t){(t.key==="Enter"||t.key===" ")&&t.stopPropagation()}function zr(t,e,n){let l,{value:i=!1}=e,{editable:s=!0}=e,{on_change:o}=e;function r(c){o(c.detail)}function u(c){l=c,n(1,l),n(3,i)}return t.$$set=c=>{"value"in c&&n(3,i=c.value),"editable"in c&&n(0,s=c.editable),"on_change"in c&&n(4,o=c.on_change)},t.$$.update=()=>{t.$$.dirty&8&&n(1,l=typeof i=="string"?i.toLowerCase()==="true":!!i)},[s,l,r,i,o,u]}class Br extends hr{constructor(e){super(),vr(this,e,zr,Er,qr,{value:3,editable:0,on_change:4})}get value(){return this.$$.ctx[3]}set value(e){this.$$set({value:e}),Gn()}get editable(){return this.$$.ctx[0]}set editable(e){this.$$set({editable:e}),Gn()}get on_change(){return this.$$.ctx[4]}set on_change(e){this.$$set({on_change:e}),Gn()}}const{HtmlTag:Dr,SvelteComponent:Tr,action_destroyer:Nr,attr:we,binding_callbacks:Hr,bubble:on,check_outros:gn,construct_svelte_component:Gl,create_component:Tt,destroy_component:Nt,detach:ct,element:bs,empty:gl,flush:ue,group_outros:bn,init:Or,insert:ft,listen:at,mount_component:Ht,noop:wn,prevent_default:Pr,run_all:ws,safe_not_equal:Rr,set_data:Fr,set_input_value:Ql,space:nl,stop_propagation:Qn,text:Ir,toggle_class:Te,transition_in:Ie,transition_out:Ze}=window.__gradio__svelte__internal,{createEventDispatcher:Jr}=window.__gradio__svelte__internal;function Zl(t){let e,n,l,i;return{c(){e=bs("input"),e.readOnly=t[9],we(e,"aria-readonly",t[9]),we(e,"role","textbox"),we(e,"aria-label",n=t[9]?"Cell is read-only":"Edit cell"),we(e,"tabindex","-1"),we(e,"class","svelte-1y3tas2"),Te(e,"header",t[4])},m(s,o){ft(s,e,o),t[33](e),Ql(e,t[0]),l||(i=[at(e,"input",t[34]),at(e,"blur",t[23]),at(e,"mousedown",Qn(t[30])),at(e,"mouseup",Qn(t[31])),at(e,"click",Qn(t[32])),Nr(Zr.call(null,e)),at(e,"keydown",t[24])],l=!0)},p(s,o){o[0]&512&&(e.readOnly=s[9]),o[0]&512&&we(e,"aria-readonly",s[9]),o[0]&512&&n!==(n=s[9]?"Cell is read-only":"Edit cell")&&we(e,"aria-label",n),o[0]&1&&e.value!==s[0]&&Ql(e,s[0]),o[0]&16&&Te(e,"header",s[4])},d(s){s&&ct(e),t[33](null),l=!1,ws(i)}}}function Kr(t){let e,n,l,i,s,o;const r=[Xr,Yr,Wr,Ur],u=[];function c(_,a){return _[5]==="image"&&_[12].image?0:_[5]==="html"?1:_[5]==="markdown"?2:3}return n=c(t),l=u[n]=r[n](t),{c(){e=bs("span"),l.c(),we(e,"tabindex","0"),we(e,"role","button"),we(e,"style",t[3]),we(e,"data-editable",t[8]),we(e,"data-max-chars",t[11]),we(e,"data-expanded",t[20]),we(e,"placeholder"," "),we(e,"class","svelte-1y3tas2"),Te(e,"dragging",t[14]),Te(e,"edit",t[2]),Te(e,"expanded",t[20]),Te(e,"multiline",t[4]),Te(e,"text",t[5]==="str"),Te(e,"wrap",t[15])},m(_,a){ft(_,e,a),u[n].m(e,null),i=!0,s||(o=[at(e,"click",t[25]),at(e,"keydown",t[24]),at(e,"focus",Pr(t[29]))],s=!0)},p(_,a){let f=n;n=c(_),n===f?u[n].p(_,a):(bn(),Ze(u[f],1,1,()=>{u[f]=null}),gn(),l=u[n],l?l.p(_,a):(l=u[n]=r[n](_),l.c()),Ie(l,1),l.m(e,null)),(!i||a[0]&8)&&we(e,"style",_[3]),(!i||a[0]&256)&&we(e,"data-editable",_[8]),(!i||a[0]&2048)&&we(e,"data-max-chars",_[11]),(!i||a[0]&1048576)&&we(e,"data-expanded",_[20]),(!i||a[0]&16384)&&Te(e,"dragging",_[14]),(!i||a[0]&4)&&Te(e,"edit",_[2]),(!i||a[0]&1048576)&&Te(e,"expanded",_[20]),(!i||a[0]&16)&&Te(e,"multiline",_[4]),(!i||a[0]&32)&&Te(e,"text",_[5]==="str"),(!i||a[0]&32768)&&Te(e,"wrap",_[15])},i(_){i||(Ie(l),i=!0)},o(_){Ze(l),i=!1},d(_){_&&ct(e),u[n].d(),s=!1,ws(o)}}}function Vr(t){let e,n;return e=new Br({props:{value:String(t[21]),editable:t[8],on_change:t[26]}}),{c(){Tt(e.$$.fragment)},m(l,i){Ht(e,l,i),n=!0},p(l,i){const s={};i[0]&2097152&&(s.value=String(l[21])),i[0]&256&&(s.editable=l[8]),e.$set(s)},i(l){n||(Ie(e.$$.fragment,l),n=!0)},o(l){Ze(e.$$.fragment,l),n=!1},d(l){Nt(e,l)}}}function Ur(t){let e;return{c(){e=Ir(t[22])},m(n,l){ft(n,e,l)},p(n,l){l[0]&4194304&&Fr(e,n[22])},i:wn,o:wn,d(n){n&&ct(e)}}}function Wr(t){let e,n;
4return e=new Do({props:{message:t[22].toLocaleString(),latex_delimiters:t[6],line_breaks:t[7],chatbot:!1,root:t[10]}}),{c(){Tt(e.$$.fragment)},m(l,i){Ht(e,l,i),n=!0},p(l,i){const s={};i[0]&4194304&&(s.message=l[22].toLocaleString()),i[0]&64&&(s.latex_delimiters=l[6]),i[0]&128&&(s.line_breaks=l[7]),i[0]&1024&&(s.root=l[10]),e.$set(s)},i(l){n||(Ie(e.$$.fragment,l),n=!0)},o(l){Ze(e.$$.fragment,l),n=!1},d(l){Nt(e,l)}}}function Yr(t){let e,n;return{c(){e=new Dr(!1),n=gl(),e.a=n},m(l,i){e.m(t[22],l,i),ft(l,n,i)},p(l,i){i[0]&4194304&&e.p(l[22])},i:wn,o:wn,d(l){l&&(ct(n),e.d())}}}function Xr(t){let e,n,l;var i=t[12].image;function s(o,r){return{props:{value:{url:o[22]},show_label:!1,label:"cell-image",show_download_button:!1,i18n:o[13],gradio:{dispatch:$r}}}}return i&&(e=Gl(i,s(t))),{c(){e&&Tt(e.$$.fragment),n=gl()},m(o,r){e&&Ht(e,o,r),ft(o,n,r),l=!0},p(o,r){if(r[0]&4096&&i!==(i=o[12].image)){if(e){bn();const u=e;Ze(u.$$.fragment,1,0,()=>{Nt(u,1)}),gn()}i?(e=Gl(i,s(o)),Tt(e.$$.fragment),Ie(e.$$.fragment,1),Ht(e,n.parentNode,n)):e=null}else if(i){const u={};r[0]&4194304&&(u.value={url:o[22]}),r[0]&8192&&(u.i18n=o[13]),e.$set(u)}},i(o){l||(e&&Ie(e.$$.fragment,o),l=!0)},o(o){e&&Ze(e.$$.fragment,o),l=!1},d(o){o&&ct(n),e&&Nt(e,o)}}}function $l(t){let e,n,l,i;return e=new Yl({props:{position:"column",coords:t[17],on_click:t[35]}}),l=new Yl({props:{position:"row",coords:t[17],on_click:t[36]}}),{c(){Tt(e.$$.fragment),n=nl(),Tt(l.$$.fragment)},m(s,o){Ht(e,s,o),ft(s,n,o),Ht(l,s,o),i=!0},p(s,o){const r={};o[0]&131072&&(r.coords=s[17]),o[0]&393216&&(r.on_click=s[35]),e.$set(r);const u={};o[0]&131072&&(u.coords=s[17]),o[0]&655360&&(u.on_click=s[36]),l.$set(u)},i(s){i||(Ie(e.$$.fragment,s),Ie(l.$$.fragment,s),i=!0)},o(s){Ze(e.$$.fragment,s),Ze(l.$$.fragment,s),i=!1},d(s){s&&ct(n),Nt(e,s),Nt(l,s)}}}function Gr(t){let e,n,l,i,s,o,r=t[2]&&t[5]!=="bool"&&Zl(t);const u=[Vr,Kr],c=[];function _(f,k){return f[5]==="bool"?0:1}n=_(t),l=c[n]=u[n](t);let a=t[16]&&t[17]&&t[18]&&t[19]&&$l(t);return{c(){r&&r.c(),e=nl(),l.c(),i=nl(),a&&a.c(),s=gl()},m(f,k){r&&r.m(f,k),ft(f,e,k),c[n].m(f,k),ft(f,i,k),a&&a.m(f,k),ft(f,s,k),o=!0},p(f,k){f[2]&&f[5]!=="bool"?r?r.p(f,k):(r=Zl(f),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null);let A=n;n=_(f),n===A?c[n].p(f,k):(bn(),Ze(c[A],1,1,()=>{c[A]=null}),gn(),l=c[n],l?l.p(f,k):(l=c[n]=u[n](f),l.c()),Ie(l,1),l.m(i.parentNode,i)),f[16]&&f[17]&&f[18]&&f[19]?a?(a.p(f,k),k[0]&983040&&Ie(a,1)):(a=$l(f),a.c(),Ie(a,1),a.m(s.parentNode,s)):a&&(bn(),Ze(a,1,1,()=>{a=null}),gn())},i(f){o||(Ie(l),Ie(a),o=!0)},o(f){Ze(l),Ze(a),o=!1},d(f){f&&(ct(e),ct(i),ct(s)),r&&r.d(f),c[n].d(f),a&&a.d(f)}}}function Qr(t,e=null,n=!1){if(n)return String(t);const l=String(t);return!e||e<=0||l.length<=e?l:l.slice(0,e)+"..."}function Zr(t){return requestAnimationFrame(()=>{t.focus()}),{}}const $r=()=>{};function xr(t,e,n){let l,i,s,{edit:o}=e,{value:r=""}=e,{display_value:u=null}=e,{styling:c=""}=e,{header:_=!1}=e,{datatype:a="str"}=e,{latex_delimiters:f}=e,{line_breaks:k=!0}=e,{editable:A=!0}=e,{is_static:C=!1}=e,{root:E}=e,{max_chars:m=null}=e,{components:b={}}=e,{i18n:w}=e,{is_dragging:S=!1}=e,{wrap_text:y=!1}=e,{show_selection_buttons:j=!1}=e,{coords:z}=e,{on_select_column:N=null}=e,{on_select_row:D=null}=e,{el:R}=e;const O=Jr();let F=!1;function K(d){O("blur",{blur_event:d,coords:z})}function oe(d){d.key==="Enter"&&(_||n(20,F=!F)),O("keydown",d)}function ae(){!o&&!_&&n(20,F=!F)}function V(d){n(0,r=d.toString()),O("blur",{blur_event:{target:{type:"checkbox",checked:d,value:d.toString()}},coords:z})}function J(d){on.call(this,t,d)}function p(d){on.call(this,t,d)}function ce(d){on.call(this,t,d)}function fe(d){on.call(this,t,d)}function W(d){Hr[d?"unshift":"push"](()=>{R=d,n(1,R)})}function U(){r=this.value,n(0,r)}const L=()=>N(z[1]),B=()=>D(z[0]);return t.$$set=d=>{"edit"in d&&n(2,o=d.edit),"value"in d&&n(0,r=d.value),"display_value"in d&&n(27,u=d.display_value),"styling"in d&&n(3,c=d.styling),"header"in d&&n(4,_=d.header),"datatype"in d&&n(5,a=d.datatype),"latex_delimiters"in d&&n(6,f=d.latex_delimiters),"line_breaks"in d&&n(7,k=d.line_breaks),"editable"in d&&n(8,A=d.editable),"is_static"in d&&n(9,C=d.is_static),"root"in d&&n(10,E=d.root),"max_chars"in d&&n(11,m=d.max_chars),"components"in d&&n(12,b=d.components),"i18n"in d&&n(13,w=d.i18n),"is_dragging"in d&&n(14,S=d.is_dragging),"wrap_text"in d&&n(15,y=d.wrap_text),"show_selection_buttons"in d&&n(16,j=d.show_selection_buttons),"coords"in d&&n(17,z=d.coords),"on_select_column"in d&&n(18,N=d.on_select_column),"on_select_row"in d&&n(19,D=d.on_select_row),"el"in d&&n(1,R=d.el)},t.$$.update=()=>{t.$$.dirty[0]&1050628&&n(28,l=!o&&!F&&m!==null&&m>0),t.$$.dirty[0]&134217985&&n(21,i=A?r:u!==null?u:r),t.$$.dirty[0]&270534688&&n(22,s=l?Qr(i,m,a==="image"):i)},[r,R,o,c,_,a,f,k,A,C,E,m,b,w,S,y,j,z,N,D,F,i,s,K,oe,ae,V,u,l,J,p,ce,fe,W,U,L,B]}class bl extends Tr{constructor(e){super(),Or(this,e,xr,Gr,Rr,{edit:2,value:0,display_value:27,styling:3,header:4,datatype:5,latex_delimiters:6,line_breaks:7,editable:8,is_static:9,root:10,max_chars:11,components:12,i18n:13,is_dragging:14,wrap_text:15,show_selection_buttons:16,coords:17,on_select_column:18,on_select_row:19,el:1},null,[-1,-1])}get edit(){return this.$$.ctx[2]}set edit(e){this.$$set({edit:e}),ue()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),ue()}get display_value(){return this.$$.ctx[27]}set display_value(e){this.$$set({display_value:e}),ue()}get styling(){return this.$$.ctx[3]}set styling(e){this.$$set({styling:e}),ue()}get header(){return this.$$.ctx[4]}set header(e){this.$$set({header:e}),ue()}get datatype(){return this.$$.ctx[5]}set datatype(e){this.$$set({datatype:e}),ue()}get latex_delimiters(){return this.$$.ctx[6]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),ue()}get line_breaks(){return this.$$.ctx[7]}set line_breaks(e){this.$$set({line_breaks:e}),ue()}get editable(){return this.$$.ctx[8]}set editable(e){this.$$set({editable:e}),ue()}get is_static(){return this.$$.ctx[9]}set is_static(e){this.$$set({is_static:e}),ue()}get root(){return this.$$.ctx[10]}set root(e){this.$$set({root:e}),ue()}get max_chars(){return this.$$.ctx[11]}set max_chars(e){this.$$set({max_chars:e}),ue()}get components(){return this.$$.ctx[12]}set components(e){this.$$set({components:e}),ue()}get i18n(){return this.$$.ctx[13]}set i18n(e){this.$$set({i18n:e}),ue()}get is_dragging(){return this.$$.ctx[14]}set is_dragging(e){this.$$set({is_dragging:e}),ue()}get wrap_text(){return this.$$.ctx[15]}set wrap_text(e){this.$$set({wrap_text:e}),ue()}get show_selection_buttons(){return this.$$.ctx[16]}set show_selection_buttons(e){this.$$set({show_selection_buttons:e}),ue()}get coords(){return this.$$.ctx[17]}set coords(e){this.$$set({coords:e}),ue()}get on_select_column(){return this.$$.ctx[18]}set on_select_column(e){this.$$set({on_select_column:e}),ue()}get on_select_row(){return this.$$.ctx[19]}set on_select_row(e){this.$$set({on_select_row:e}),ue()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),ue()}}const{SvelteComponent:e_,append:t_,attr:At,detach:wl,element:ks,empty:n_,flush:xl,init:l_,insert:kl,noop:ll,safe_not_equal:i_,set_data:s_,text:o_}=window.__gradio__svelte__internal;function r_(t){let e,n=(t[0]!==null?t[0]+1:"")+"",l;return{c(){e=ks("td"),l=o_(n),At(e,"class","row-number svelte-ux4in1"),At(e,"tabindex","-1"),At(e,"data-row",t[0]),At(e,"data-col","row-number")},m(i,s){kl(i,e,s),t_(e,l)},p(i,s){s&1&&n!==(n=(i[0]!==null?i[0]+1:"")+"")&&s_(l,n),s&1&&At(e,"data-row",i[0])},d(i){i&&wl(e)}}}function __(t){let e;return{c(){e=ks("th"),e.innerHTML='<div class="cell-wrap"><div class="header-content"><div class="header-text"></div></div></div>',At(e,"tabindex","-1"),At(e,"class","row-number svelte-ux4in1")},m(n,l){kl(n,e,l)},p:ll,d(n){n&&wl(e)}}}function a_(t){let e;function n(s,o){return s[1]?__:r_}let l=n(t),i=l(t);return{c(){i.c(),e=n_()},m(s,o){i.m(s,o),kl(s,e,o)},p(s,[o]){l===(l=n(s))&&i?i.p(s,o):(i.d(1),i=l(s),i&&(i.c(),i.m(e.parentNode,e)))},i:ll,o:ll,d(s){s&&wl(e),i.d(s)}}}function u_(t,e,n){let{index:l=null}=e,{is_header:i=!1}=e;return t.$$set=s=>{"index"in s&&n(0,l=s.index),"is_header"in s&&n(1,i=s.is_header)},[l,i]}class yn extends e_{constructor(e){super(),l_(this,e,u_,a_,i_,{index:0,is_header:1})}get index(){return this.$$.ctx[0]}set index(e){this.$$set({index:e}),xl()}get is_header(){return this.$$.ctx[1]}set is_header(e){this.$$set({is_header:e}),xl()}}const{SvelteComponent:c_,attr:Zn,detach:f_,element:h_,flush:d_,init:m_,insert:g_,is_function:b_,listen:ei,noop:ti,run_all:w_,safe_not_equal:k_}=window.__gradio__svelte__internal;function p_(t){let e,n,l;return{c(){e=h_("button"),e.textContent="â®",Zn(e,"aria-label","Open cell menu"),Zn(e,"class","cell-menu-button svelte-vt38nd"),Zn(e,"aria-haspopup","menu")},m(i,s){g_(i,e,s),n||(l=[ei(e,"click",function(){b_(t[0])&&t[0].apply(this,arguments)}),ei(e,"touchstart",t[1])],n=!0)},p(i,[s]){t=i},i:ti,o:ti,d(i){i&&f_(e),n=!1,w_(l)}}}function v_(t,e,n){let{on_click:l}=e;const i=s=>{s.preventDefault();const o=s.touches[0],r=new MouseEvent("click",{clientX:o.clientX,clientY:o.clientY,bubbles:!0,cancelable:!0,view:window});l(r)};return t.$$set=s=>{"on_click"in s&&n(0,l=s.on_click)},[l,i]}class ps extends c_{constructor(e){super(),m_(this,e,v_,p_,k_,{on_click:0})}get on_click(){return this.$$.ctx[0]}set on_click(e){this.$$set({on_click:e}),d_()}}const{SvelteComponent:y_,attr:ni,detach:C_,element:S_,init:q_,insert:M_,noop:$n,safe_not_equal:A_}=window.__gradio__svelte__internal;function E_(t){let e;return{c(){e=S_("div"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>',ni(e,"class","wrapper svelte-1skchaw"),ni(e,"aria-label","Static column")},m(n,l){M_(n,e,l)},p:$n,i:$n,o:$n,d(n){n&&C_(e)}}}
4class L_ extends y_{constructor(e){super(),q_(this,e,null,E_,A_,{})}}const{SvelteComponent:j_,append:li,attr:Le,detach:z_,flush:B_,init:D_,insert:T_,noop:ii,safe_not_equal:N_,svg_element:xn}=window.__gradio__svelte__internal;function H_(t){let e,n,l;return{c(){e=xn("svg"),n=xn("path"),l=xn("path"),Le(n,"d","M4 8L8 4L12 8"),Le(n,"stroke","currentColor"),Le(n,"stroke-width","1.5"),Le(n,"stroke-linecap","round"),Le(n,"stroke-linejoin","round"),Le(l,"d","M8 4V12"),Le(l,"stroke","currentColor"),Le(l,"stroke-width","1.5"),Le(l,"stroke-linecap","round"),Le(e,"width",t[0]),Le(e,"height",t[0]),Le(e,"viewBox","0 0 16 16"),Le(e,"fill","none"),Le(e,"xmlns","http://www.w3.org/2000/svg")},m(i,s){T_(i,e,s),li(e,n),li(e,l)},p(i,[s]){s&1&&Le(e,"width",i[0]),s&1&&Le(e,"height",i[0])},i:ii,o:ii,d(i){i&&z_(e)}}}function O_(t,e,n){let{size:l=16}=e;return t.$$set=i=>{"size"in i&&n(0,l=i.size)},[l]}class P_ extends j_{constructor(e){super(),D_(this,e,O_,H_,N_,{size:0})}get size(){return this.$$.ctx[0]}set size(e){this.$$set({size:e}),B_()}}const{SvelteComponent:R_,append:si,attr:je,detach:F_,flush:I_,init:J_,insert:K_,noop:oi,safe_not_equal:V_,svg_element:el}=window.__gradio__svelte__internal;function U_(t){let e,n,l;return{c(){e=el("svg"),n=el("path"),l=el("path"),je(n,"d","M4 8L8 12L12 8"),je(n,"stroke","currentColor"),je(n,"stroke-width","1.5"),je(n,"stroke-linecap","round"),je(n,"stroke-linejoin","round"),je(l,"d","M8 12V4"),je(l,"stroke","currentColor"),je(l,"stroke-width","1.5"),je(l,"stroke-linecap","round"),je(e,"width",t[0]),je(e,"height",t[0]),je(e,"viewBox","0 0 16 16"),je(e,"fill","none"),je(e,"xmlns","http://www.w3.org/2000/svg")},m(i,s){K_(i,e,s),si(e,n),si(e,l)},p(i,[s]){s&1&&je(e,"width",i[0]),s&1&&je(e,"height",i[0])},i:oi,o:oi,d(i){i&&F_(e)}}}function W_(t,e,n){let{size:l=16}=e;return t.$$set=i=>{"size"in i&&n(0,l=i.size)},[l]}class Y_ extends R_{constructor(e){super(),J_(this,e,W_,U_,V_,{size:0})}get size(){return this.$$.ctx[0]}set size(e){this.$$set({size:e}),I_()}}const{SvelteComponent:X_,add_flush_callback:ri,append:ut,attr:Pe,bind:_i,binding_callbacks:ai,check_outros:fn,create_component:Qt,destroy_component:Zt,detach:pl,element:Lt,flush:he,group_outros:hn,init:G_,insert:vl,listen:rn,mount_component:$t,run_all:Q_,safe_not_equal:Z_,set_data:$_,set_style:_n,space:dn,text:x_,toggle_class:kt,transition_in:ze,transition_out:Fe}=window.__gradio__svelte__internal;function ui(t){let e,n,l,i,s,o;const r=[ta,ea],u=[];function c(a,f){return a[20]==="asc"?0:1}l=c(t),i=u[l]=r[l](t);let _=t[11].length>1&&ci(t);return{c(){e=Lt("div"),n=Lt("span"),i.c(),s=dn(),_&&_.c(),Pe(n,"class","sort-arrow svelte-sy2j2s"),Pe(e,"class","sort-indicators svelte-sy2j2s")},m(a,f){vl(a,e,f),ut(e,n),u[l].m(n,null),ut(e,s),_&&_.m(e,null),o=!0},p(a,f){let k=l;l=c(a),l!==k&&(hn(),Fe(u[k],1,1,()=>{u[k]=null}),fn(),i=u[l],i||(i=u[l]=r[l](a),i.c()),ze(i,1),i.m(n,null)),a[11].length>1?_?_.p(a,f):(_=ci(a),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(a){o||(ze(i),o=!0)},o(a){Fe(i),o=!1},d(a){a&&pl(e),u[l].d(),_&&_.d()}}}function ea(t){let e,n;return e=new Y_({props:{size:12}}),{c(){Qt(e.$$.fragment)},m(l,i){$t(e,l,i),n=!0},i(l){n||(ze(e.$$.fragment,l),n=!0)},o(l){Fe(e.$$.fragment,l),n=!1},d(l){Zt(e,l)}}}function ta(t){let e,n;return e=new P_({props:{size:12}}),{c(){Qt(e.$$.fragment)},m(l,i){$t(e,l,i),n=!0},i(l){n||(ze(e.$$.fragment,l),n=!0)},o(l){Fe(e.$$.fragment,l),n=!1},d(l){Zt(e,l)}}}function ci(t){let e,n;return{c(){e=Lt("span"),n=x_(t[21]),Pe(e,"class","sort-priority svelte-sy2j2s")},m(l,i){vl(l,e,i),ut(e,n)},p(l,i){i&2097152&&$_(n,l[21])},d(l){l&&pl(e)}}}function fi(t){let e,n;return e=new L_({}),{c(){Qt(e.$$.fragment)},m(l,i){$t(e,l,i),n=!0},i(l){n||(ze(e.$$.fragment,l),n=!0)},o(l){Fe(e.$$.fragment,l),n=!1},d(l){Zt(e,l)}}}function hi(t){let e,n;return e=new ps({props:{on_click:t[29]}}),{c(){Qt(e.$$.fragment)},m(l,i){$t(e,l,i),n=!0},p(l,i){const s={};i&516&&(s.on_click=l[29]),e.$set(s)},i(l){n||(ze(e.$$.fragment,l),n=!0)},o(l){Fe(e.$$.fragment,l),n=!1},d(l){Zt(e,l)}}}function na(t){let e,n,l,i,s,o,r,u,c,_,a,f,k,A;function C(y){t[25](y)}function E(y){t[26](y)}let m={max_chars:t[14],latex_delimiters:t[12],line_breaks:t[13],edit:t[4]===t[2],header:!0,root:t[15],editable:t[16],is_static:t[18],i18n:t[17],coords:[t[2],0]};t[0]!==void 0&&(m.value=t[0]),t[1]!==void 0&&(m.el=t[1]),s=new bl({props:m}),ai.push(()=>_i(s,"value",C)),ai.push(()=>
4_i(s,"el",E)),s.$on("keydown",t[27]);let b=t[19]!==-1&&ui(t),w=t[18]&&fi(),S=t[22]&&hi(t);return{c(){e=Lt("th"),n=Lt("div"),l=Lt("div"),i=Lt("button"),Qt(s.$$.fragment),u=dn(),b&&b.c(),c=dn(),w&&w.c(),_=dn(),S&&S.c(),Pe(i,"class","header-button svelte-sy2j2s"),Pe(i,"title",t[0]),Pe(l,"class","header-content svelte-sy2j2s"),Pe(n,"class","cell-wrap svelte-sy2j2s"),Pe(e,"aria-sort",a=sn(t[0],t[11],t[6])==="none"?"none":sn(t[0],t[11],t[6])==="asc"?"ascending":"descending"),_n(e,"width",t[7](t[2])),_n(e,"left",t[23](t[2])),Pe(e,"title",t[0]),Pe(e,"class","svelte-sy2j2s"),kt(e,"pinned-column",t[2]<t[3]),kt(e,"last-pinned",t[2]===t[3]-1),kt(e,"focus",t[4]===t[2]||t[5]===t[2]),kt(e,"sorted",t[19]!==-1)},m(y,j){vl(y,e,j),ut(e,n),ut(n,l),ut(l,i),$t(s,i,null),ut(i,u),b&&b.m(i,null),ut(l,c),w&&w.m(l,null),ut(n,_),S&&S.m(n,null),f=!0,k||(A=[rn(i,"click",t[28]),rn(i,"mousedown",la),rn(e,"click",t[30]),rn(e,"mousedown",ia)],k=!0)},p(y,[j]){const z={};j&16384&&(z.max_chars=y[14]),j&4096&&(z.latex_delimiters=y[12]),j&8192&&(z.line_breaks=y[13]),j&20&&(z.edit=y[4]===y[2]),j&32768&&(z.root=y[15]),j&65536&&(z.editable=y[16]),j&262144&&(z.is_static=y[18]),j&131072&&(z.i18n=y[17]),j&4&&(z.coords=[y[2],0]),!o&&j&1&&(o=!0,z.value=y[0],ri(()=>o=!1)),!r&&j&2&&(r=!0,z.el=y[1],ri(()=>r=!1)),s.$set(z),y[19]!==-1?b?(b.p(y,j),j&524288&&ze(b,1)):(b=ui(y),b.c(),ze(b,1),b.m(i,null)):b&&(hn(),Fe(b,1,1,()=>{b=null}),fn()),(!f||j&1)&&Pe(i,"title",y[0]),y[18]?w?j&262144&&ze(w,1):(w=fi(),w.c(),ze(w,1),w.m(l,null)):w&&(hn(),Fe(w,1,1,()=>{w=null}),fn()),y[22]?S?(S.p(y,j),j&4194304&&ze(S,1)):(S=hi(y),S.c(),ze(S,1),S.m(n,null)):S&&(hn(),Fe(S,1,1,()=>{S=null}),fn()),(!f||j&2113&&a!==(a=sn(y[0],y[11],y[6])==="none"?"none":sn(y[0],y[11],y[6])==="asc"?"ascending":"descending"))&&Pe(e,"aria-sort",a),(!f||j&132)&&_n(e,"width",y[7](y[2])),(!f||j&4)&&_n(e,"left",y[23](y[2])),(!f||j&1)&&Pe(e,"title",y[0]),(!f||j&12)&&kt(e,"pinned-column",y[2]<y[3]),(!f||j&12)&&kt(e,"last-pinned",y[2]===y[3]-1),(!f||j&52)&&kt(e,"focus",y[4]===y[2]||y[5]===y[2]),(!f||j&524288)&&kt(e,"sorted",y[19]!==-1)},i(y){f||(ze(s.$$.fragment,y),ze(b),ze(w),ze(S),f=!0)},o(y){Fe(s.$$.fragment,y),Fe(b),Fe(w),Fe(S),f=!1},d(y){y&&pl(e),Zt(s),b&&b.d(),w&&w.d(),S&&S.d(),k=!1,Q_(A)}}}const la=t=>{t.preventDefault(),t.stopPropagation()},ia=t=>{t.preventDefault(),t.stopPropagation()};function sa(t,e,n){let l,i,s,o,{value:r}=e,{i:u}=e,{actual_pinned_columns:c}=e,{header_edit:_}=e,{selected_header:a}=e,{headers:f}=e,{get_cell_width:k}=e,{handle_header_click:A}=e,{toggle_header_menu:C}=e,{end_header_edit:E}=e,{sort_columns:m=[]}=e,{latex_delimiters:b}=e,{line_breaks:w}=e,{max_chars:S}=e,{root:y}=e,{editable:j}=e,{i18n:z}=e,{el:N}=e,{is_static:D}=e,{col_count:R}=e;function O(p){return p>=c?"auto":p===0?"0":`calc(${Array(p).fill(0).map((fe,W)=>k(W)).join(" + ")})`}function F(p){r=p,n(0,r)}function K(p){N=p,n(1,N)}const oe=p=>{(p.detail.key==="Enter"||p.detail.key==="Escape"||p.detail.key==="Tab")&&E(p)},ae=p=>A(p,u),V=p=>C(p,u),J=p=>A(p,u);return t.$$set=p=>{"value"in p&&n(0,r=p.value),"i"in p&&n(2,u=p.i),"actual_pinned_columns"in p&&n(3,c=p.actual_pinned_columns),"header_edit"in p&&n(4,_=p.header_edit),"selected_header"in p&&n(5,a=p.selected_header),"headers"in p&&n(6,f=p.headers),"get_cell_width"in p&&n(7,k=p.get_cell_width),"handle_header_click"in p&&n(8,A=p.handle_header_click),"toggle_header_menu"in p&&n(9,C=p.toggle_header_menu),"end_header_edit"in p&&n(10,E=p.end_header_edit),"sort_columns"in p&&n(11,m=p.sort_columns),"latex_delimiters"in p&&n(12,b=p.latex_delimiters),"line_breaks"in p&&n(13,w=p.line_breaks),"max_chars"in p&&n(14,S=p.max_chars),"root"in p&&n(15,y=p.root),"editable"in p&&n(16,j=p.editable),"i18n"in p&&n(17,z=p.i18n),"el"in p&&n(1,N=p.el),"is_static"in p&&n(18,D=p.is_static),"col_count"in p&&n(24,R=p.col_count)},t.$$.update=()=>{t.$$.dirty&16777216&&n(22,l=R&&R[1]==="dynamic"),t.$$.dirty&2052&&n(19,i=m.findIndex(p=>p.col===u)),t.$$.dirty&524288&&n(21,s=i!==-1?i+1:null),t.$$.dirty&526336&&n(20,o=i!==-1?m[i].direction:null)},[r,N,u,c,_,a,f,k,A,C,E,m,b,w,S,y,j,z,D,i,o,s,l,O,R,F,K,oe,ae,V,J]}class vs extends X_{constructor(e){super(),G_(this,e,sa,na,Z_,{value:0,i:2,actual_pinned_columns:3,header_edit:4,selected_header:5,headers:6,get_cell_width:7,handle_header_click:8,toggle_header_menu:9,end_header_edit:10,sort_columns:11,latex_delimiters:12,line_breaks:13,max_chars:14,root:15,editable:16,i18n:17,el:1,is_static:18,col_count:24})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),he()}get i(){return this.$$.ctx[2]}set i(e){this.$$set({i:e}),he()}get actual_pinned_columns(){return this.$$.ctx[3]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),he()}get header_edit(){return this.$$.ctx[4]}set header_edit(e){this.$$set({header_edit:e}),he()}get selected_header(){return this.$$.ctx[5]}set selected_header(e){this.$$set({selected_header:e}),he()}get headers(){return this.$$.ctx[6]}set headers(e){this.$$set({headers:e}),he()}get get_cell_width(){return this.$$.ctx[7]}set get_cell_width(e){this.$$set({get_cell_width:e}),he()}get handle_header_click(){return this.$$.ctx[8]}set handle_header_click(e){this.$$set({handle_header_click:e}),he()}get toggle_header_menu(){return this.$$.ctx[9]}set toggle_header_menu(e){this.$$set({toggle_header_menu:e}),he()}get end_header_edit(){return this.$$.ctx[10]}set end_header_edit(e){this.$$set({end_header_edit:e}),he()}get sort_columns(){return this.$$.ctx[11]}set sort_columns(e){this.$$set({sort_columns:e}),he()}get latex_delimiters(){return this.$$.ctx[12]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),he()}get line_breaks(){return this.$$.ctx[13]}set line_breaks(e){this.$$set({line_breaks:e}),he()}get max_chars(){return this.$$.ctx[14]}set max_chars(e){this.$$set({max_chars:e}),he()}get root(){return this.$$.ctx[15]}set root(e){this.$$set({root:e}),he()}get editable(){return this.$$.ctx[16]}set editable(e){this.$$set({editable:e}),he()}get i18n(){return this.$$.ctx[17]}set i18n(e){this.$$set({i18n:e}),he()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),he()}get is_static(){return this.$$.ctx[18]}set is_static(e){this.$$set({is_static:e}),he()}get col_count(){return this.$$.ctx[24]}set col_count(e){this.$$set({col_count:e}),he()}}const{SvelteComponent:oa,add_flush_callback:di,append:mi,attr:Xe,bind:gi,binding_callbacks:il,check_outros:ra,create_component:ys,destroy_component:Cs,detach:_a,element:bi,flush:Q,group_outros:aa,init:ua,insert:ca,is_function:fa,listen:wi,mount_component:Ss,prevent_default:ha,run_all:da,safe_not_equal:ma,space:ga,toggle_class:de,transition_in:Kt,transition_out:mn}=window.__gradio__svelte__internal;function ki(t){let e,n;return e=new ps({props:{on_click:t[40]}}),{c(){ys(e.$$.fragment)},m(l,i){Ss(e,l,i),n=!0},p(l,i){const s={};i[0]&536&&(s.on_click=l[40]),e.$set(s)},i(l){n||(Kt(e.$$.fragment,l),n=!0)},o(l){mn(e.$$.fragment,l),n=!1},d(l){Cs(e,l)}}}function ba(t){let e,n,l,i,s,o,r=t[20]&&t[10]([t[3],t[4]],t[0],t[20]),u,c,_,a,f,k;function A(b){t[37](b)}function C(b){t[38](b)}let E={display_value:t[27]!==void 0?t[27]:String(t[1]),latex_delimiters:t[14],line_breaks:t[15],editable:t[20],is_static:t[21],edit:t[17]&&t[17][0]===t[3]&&t[17][1]===t[4],datatype:t[16],root:t[19],max_chars:t[18],i18n:t[22],components:t[23],show_selection_buttons:t[0].length===1&&t[0][0][0]===t[3]&&t[0][0][1]===t[4],coords:[t[3],t[4]],on_select_column:t[24],on_select_row:t[25],is_dragging:t[26],wrap_text:t[28]};t[1]!==void 0&&(E.value=t[1]),t[2].input!==void 0&&(E.el=t[2].input),l=new bl({props:E}),il.push(()=>gi(l,"value",A)),il.push(()=>gi(l,"el",C)),l.$on("focus",t[39]),l.$on("blur",function(){fa(t[8])&&t[8].apply(this,arguments)});let m=r&&ki(t);return{c(){e=bi("td"),n=bi("div"),ys(l.$$.fragment),o=ga(),m&&m.c(),Xe(n,"class","cell-wrap svelte-v1pjjd"),Xe(e,"tabindex",u=t[4]<t[5]?-1:0),Xe(e,"data-row",t[3]),Xe(e,"data-col",t[4]),Xe(e,"data-testid",c=`cell-${t[3]}-${t[4]}`),Xe(e,"style",_="width: "+t[6](t[4])+"; left: "+t[34](t[4])+"; "+(t[13]||"")),Xe(e,"class","svelte-v1pjjd"),de(e,"pinned-column",t[4]<t[5]),de(e,"last-pinned",t[4]===t[5]-1),de(e,"flash",t[11]&&t[33]),de(e,"cell-selected",t[33]),de(e,"no-top",t[32]),de(e,"no-bottom",t[31]),de(e,"no-left",t[30]),de(e,"no-right",t[29]),de(e,"menu-active",t[12]&&t[12].row===t[3]&&t[12].col===t[4]),de(e,"dragging",t[26])},m(b,w){ca(b,e,w),mi(e,n),Ss(l,n,null),mi(n,o),m&&m.m(n,null),t[41](e),a=!0,f||(k=[wi(e,"mousedown",t[42]),wi(e,"contextmenu",ha(t[43]))],f=!0)},p(b,w){t=b;const S={};w[0]&134217730&&(S.display_value=t[27]!==void 0?t[27]:String(t[1])),w[0]&16384&&(S.latex_delimiters=t[14]),w[0]&32768&&(S.line_breaks=t[15]),w[0]&1048576&&(S.editable=t[20]),w[0]&2097152&&(S.is_static=t[21]),w[0]&131096&&(S.edit=t[17]&&t[17][0]===t[3]&&t[17][1]===t[4]),w[0]&65536&&(S.datatype=t[16]),w[0]&524288&&(S.root=t[19]),w[0]&262144&&(S.max_chars=t[18]),w[0]&4194304&&(S.i18n=t[22]),w[0]&8388608&&(S.components=t[23]),w[0]&25&&(S.show_selection_buttons=t[0].length===1&&t[0][0][0]===t[3]&&t[0][0][1]===t[4]),w[0]&24&&(S.coords=[t[3],t[4]]),w[0]&16777216&&(S.on_select_column=t[24]),w[0]&33554432&&(S.on_select_row=t[25]),w[0]&67108864&&(S.is_dragging=t[26]),w[0]&268435456&&(S.wrap_text=t[28]),!i&&w[0]&2&&(i=!0,S.value=t[1],di(()=>i=!1)),!s&&w[0]&4&&(s=!0,S.el=t[2].input,di(()=>s=!1)),l.$set(S),w[0]&1049625&&(r=t[20]&&t[10]([t[3],t[4]],t[0],t[20])),r?m?(m.p(t,w),w[0]&1049625&&Kt(m,1)):(m=ki(t),m.c(),Kt(m,1),m.m(n,null)):m&&(aa(),mn(m,1,1,()=>{m=null}),ra()),(!a||w[0]&48&&u!==(u=t[4]<t[5]?-1:0))&&Xe(e,"tabindex",u),(!a||w[0]&8)&&Xe(e,"data-row",t[3]),(!a||w[0]&16)&&Xe(e,"data-col",t[4]),(!a||w[0]&24&&c!==(c=`cell-${t[3]}-${t[4]}`))&&Xe(e,"data-testid",c),(!a||w[0]&8272&&_!==(_="width: "+t[6](t[4])+"; left: "+t[34](t[4])+"; "+(t[13]||"")))&&Xe(e,"style",_),(!a||w[0]&48)&&de(e,"pinned-column",t[4]<t[5]),(!a||w[0]&48)&&de(e,"last-pinned",t[4]===t[5]-1),(!a||w[0]&2048|w[1]&4)&&de(e,"flash",t[11]&&t[33]),(!a||w[1]&4)&&de(e,"cell-selected",t[33]),(!a||w[1]&2)&&de(e,"no-top",t[32]),(!a||w[1]&1)&&de(e,"no-bottom",t[31]),(!a||w[0]&1073741824)&&de(e,"no-left",t[30]),(!a||w[0]&536870912)&&de(e,"no-right",t[29]),(!a||w[0]&4120)&&de(e,"menu-active",t[12]&&t[12].row===t[3]&&t[12].col===t[4]),(!a||w[0]&67108864)&&de(e,"dragging",t[26])},i(b){a||(Kt(l.$$.fragment,b),Kt(m),a=!0)},o(b){mn(l.$$.fragment,b),mn(m),a=!1},d(b){b&&_a(e),Cs(l),m&&m.d(),t[41](null),f=!1,da(k)}}}function wa(t,e,n){let l,i,s,o,r,u,{value:c}=e,{index:_}=e,{j:a}=e,{actual_pinned_columns:f}=e,{get_cell_width:k}=e,{handle_cell_click:A}=e,{handle_blur:C}=e,{toggle_cell_menu:E}=e,{is_cell_selected:m}=e,{should_show_cell_menu:b}=e,{selected_cells:w}=e,{copy_flash:S}=e,{active_cell_menu:y}=e,{styling:j}=e,{latex_delimiters:z}=e,{line_breaks:N}=e,{datatype:D}=e,{editing:R}=e,{max_chars:O}=e,{root:F}=e,{editable:K}=e,{is_static:oe=!1}=e,{i18n:ae}=e,{components:V={}}=e,{el:J}=e,{handle_select_column:p}=e,{handle_select_row:ce}=e,{is_dragging:fe}=e,{display_value:W}=e,{wrap:U=!1}
4=e;function L(v){return v>=f?"auto":v===0?"0":`calc(${Array(v).fill(0).map((G,yt)=>k(yt)).join(" + ")})`}function B(v){c=v,n(1,c)}function d(v){t.$$.not_equal(J.input,v)&&(J.input=v,n(2,J))}const P=()=>{const v=_,wt=a;w.some(([G,yt])=>G===v&&yt===wt)||n(0,w=[[v,wt]])},Be=v=>E(v,_,a);function Ue(v){il[v?"unshift":"push"](()=>{J.cell=v,n(2,J)})}const q=v=>A(v,_,a),ye=v=>E(v,_,a);return t.$$set=v=>{"value"in v&&n(1,c=v.value),"index"in v&&n(3,_=v.index),"j"in v&&n(4,a=v.j),"actual_pinned_columns"in v&&n(5,f=v.actual_pinned_columns),"get_cell_width"in v&&n(6,k=v.get_cell_width),"handle_cell_click"in v&&n(7,A=v.handle_cell_click),"handle_blur"in v&&n(8,C=v.handle_blur),"toggle_cell_menu"in v&&n(9,E=v.toggle_cell_menu),"is_cell_selected"in v&&n(35,m=v.is_cell_selected),"should_show_cell_menu"in v&&n(10,b=v.should_show_cell_menu),"selected_cells"in v&&n(0,w=v.selected_cells),"copy_flash"in v&&n(11,S=v.copy_flash),"active_cell_menu"in v&&n(12,y=v.active_cell_menu),"styling"in v&&n(13,j=v.styling),"latex_delimiters"in v&&n(14,z=v.latex_delimiters),"line_breaks"in v&&n(15,N=v.line_breaks),"datatype"in v&&n(16,D=v.datatype),"editing"in v&&n(17,R=v.editing),"max_chars"in v&&n(18,O=v.max_chars),"root"in v&&n(19,F=v.root),"editable"in v&&n(20,K=v.editable),"is_static"in v&&n(21,oe=v.is_static),"i18n"in v&&n(22,ae=v.i18n),"components"in v&&n(23,V=v.components),"el"in v&&n(2,J=v.el),"handle_select_column"in v&&n(24,p=v.handle_select_column),"handle_select_row"in v&&n(25,ce=v.handle_select_row),"is_dragging"in v&&n(26,fe=v.is_dragging),"display_value"in v&&n(27,W=v.dis
4play_value),"wrap"in v&&n(28,U=v.wrap)},t.$$.update=()=>{t.$$.dirty[0]&25|t.$$.dirty[1]&16&&n(36,l=m([_,a],w||[])),t.$$.dirty[0]&25&&n(33,i=Uo([_,a],w)),t.$$.dirty[1]&32&&n(32,s=l.includes("no-top")),t.$$.dirty[1]&32&&n(31,o=l.includes("no-bottom")),t.$$.dirty[1]&32&&n(30,r=l.includes("no-left")),t.$$.dirty[1]&32&&n(29,u=l.includes("no-right"))},[w,c,J,_,a,f,k,A,C,E,b,S,y,j,z,N,D,R,O,F,K,oe,ae,V,p,ce,fe,W,U,u,r,o,s,i,L,m,l,B,d,P,Be,Ue,q,ye]}class ka extends oa{constructor(e){super(),ua(this,e,wa,ba,ma,{value:1,index:3,j:4,actual_pinned_columns:5,get_cell_width:6,handle_cell_click:7,handle_blur:8,toggle_cell_menu:9,is_cell_selected:35,should_show_cell_menu:10,selected_cells:0,copy_flash:11,active_cell_menu:12,styling:13,latex_delimiters:14,line_breaks:15,datatype:16,editing:17,max_chars:18,root:19,editable:20,is_static:21,i18n:22,components:23,el:2,handle_select_column:24,handle_select_row:25,is_dragging:26,display_value:27,wrap:28},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),Q()}get index(){return this.$$.ctx[3]}set index(e){this.$$set({index:e}),Q()}get j(){return this.$$.ctx[4]}set j(e){this.$$set({j:e}),Q()}get actual_pinned_columns(){return this.$$.ctx[5]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),Q()}get get_cell_width(){return this.$$.ctx[6]}set get_cell_width(e){this.$$set({get_cell_width:e}),Q()}get handle_cell_click(){return this.$$.ctx[7]}set handle_cell_click(e){this.$$set({handle_cell_click:e}),Q()}get handle_blur(){return this.$$.ctx[8]}set handle_blur(e){this.$$set({handle_blur:e}),Q()}get toggle_cell_menu(){return this.$$.ctx[9]}set toggle_cell_menu(e){this.$$set({toggle_cell_menu:e}),Q()}get is_cell_selected(){return this.$$.ctx[35]}set is_cell_selected(e){this.$$set({is_cell_selected:e}),Q()}get should_show_cell_menu(){return this.$$.ctx[10]}set should_show_cell_menu(e){this.$$set({should_show_cell_menu:e}),Q()}get selected_cells(){return this.$$.ctx[0]}set selected_cells(e){this.$$set({selected_cells:e}),Q()}get copy_flash(){return this.$$.ctx[11]}set copy_flash(e){this.$$set({copy_flash:e}),Q()}get active_cell_menu(){return this.$$.ctx[12]}set active_cell_menu(e){this.$$set({active_cell_menu:e}),Q()}get styling(){return this.$$.ctx[13]}set styling(e){this.$$set({styling:e}),Q()}get latex_delimiters(){return this.$$.ctx[14]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),Q()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),Q()}get datatype(){return this.$$.ctx[16]}set datatype(e){this.$$set({datatype:e}),Q()}get editing(){return this.$$.ctx[17]}set editing(e){this.$$set({editing:e}),Q()}get max_chars(){return this.$$.ctx[18]}set max_chars(e){this.$$set({max_chars:e}),Q()}get root(){return this.$$.ctx[19]}set root(e){this.$$set({root:e}),Q()}get editable(){return this.$$.ctx[20]}set editable(e){this.$$set({editable:e}),Q()}get is_static(){return this.$$.ctx[21]}set is_static(e){this.$$set({is_static:e}),Q()}get i18n(){return this.$$.ctx[22]}set i18n(e){this.$$set({i18n:e}),Q()}get components(){return this.$$.ctx[23]}set components(e){this.$$set({components:e}),Q()}get el(){return this.$$.ctx[2]}set el(e){this.$$set({el:e}),Q()}get handle_select_column(){return this.$$.ctx[24]}set handle_select_column(e){this.$$set({handle_select_column:e}),Q()}get handle_select_row(){return this.$$.ctx[25]}set handle_select_row(e){this.$$set({handle_select_row:e}),Q()}get is_dragging(){return this.$$.ctx[26]}set is_dragging(e){this.$$set({is_dragging:e}),Q()}get display_value(){return this.$$.ctx[27]}set display_value(e){this.$$set({display_value:e}),Q()}get wrap(){return this.$$.ctx[28]}set wrap(e){this.$$set({wrap:e}),Q()}}const{SvelteComponent:pa,attr:pi,detach:va,element:ya,flush:Ca,init:Sa,insert:qa,is_function:Ma,listen:Aa,noop:vi,safe_not_equal:Ea}=window.__gradio__svelte__internal;function La(t){let e,n,l;return{c(){e=ya("button"),e.textContent="+",pi(e,"class","add-row-button svelte-jkwuz7"),pi(e,"aria-label","Add row")},m(i,s){qa(i,e,s),n||(l=Aa(e,"click",function(){Ma(t[0])&&t[0].apply(this,arguments)}),n=!0)},p(i,[s]){t=i},i:vi,o:vi,d(i){i&&va(e),n=!1,l()}}}function ja(t,e,n){let{on_click:l}=e;return t.$$set=i=>{"on_click"in i&&n(0,l=i.on_click)},[l]}class za extends pa{constructor(e){super(),Sa(this,e,ja,La,Ea,{on_click:0})}get on_click(){return this.$$.ctx[0]}set on_click(e){this.$$set({on_click:e}),Ca()}}const{ResizeObserverSingleton:Ba,SvelteComponent:Da,add_iframe_resize_listener:yi,add_render_callback:Ci,append:St,attr:an,binding_callbacks:Si,check_outros:qs,create_slot:sl,detach:Cn,element:zt,empty:Ms,ensure_array_like:qi,flush:it,get_all_dirty_from_scope:ol,get_slot_changes:rl,group_outros:As,init:Ta,insert:Sn,listen:Na,outro_and_destroy_block:Ha,resize_observer_content_box:Oa,safe_not_equal:Pa,set_style:Oe,space
4:Mi,text:Ra,toggle_class:Ai,transition_in:Et,transition_out:Dt,update_keyed_each:Fa,update_slot_base:_l}=window.__gradio__svelte__internal,{onMount:Ia,tick:Ja,createEventDispatcher:Ka}=window.__gradio__svelte__internal,Va=t=>({}),Ei=t=>({});function Li(t,e,n){const l=t.slice();return l[37]=e[n],l}const Ua=t=>({item:t[0]&1024,index:t[0]&1024}),ji=t=>({item:t[37].data,index:t[37].index}),Wa=t=>({}),zi=t=>({});function Bi(t){let e=[],n=new Map,l,i,s=qi(t[10]);const o=r=>r[37].data[0].id;for(let r=0;r<s.length;r+=1){let u=Li(t,s,r),c=o(u);n.set(c,e[r]=Di(c,u))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();l=Ms()},m(r,u){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(r,u);Sn(r,l,u),i=!0},p(r,u){u[0]&8389632&&(s=qi(r[10]),As(),e=Fa(e,u,o,1,r,s,n,l.parentNode,Ha,Di,l,Li),qs())},i(r){if(!i){for(let u=0;u<s.length;u+=1)Et(e[u]);i=!0}},o(r){for(let u=0;u<e.length;u+=1)Dt(e[u]);i=!1},d(r){r&&Cn(l);for(let u=0;u<e.length;u+=1)e[u].d(r)}}}function Ya(t){let e;return{c(){e=Ra(`Missing Table Row 5 `)},m(n,l){Sn(n,e,l)},d(n){n&&Cn(e)}}}function Di(t,e){let n,l;const i=e[24].tbody,s=sl(i,e,e[23],ji),o=s||Ya();return{key:t,first:null,c(){n=Ms(),o&&o.c(),this.first=n},m(r,u){Sn(r,n,u),o&&o.m(r,u),l=!0},p(r,u){e=r,s&&s.p&&(!l||u[0]&8389632)&&_l(s,i,e,e[23],l?rl(i,e[23],u,Ua):ol(e[23]),ji)},i(r){l||(Et(o,r),l=!0)},o(r){Dt(o,r),l=!1},d(r){r&&Cn(n),o&&o.d(r)}}}function Xa(t){let e,n,l,i,s,o,r,u,c,_,a,f,k,A;const C=t[24].thead,E=sl(C,t,t[23],zi);let m=t[10].length&&t[10][0].data.length&&Bi(t);const b=t[24].tfoot,w=sl(b,t,t[23],Ei);return{c(){e=zt("svelte-virtual-table-viewport"),n=zt("div"),l=zt("table"),i=zt("thead"),E&&E.c(),o=Mi(),r=zt("tbody"),m&&m.c(),u=Mi(),c=zt("tfoot"),w&&w.c(),an(i,"class","thead svelte-zsmsrz"),Ci(()=>t[25].call(i)),an(r,"class","tbody svelte-zsmsrz"),an(c,"class","tfoot svelte-zsmsrz"),Ci(()=>t[27].call(c)),an(l,"class","table svelte-zsmsrz"),Oe(l,"height",Ga),Oe(l,"--bw-svt-p-top",t[9]+"px"),Oe(l,"--bw-svt-p-bottom",t[5]+"px"),Oe(l,"--bw-svt-head-height",t[7]+"px"),Oe(l,"--bw-svt-foot-height",t[8]+"px"),Oe(l,"--bw-svt-avg-row-height",t[3]+"px"),Oe(l,"--max-height",t[1]+"px"),Ai(l,"disable-scroll",t[2])}
5,m(S,y){Sn(S,e,y),St(e,n),St(n,l),St(l,i),E&&E.m(i,null),s=yi(i,t[25].bind(i)),St(l,o),St(l,r),m&&m.m(r,null),t[26](r),St(l,u),St(l,c),w&&w.m(c,null),_=yi(c,t[27].bind(c)),t[28](l),a=Oa.observe(l,t[29].bind(l)),f=!0,k||(A=Na(l,"scroll",t[11]),k=!0)},p(S,y){E&&E.p&&(!f||y[0]&8388608)&&_l(E,C,S,S[23],f?rl(C,S[23],y,Wa):ol(S[23]),zi),S[10].length&&S[10][0].data.length?m?(m.p(S,y),y[0]&1024&&Et(m,1)):(m=Bi(S),m.c(),Et(m,1),m.m(r,null)):m&&(As(),Dt(m,1,1,()=>{m=null}),qs()),w&&w.p&&(!f||y[0]&8388608)&&_l(w,b,S,S[23],f?rl(b,S[23],y,Va):ol(S[23]),Ei),(!f||y[0]&512)&&Oe(l,"--bw-svt-p-top",S[9]+"px"),(!f||y[0]&32)&&Oe(l,"--bw-svt-p-bottom",S[5]+"px"),(!f||y[0]&128)&&Oe(l,"--bw-svt-head-height",S[7]+"px"),(!f||y[0]&256)&&Oe(l,"--bw-svt-foot-height",S[8]+"px"),(!f||y[0]&8)&&Oe(l,"--bw-svt-avg-row-height",S[3]+"px"),(!f||y[0]&2)&&Oe(l,"--max-height",S[1]+"px"),(!f||y[0]&4)&&Ai(l,"disable-scroll",S[2])},i(S){f||(Et(E,S),Et(m),Et(w,S),f=!0)},o(S){Dt(E,S),Dt(m),Dt(w,S),f=!1},d(S){S&&Cn(e),E&&E.d(S),s(),m&&m.d(),t[26](null),w&&w.d(S),_(),t[28](null),a(),k=!1,A()}}}let Ga="100%";function Qa(t,e,n){let l,{$$slots:i={},$$scope:s}=e,{items:o=[]}=e,{max_height:r}=e,{actual_height:u}=e,{table_scrollbar_width:c}=e,{start:_=0}=e,{end:a=20}=e,{selected:f}=e,{disable_scroll:k=!1}=e,{show_scroll_button:A=!1}=e,{viewport:C}=e;Ka();let E=30,m=0,b,w=0,S=0,y=[],j,z,N=0,D=200,R=[],O;const F=typeof window<"u",K=F?window.requestAnimationFrame:L=>L();async function oe(){l.length<_&&await J(l.length-1,{behavior:"auto"});const L=Math.max(0,C.scrollTop);n(16,A=L>100),n(15,c=C.offsetWidth-C.clientWidth);for(let ye=0;ye<z.length;ye+=1)y[_+ye]=z[ye].getBoundingClientRect().height;let B=0,d=w;for(;B<l.length;){const ye=y[B]||E;if(d+ye>L-r){n(12,_=B),n(9,N=d-w);break}d+=ye,B+=1}let P=w;for(;B<l.length;){const ye=y[B]||E;if(P+=ye,B+=1,P-w>3*r)break}n(13,a=B);const Be=l.length-a,Ue=C.offsetHeight-C.clientHeight;Ue>0&&(P+=Ue);let q=y.filter(ye=>typeof ye=="number");for(n(3,E=q.reduce((ye,v)=>ye+v,0)/q.length||30),n(5,m=Be*E),isFinite(m)||n(5,m=2e5),y.length=l.length;B<l.length;)B+=1,y[B]=E;r&&P>r?n(14,u=r):n(14,u=P)}async function ae(L){K(async()=>{if(typeof L!="number")return;const B=typeof L!="number"?!1:V(L);B!==!0&&(B==="back"&&await J(L,{behavior:"instant"}),B==="forwards"&&await J(L,{behavior:"instant"},!0))})}function V(L){const B=z&&z[L-_];if(!B&&L<_)return"back";if(!B&&L>=a-1)return"forwards";const{top:d}=C.getBoundingClientRect(),{top:P,bottom:Be}=B.getBoundingClientRect();return P-d<37?"back":Be-d>D?"forwards":!0}async function J(L,B,d=!1){await Ja();const P=E;let Be=L*P;d&&(Be=Be-D+P+w);const Ue=C.offsetHeight-C.clientHeight;Ue>0&&(Be+=Ue);const q={top:Be,behavior:"smooth",...B};C.scrollTo(q)}Ia(()=>{z=b.children,n(20,j=!0)});function p(){w=this.offsetHeight,n(7,w)}function ce(L){Si[L?"unshift":"push"](()=>{b=L,n(6,b)})}function fe(){S=this.offsetHeight,n(8,S)}function W(L){Si[L?"unshift":"push"](()=>{C=L,n(0,C)})}function U(){O=Ba.entries.get(this)?.contentRect,n(4,O)}return t.$$set=L=>{"items"in L&&n(17,o=L.items),"max_height"in L&&n(1,r=L.max_height),"actual_height"in L&&n(14,u=L.actual_height),"table_scrollbar_width"in L&&n(15,c=L.table_scrollbar_width),"start"in L&&n(12,_=L.start),"end"in L&&n(13,a=L.end),"selected"in L&&n(18,f=L.selected),"disable_scroll"in L&&n(2,k=L.disable_scroll),"show_scroll_button"in L&&n(16,A=L.show_scroll_button),"viewport"in L&&n(0,C=L.viewport),"$$scope"in L&&n(23,s=L.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16&&n(21,D=O?.height||200),t.$$.dirty[0]&131072&&n(22,l=o),t.$$.dirty[0]&7340033&&j&&D&&C.offsetParent&&K(oe),t.$$.dirty[0]&262144&&ae(f),t.$$.dirty[0]&4206602&&n(10,R=F?l.slice(_,a).map((L,B)=>({index:B+_,data:L})):l.slice(0,r/l.length*E+1).map((L,B)=>({index:B+_,data:L})))},[C,r,k,E,O,m,b,w,S,N,R,oe,_,a,u,c,A,o,f,J,j,D,l,s,i,p,ce,fe,W,U]}class Za extends Da{constructor(e){super(),Ta(this,e,Qa,Xa,Pa,{items:17,max_height:1,actual_height:14,table_scrollbar_width:15,start:12,end:13,selected:18,disable_scroll:2,show_scroll_button:16,viewport:0,scroll_to_index:19},null,[-1,-1])}get items(){return this.$$.ctx[17]}set items(e){this.$$set({items:e}),it()}get max_height(){return this.$$.ctx[1]}set max_height(e){this.$$set({max_height:e}),it()}get actual_height(){return this.$$.ctx[14]}set actual_height(e){this.$$set({actual_height:e}),it()}get table_scrollbar_width(){return this.$$.ctx[15]}set table_scrollbar_width(e){this.$$set({table_scrollbar_width:e}),it()}get start(){return this.$$.ctx[12]}set start(e){this.$$set({start:e}),it()}get end(){return this.$$.ctx[13]}set end(e){this.$$set({end:e}),it()}get selected(){return this.$$.ctx[18]}set selected(e){this.$$set({selected:e}),it()}get disable_scroll(){return this.$$.ctx[2]}set disable_scroll(e){this.$$set({disable_scroll:e}),it()}get show_scroll_button(){return this.$$.ctx[16]}set show_scroll_button(e){this.$$set({show_scroll_button:e}),it()}get viewport(){return this.$$.ctx[0]}set viewport(e){this.$$set({viewport:e}),it()}get scroll_to_index(){return this.$$.ctx[19]}}const{SvelteComponent:$a,append:re,attr:g,detach:st,empty:xa,flush:eu,init:tu,insert:ot,noop:Ti,safe_not_equal:nu,svg_element:Y}=window.__gradio__svelte__internal;function lu(t){let e,n,l,i,s,o;return{c(){e=Y("svg"),n=Y("path"),l=Y("path"),i=Y("path"),s=Y("path"),o=Y("path"),g(n,"d","M5 5H19"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(n,"stroke-linecap","round"),g(l,"d","M5 9H15"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"stroke-linecap","round"),g(i,"d","M5 13H11"),g(i,"stroke","currentColor"),g(i,"stroke-width","2"),g(i,"stroke-linecap","round"),g(s,"d","M5 17H7"),g(s,"stroke","currentColor"),g(s,"stroke-width","2"),g(s,"stroke-linecap","round"),g(o,"d","M17 17L21 21M21 17L17 21"),g(o,"stroke","currentColor"),g(o,"stroke-width","2"),g(o,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")}
5,m(r,u){ot(r,e,u),re(e,n),re(e,l),re(e,i),re(e,s),re(e,o)},d(r){r&&st(e)}}}function iu(t){let e,n,l,i;return{c(){e=Y("svg"),n=Y("path"),l=Y("path"),i=Y("path"),g(n,"d","M8 12L12 16L16 12"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(n,"fill","none"),g(n,"stroke-linecap","round"),g(n,"stroke-linejoin","round"),g(l,"d","M12 16V9"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"stroke-linecap","round"),g(i,"d","M5 5H19"),g(i,"stroke","currentColor"),g(i,"stroke-width","2"),g(i,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(s,o){ot(s,e,o),re(e,n),re(e,l),re(e,i)},d(s){s&&st(e)}}}function su(t){let e,n,l,i;return{c(){e=Y("svg"),n=Y("path"),l=Y("path"),i=Y("path"),g(n,"d","M8 16L12 12L16 16"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(n,"fill","none"),g(n,"stroke-linecap","round"),g(n,"stroke-linejoin","round"),g(l,"d","M12 12V19"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"stroke-linecap","round"),g(i,"d","M5 7H19"),g(i,"stroke","currentColor"),g(i,"stroke-width","2"),g(i,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(s,o){ot(s,e,o),re(e,n),re(e,l),re(e,i)},d(s){s&&st(e)}}}function ou(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","10"),g(n,"y","5"),g(n,"width","4"),g(n,"height","14"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(l,"d","M7 8L17 16M17 8L7 16"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function ru(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","5"),g(n,"y","10"),g(n,"width","14"),g(n,"height","4"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(l,"d","M8 7L16 17M16 7L8 17"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function _u(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","6"),g(n,"y","4"),g(n,"width","12"),g(n,"height","4"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(l,"d","M12 12V19M8 16L12 19L16 16"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"fill","none"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function au(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","6"),g(n,"y","16"),g(n,"width","12"),g(n,"height","4"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(l,"d","M12 12V5M8 8L12 5L16 8"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"fill","none"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function uu(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","16"),g(n,"y","6"),g(n,"width","4"),g(n,"height","12"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(n,"fill","none"),g(l,"d","M12 12H5M8 8L5 12L8 16"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"fill","none"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function cu(t){let e,n,l;return{c(){e=Y("svg"),n=Y("rect"),l=Y("path"),g(n,"x","4"),g(n,"y","6"),g(n,"width","4"),g(n,"height","12"),g(n,"stroke","currentColor"),g(n,"stroke-width","2"),g(n,"fill","none"),g(l,"d","M12 12H19M16 8L19 12L16 16"),g(l,"stroke","currentColor"),g(l,"stroke-width","2"),g(l,"fill","none"),g(l,"stroke-linecap","round"),g(e,"viewBox","0 0 24 24"),g(e,"width","16"),g(e,"height","16")},m(i,s){ot(i,e,s),re(e,n),re(e,l)},d(i){i&&st(e)}}}function fu(t){let e;function n(s,o){if(s[0]=="add-column-right")return cu;if(s[0]=="add-column-left")return uu;if(s[0]=="add-row-above")return au;if(s[0]=="add-row-below")return _u;if(s[0]=="delete-row")return ru;if(s[0]=="delete-column")return ou;if(s[0]=="sort-asc")return su;if(s[0]=="sort-desc")return iu;if(s[0]=="clear-sort")return lu}let l=n(t),i=l&&l(t);return{c(){i&&i.c(),e=xa()},m(s,o){i&&i.m(s,o),ot(s,e,o)},p(s,[o]){l!==(l=n(s))&&(i&&i.d(1),i=l&&l(s),i&&(i.c(),i.m(e.parentNode,e)))},i:Ti,o:Ti,d(s){s&&st(e),i&&i.d(s)}}}function hu(t,e,n){let{icon:l}=e;return t.$$set=i=>{"icon"in i&&n(0,l=i.icon)},[l]}class ht extends $a{constructor(e){super(),tu(this,e,hu,fu,nu,{icon:0})}get icon(){return this.$$.ctx[0]}set icon(e){this.$$set({icon:e}),eu()}}const{SvelteComponent:du,append:se,attr:ee,binding_callbacks:mu,check_outros:Ut,create_component:dt,destroy_component:mt,detach:me,element:$e,empty:Es,flush:be,group_outros:Wt,init:gu,insert:ge,is_function:yl,listen:gt,mount_component:bt,run_all:Cl,safe_not_equal:bu,set_data:tt,space:ke,text:nt,toggle_class:un,transition_in:ie,transition_out:ve}=window.__gradio__svelte__internal,{onMount:wu}=window.__gradio__svelte__internal;function Ni(t){let e,n,l,i=t[12]("dataframe.sort_ascending")+"",s,o,r,u,c,_,a=t[12]("dataframe.sort_descending")+"",f,k,A,C,E,m,b=t[12]("dataframe.clear_sort")+"",w,S,y,j;n=new ht({props:{icon:"sort-asc"}});let z=t[10]==="asc"&&t[11]!==null&&Hi(t);c=new ht({props:{icon:"sort-desc"}});let N=t[10]==="desc"&&t[11]!==null&&Oi(t);return E=new ht({props:{icon:"clear-sort"}}),{c(){e=$e("button"),dt(n.$$.fragment),l=ke(),s=nt(i),o=ke(),z&&z.c(),r=ke(),u=$e("button"),dt(c.$$.fragment),_=ke(),f=nt(a),k=ke(),N&&N.c(),A=ke(),C=$e("button"),dt(E.$$.fragment),m=ke(),w=nt(b),ee(e,"role","menuitem"),ee(e,"class","svelte-42thj4"),un(e,"active",t[10]==="asc"),ee(u,"role","menuitem"),ee(u,"class","svelte-42thj4"),un(u,"active",t[10]==="desc"),ee(C,"role","menuitem"),ee(C,"class","svelte-42thj4")},m(D,R){ge(D,e,R),bt(n,e,null),se(e,l),se(e,s),se(e,o),z&&z.m(e,null),ge(D,r,R),ge(D,u,R),bt(c,u,null),se(u,_),se(u,f),se(u,k),N&&N.m(u,null),ge(D,A,R),ge(D,C,R),bt(E,C,null),se(C,m),se(C,w),S=!0,y||(j=[gt(e,"click",t[23]),gt(u,"click",t[24]),gt(C,"click",function(){yl(t[9])&&t[9].apply(this,arguments)})],y=!0)},p(D,R){t=D,(!S||R&4096)&&i!==(i=t[12]("dataframe.sort_ascending")+"")&&tt(s,i),t[10]==="asc"&&t[11]!==null?z?z.p(t,R):(z=Hi(t),z.c(),z.m(e,null)):z&&(z.d(1),z=null),(!S||R&1024)&&un(e,"active",t[10]==="asc"),(!S||R&4096)&&a!==(a=t[12]("dataframe.sort_descending")+"")&&tt(f,a),t[10]==="desc"&&t[11]!==null?N?N.p(t,R):(N=Oi(t),N.c(),N.m(u,null)):N&&(N.d(1),N=null),(!S||R&1024)&&un(u,"active",t[10]==="desc"),(!S||R&4096)&&b!==(b=t[12]("dataframe.clear_sort")+"")&&tt(w,b)},i(D){S||(ie(n.$$.fragment,D),ie(c.$$.fragment,D),ie(E.$$.fragment,D),S=!0)},o(D){ve(n.$$.fragment,D),ve(c.$$.fragment,D),ve(E.$$.fragment,D),S=!1},d(D){D&&(me(e),me(r),me(u),me(A),me(C)),mt(n),z&&z.d(),mt(c),N&&N.d(),mt(E),y=!1,Cl(j)}}}function Hi(t){let e,n;return{c(){e=$e("span"),n=nt(t[11]),ee(e,"class","priority svelte-42thj4")},m(l,i){ge(l,e,i),se(e,n)},p(l,i){i&2048&&tt(n,l[11])},d(l){l&&me(e)}}}function Oi(t){let e,n;return{c(){e=$e("span"),n=nt(t[11]),ee(e,"class","priority svelte-42thj4")},m(l,i){ge(l,e,i),se(e,n)},p(l,i){i&2048&&tt(n,l[11])},d(l){l&&me(e)}}}function Pi(t){let e,n,l,i=t[12]("dataframe.add_row_above")+"",s,o,r,u,c,_=t[12]("dataframe.add_row_below")+"",a,f,k,A,C,E;n=new ht({props:{icon:"add-row-above"}}),u=new ht({props:{icon:"add-row-below"}});let m=t[6]&&Ri(t);return{c(){e=$e("button"),dt(n.$$.fragment),l=ke(),s=nt(i),o=ke(),r=$e("button"),dt(u.$$.fragment),c=ke(),a=nt(_),f=ke(),m&&m.c(),k=Es(),ee(e,"role","menuitem"),ee(e,"aria-label","Add row above"),ee(e,"class","svelte-42thj4"),ee(r,"role","menuitem"),ee(r,"aria-label","Add row below"),ee(r,"class","svelte-42thj4")},m(b,w){ge(b,e,w),bt(n,e,null),se(e,l),se(e,s),ge(b,o,w),ge(b,r,w),bt(u,r,null),se(r,c),se(r,a),ge(b,f,w),m&&m.m(b,w),ge(b,k,w),A=!0,C||(E=[gt(e,"click",t[25]),gt(r,"click",t[26])],C=!0)},p(b,w){(!A||w&4096)&&i!==(i=b[12]("dataframe.add_row_above")+"")&&tt(s,i),(!A||w&4096)&&_!==(_=b[12]("dataframe.add_row_below")+"")&&tt(a,_),b[6]?m?(m.p(b,w),w&64&&ie(m,1)):(m=Ri(b),m.c(),ie(m,1),m.m(k.parentNode,k)
5):m&&(Wt(),ve(m,1,1,()=>{m=null}),Ut())},i(b){A||(ie(n.$$.fragment,b),ie(u.$$.fragment,b),ie(m),A=!0)},o(b){ve(n.$$.fragment,b),ve(u.$$.fragment,b),ve(m),A=!1},d(b){b&&(me(e),me(o),me(r),me(f),me(k)),mt(n),mt(u),m&&m.d(b),C=!1,Cl(E)}}}function Ri(t){let e,n,l,i=t[12]("dataframe.delete_row")+"",s,o,r,u;return n=new ht({props:{icon:"delete-row"}}),{c(){e=$e("button"),dt(n.$$.fragment),l=ke(),s=nt(i),ee(e,"role","menuitem"),ee(e,"class","delete svelte-42thj4"),ee(e,"aria-label","Delete row")},m(c,_){ge(c,e,_),bt(n,e,null),se(e,l),se(e,s),o=!0,r||(u=gt(e,"click",function(){yl(t[4])&&t[4].apply(this,arguments)}),r=!0)},p(c,_){t=c,(!o||_&4096)&&i!==(i=t[12]("dataframe.delete_row")+"")&&tt(s,i)},i(c){o||(ie(n.$$.fragment,c),o=!0)},o(c){ve(n.$$.fragment,c),o=!1},d(c){c&&me(e),mt(n),r=!1,u()}}}function Fi(t){let e,n,l,i=t[12]("dataframe.add_column_left")+"",s,o,r,u,c,_=t[12]("dataframe.add_column_right")+"",a,f,k,A,C,E;n=new ht({props:{icon:"add-column-left"}}),u=new ht({props:{icon:"add-column-right"}});let m=t[7]&&Ii(t);return{c(){e=$e("button"),dt(n.$$.fragment),l=ke(),s=nt(i),o=ke(),r=$e("button"),dt(u.$$.fragment),c=ke(),a=nt(_),f=ke(),m&&m.c(),k=Es(),ee(e,"role","menuitem"),ee(e,"aria-label","Add column to the left"),ee(e,"class","svelte-42thj4"),ee(r,"role","menuitem"),ee(r,"aria-label","Add column to the right"),ee(r,"class","svelte-42thj4")},m(b,w){ge(b,e,w),bt(n,e,null),se(e,l),se(e,s),ge(b,o,w),ge(b,r,w),bt(u,r,null),se(r,c),se(r,a),ge(b,f,w),m&&m.m(b,w),ge(b,k,w),A=!0,C||(E=[gt(e,"click",t[27]),gt(r,"click",t[28])],C=!0)},p(b,w){(!A||w&4096)&&i!==(i=b[12]("dataframe.add_column_left")+"")&&tt(s,i),(!A||w&4096)&&_!==(_=b[12]("dataframe.add_column_right")+"")&&tt(a,_),b[7]?m?(m.p(b,w),w&128&&ie(m,1)):(m=Ii(b),m.c(),ie(m,1),m.m(k.parentNode,k)):m&&(Wt(),ve(m,1,1,()=>{m=null}),Ut())},i(b){A||(ie(n.$$.fragment,b),ie(u.$$.fragment,b),ie(m),A=!0)},o(b){ve(n.$$.fragment,b),ve(u.$$.fragment,b),ve(m),A=!1},d(b){b&&(me(e),me(o),me(r),me(f),me(k)),mt(n),mt(u),m&&m.d(b),C=!1,Cl(E)}}}function Ii(t){let e,n,l,i=t[12]("dataframe.delete_column")+"",s,o,r,u;return n=new ht({props:{icon:"delete-column"}}),{c(){e=$e("button"),dt(n.$$.fragment),l=ke(),s=nt(i),ee(e,"role","menuitem"),ee(e,"class","delete svelte-42thj4"),ee(e,"aria-label","Delete column")},m(c,_){ge(c,e,_),bt(n,e,null),se(e,l),se(e,s),o=!0,r||(u=gt(e,"click",function(){yl(t[5])&&t[5].apply(this,arguments)}),r=!0)},p(c,_){t=c,(!o||_&4096)&&i!==(i=t[12]("dataframe.delete_column")+"")&&tt(s,i)},i(c){o||(ie(n.$$.fragment,c),o=!0)},o(c){ve(n.$$.fragment,c),o=!1},d(c){c&&me(e),mt(n),r=!1,u()}}}function ku(t){let e,n,l,i,s=t[16]&&Ni(t),o=!t[16]&&t[15]&&Pi(t),r=t[14]&&Fi(t);return{c(){e=$e("div"),s&&s.c(),n=ke(),o&&o.c(),l=ke(),r&&r.c(),ee(e,"class","cell-menu svelte-42thj4"),ee(e,"role","menu")},m(u,c){ge(u,e,c),s&&s.m(e,null),se(e,n),o&&o.m(e,null),se(e,l),r&&r.m(e,null),t[29](e),i=!0},p(u,[c]){u[16]?s?(s.p(u,c),c&65536&&ie(s,1)):(s=Ni(u),s.c(),ie(s,1),s.m(e,n)):s&&(Wt(),ve(s,1,1,()=>{s=null}),Ut()),!u[16]&&u[15]?o?(o.p(u,c),c&98304&&ie(o,1)):(o=Pi(u),o.c(),ie(o,1),o.m(e,l)):o&&(Wt(),ve(o,1,1,()=>{o=null}),Ut()),u[14]?r?(r.p(u,c),c&16384&&ie(r,1)):(r=Fi(u),r.c(),ie(r,1),r.m(e,null)):r&&(Wt(),ve(r,1,1,()=>{r=null}),Ut())},i(u){i||(ie(s),ie(o),ie(r),i=!0)},o(u){ve(s),ve(o),ve(r),i=!1},d(u){u&&me(e),s&&s.d(),o&&o.d(),r&&r.d(),t[29](null)}}}function pu(t,e,n){let l,i,s,{x:o}=e,{y:r}=e,{on_add_row_above:u}=e,{on_add_row_below:c}=e,{on_add_column_left:_}=e,{on_add_column_right:a}=e,{row:f}=e,{col_count:k}=e,{row_count:A}=e,{on_delete_row:C}=e,{on_delete_col:E}=e,{can_delete_rows:m}=e,{can_delete_cols:b}=e,{on_sort:w=()=>{}}=e,{on_clear_sort:S=()=>{}}=e,{sort_direction:y=null}=e,{sort_priority:j=null}=e,{editable:z=!0}=e,{i18n:N}=e,D;wu(()=>{R()});function R(){if(!D)return;const p=window.innerWidth,ce=window.innerHeight,fe=D.getBoundingClientRect();let W=o-30,U=r-20;W+fe.width>p&&(W=o-fe.width+10),U+fe.height>ce&&(U=r-fe.height+10),n(13,D.style.left=`${W}px`,D),n(13,D.style.top=`${U}px`,D)}const O=()=>w("asc"),F=()=>w("desc"),K=()=>u(),oe=()=>c(),ae=()=>_(),V=()=>a();function J(p){mu[p?"unshift":"push"](()=>{D=p,n(13,D)})}return t.$$set=p=>{"x"in p&&n(17,o=p.x),"y"in p&&n(18,r=p.y),"on_add_row_above"in p&&n(0,u=p.on_add_row_above),"on_add_row_below"in p&&n(1,c=p.on_add_row_below),"on_add_column_left"in p&&n(2,_=p.on_add_column_left),"on_add_column_right"in p&&n(3,a=p.on_add_column_right),"row"in p&&n(19,f=p.row),"col_count"in p&&n(20,k=p.col_count),"row_count"in p&&n(21,A=p.row_count),"on_delete_row"in p&&n(4,C=p.on_delete_row),"on_delete_col"in p&&n(5,E=p.on_delete_col),"can_delete_rows"in p&&n(6,m=p.can_delete_rows),"can_delete_cols"in p&&n(7,b=p.can_delete_cols),"on_sort"in p&&n(8,w=p.on_sort),"on_clear_sort"in p&&n(9,S=p.on_clear_sort),"sort_direction"in p&&n(10,y=p.sort_direction),"sort_priority"in p&&n(11,j=p.sort_priority),"editable"in p&&n(22,z=p.editable),"i18n"in p&&n(12,N=p.i18n)},t.$$.update=()=>{t.$$.dirty&524288&&n(16,l=f===-1),t.$$.dirty&6291456&&n(15,i=z&&A[1]==="dynamic"),t.$$.dirty&5242880&&n(14,s=z&&k[1]==="dynamic")},[u,c,_,a,C,E,m,b,w,S,y,j,N,D,s,i,l,o,r,f,k,A,z,O,F,K,oe,ae,V,J]}
5class vu extends du{constructor(e){super(),gu(this,e,pu,ku,bu,{x:17,y:18,on_add_row_above:0,on_add_row_below:1,on_add_column_left:2,on_add_column_right:3,row:19,col_count:20,row_count:21,on_delete_row:4,on_delete_col:5,can_delete_rows:6,can_delete_cols:7,on_sort:8,on_clear_sort:9,sort_direction:10,sort_priority:11,editable:22,i18n:12})}get x(){return this.$$.ctx[17]}set x(e){this.$$set({x:e}),be()}get y(){return this.$$.ctx[18]}set y(e){this.$$set({y:e}),be()}get on_add_row_above(){return this.$$.ctx[0]}set on_add_row_above(e){this.$$set({on_add_row_above:e}),be()}get on_add_row_below(){return this.$$.ctx[1]}set on_add_row_below(e){this.$$set({on_add_row_below:e}),be()}get on_add_column_left(){return this.$$.ctx[2]}set on_add_column_left(e){this.$$set({on_add_column_left:e}),be()}get on_add_column_right(){return this.$$.ctx[3]}set on_add_column_right(e){this.$$set({on_add_column_right:e}),be()}get row(){return this.$$.ctx[19]}set row(e){this.$$set({row:e}),be()}get col_count(){return this.$$.ctx[20]}set col_count(e){this.$$set({col_count:e}),be()}get row_count(){return this.$$.ctx[21]}set row_count(e){this.$$set({row_count:e}),be()}get on_delete_row(){return this.$$.ctx[4]}set on_delete_row(e){this.$$set({on_delete_row:e}),be()}get on_delete_col(){return this.$$.ctx[5]}set on_delete_col(e){this.$$set({on_delete_col:e}),be()}get can_delete_rows(){return this.$$.ctx[6]}set can_delete_rows(e){this.$$set({can_delete_rows:e}),be()}get can_delete_cols(){return this.$$.ctx[7]}set can_delete_cols(e){this.$$set({can_delete_cols:e}),be()}get on_sort(){return this.$$.ctx[8]}set on_sort(e){this.$$set({on_sort:e}),be()}get on_clear_sort(){return this.$$.ctx[9]}set on_clear_sort(e){this.$$set({on_clear_sort:e}),be()}get sort_direction(){return this.$$.ctx[10]}set sort_direction(e){this.$$set({sort_direction:e}),be()}get sort_priority(){return this.$$.ctx[11]}set sort_priority(e){this.$$set({sort_priority:e}),be()}get editable(){return this.$$.ctx[22]}set editable(e){this.$$set({editable:e}),be()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),be()}}const{SvelteComponent:yu,append:Yt,attr:pe,bubble:Cu,check_outros:Xt,create_component:qn,destroy_component:Mn,detach:An,element:Ot,flush:qt,group_outros:Gt,init:Su,insert:En,is_function:qu,listen:Sl,mount_component:Ln,safe_not_equal:Mu,space:al,toggle_class:Ji,transition_in:Se,transition_out:Ne}=window.__gradio__svelte__internal,{onDestroy:Au}=window.__gradio__svelte__internal,{createEventDispatcher:Eu}=window.__gradio__svelte__internal;function Ki(t){let e,n,l,i,s,o,r,u,c,_=t[0]&&t[3]==="filter"&&Vi(t);return{c(){e=Ot("div"),n=Ot("input"),o=al(),_&&_.c(),pe(n,"type","text"),n.value=l=t[0]||"",pe(n,"placeholder",i=t[3]==="filter"?"Filter...":"Search..."),pe(n,"class","search-input svelte-b1nr0g"),pe(n,"title",s=`Enter text to ${t[3]} the table`),Ji(n,"filter-mode",t[3]==="filter"),pe(e,"class","search-container svelte-b1nr0g")},m(a,f){En(a,e,f),Yt(e,n),Yt(e,o),_&&_.m(e,null),r=!0,u||(c=Sl(n,"input",t[7]),u=!0)},p(a,f){(!r||f&1&&l!==(l=a[0]||"")&&n.value!==l)&&(n.value=l),(!r||f&8&&i!==(i=a[3]==="filter"?"Filter...":"Search..."))&&pe(n,"placeholder",i),(!r||f&8&&s!==(s=`Enter text to ${a[3]} the table`))&&pe(n,"title",s),(!r||f&8)&&Ji(n,"filter-mode",a[3]==="filter"),a[0]&&a[3]==="filter"?_?(_.p(a,f),f&9&&Se(_,1)):(_=Vi(a),_.c(),Se(_,1),_.m(e,null)):_&&(Gt(),Ne(_,1,1,()=>{_=null}),Xt())},i(a){r||(Se(_),r=!0)},o(a){Ne(_),r=!1},d(a){a&&An(e),_&&_.d(),u=!1,c()}}}function Vi(t){let e,n,l,i,s;return n=new ds({}),{c(){e=Ot("button"),qn(n.$$.fragment),pe(e,"class","toolbar-button check-button svelte-b1nr0g"),pe(e,"aria-label","Apply filter and update dataframe values"),pe(e,"title","Apply filter and update dataframe values")},m(o,r){En(o,e,r),Ln(n,e,null),l=!0,i||(s=Sl(e,"click",function(){qu(t[5])&&t[5].apply(this,arguments)}),i=!0)}
5,p(o,r){t=o},i(o){l||(Se(n.$$.fragment,o),l=!0)},o(o){Ne(n.$$.fragment,o),l=!1},d(o){o&&An(e),Mn(n),i=!1,s()}}}function Ui(t){let e,n,l,i,s,o,r,u;const c=[ju,Lu],_=[];function a(f,k){return f[6]?0:1}return n=a(t),l=_[n]=c[n](t),{c(){e=Ot("button"),l.c(),pe(e,"class","toolbar-button svelte-b1nr0g"),pe(e,"aria-label",i=t[6]?"Copied to clipboard":"Copy table data"),pe(e,"title",s=t[6]?"Copied to clipboard":"Copy table data")},m(f,k){En(f,e,k),_[n].m(e,null),o=!0,r||(u=Sl(e,"click",t[8]),r=!0)},p(f,k){let A=n;n=a(f),n!==A&&(Gt(),Ne(_[A],1,1,()=>{_[A]=null}),Xt(),l=_[n],l||(l=_[n]=c[n](f),l.c()),Se(l,1),l.m(e,null)),(!o||k&64&&i!==(i=f[6]?"Copied to clipboard":"Copy table data"))&&pe(e,"aria-label",i),(!o||k&64&&s!==(s=f[6]?"Copied to clipboard":"Copy table data"))&&pe(e,"title",s)},i(f){o||(Se(l),o=!0)},o(f){Ne(l),o=!1},d(f){f&&An(e),_[n].d(),r=!1,u()}}}function Lu(t){let e,n;return e=new No({}),{c(){qn(e.$$.fragment)},m(l,i){Ln(e,l,i),n=!0},i(l){n||(Se(e.$$.fragment,l),n=!0)},o(l){Ne(e.$$.fragment,l),n=!1},d(l){Mn(e,l)}}}function ju(t){let e,n;return e=new ds({}),{c(){qn(e.$$.fragment)},m(l,i){Ln(e,l,i),n=!0},i(l){n||(Se(e.$$.fragment,l),n=!0)},o(l){Ne(e.$$.fragment,l),n=!1},d(l){Mn(e,l)}}}function Wi(t){let e,n;return e=new Ho({props:{fullscreen:t[4]}}),e.$on("fullscreen",t[10]),{c(){qn(e.$$.fragment)},m(l,i){Ln(e,l,i),n=!0},p(l,i){const s={};i&16&&(s.fullscreen=l[4]),e.$set(s)},i(l){n||(Se(e.$$.fragment,l),n=!0)},o(l){Ne(e.$$.fragment,l),n=!1},d(l){Mn(e,l)}}}function zu(t){let e,n,l,i,s,o=t[3]!=="none"&&Ki(t),r=t[2]&&Ui(t),u=t[1]&&Wi(t);return{c(){e=Ot("div"),n=Ot("div"),o&&o.c(),l=al(),r&&r.c(),i=al(),u&&u.c(),pe(n,"class","toolbar-buttons svelte-b1nr0g"),pe(e,"class","toolbar svelte-b1nr0g"),pe(e,"role","toolbar"),pe(e,"aria-label","Table actions")},m(c,_){En(c,e,_),Yt(e,n),o&&o.m(n,null),Yt(n,l),r&&r.m(n,null),Yt(n,i),u&&u.m(n,null),s=!0},p(c,[_]){c[3]!=="none"?o?(o.p(c,_),_&8&&Se(o,1)):(o=Ki(c),o.c(),Se(o,1),o.m(n,l)):o&&(Gt(),Ne(o,1,1,()=>{o=null}),Xt()),c[2]?r?(r.p(c,_),_&4&&Se(r,1)):(r=Ui(c),r.c(),Se(r,1),r.m(n,i)):r&&(Gt(),Ne(r,1,1,()=>{r=null}),Xt()),c[1]?u?(u.p(c,_),_&2&&Se(u,1)):(u=Wi(c),u.c(),Se(u,1),u.m(n,null)):u&&(Gt(),Ne(u,1,1,()=>{u=null}),Xt())},i(c){s||(Se(o),Se(r),Se(u),s=!0)},o(c){Ne(o),Ne(r),Ne(u),s=!1},d(c){c&&An(e),o&&o.d(),r&&r.d(),u&&u.d()}}}function Bu(t,e,n){let{show_fullscreen_button:l=!1}=e,{show_copy_button:i=!1}=e,{show_search:s="none"}=e,{fullscreen:o=!1}=e,{on_copy:r}=e,{on_commit_filter:u}=e;const c=Eu();let _=!1,a,{current_search_query:f=null}=e,k="";function A(b){k=b.target.value;const S=k||null;f!==S&&(n(0,f=S),c("search",f))}function C(){n(6,_=!0),a&&clearTimeout(a),a=setTimeout(()=>{n(6,_=!1)},2e3)}async function E(){await r(),C()}Au(()=>{a&&clearTimeout(a)});function m(b){Cu.call(this,t,b)}return t.$$set=b=>{"show_fullscreen_button"in b&&n(1,l=b.show_fullscreen_button),"show_copy_button"in b&&n(2,i=b.show_copy_button),"show_search"in b&&n(3,s=b.show_search),"fullscreen"in b&&n(4,o=b.fullscreen),"on_copy"in b&&n(9,r=b.on_copy),"on_commit_filter"in b&&n(5,u=b.on_commit_filter),"current_search_query"in b&&n(0,f=b.current_search_query)},[f,l,i,s,o,u,_,A,E,r,m]}class Du extends yu{constructor(e){super(),Su(this,e,Bu,zu,Mu,{show_fullscreen_button:1,show_copy_button:2,show_search:3,fullscreen:4,on_copy:9,on_commit_filter:5,current_search_query:0})}get show_fullscreen_button(){return this.$$.ctx[1]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),qt()}get show_copy_button(){return this.$$.ctx[2]}set show_copy_button(e){this.$$set({show_copy_button:e}),qt()}get show_search(){return this.$$.ctx[3]}set show_search(e){this.$$set({show_search:e}),qt()}get fullscreen(){return this.$$.ctx[4]}set fullscreen(e){this.$$set({fullscreen:e}),qt()}get on_copy(){return this.$$.ctx[9]}set on_copy(e){this.$$set({on_copy:e}),qt()}get on_commit_filter(){return this.$$.ctx[5]}set on_commit_filter(e){this.$$set({on_commit_filter:e}),qt()}get current_search_query(){return this.$$.ctx[0]}set current_search_query(e){this.$$set({current_search_query:e}),qt()}}function cn(t,e,n,l){let i=t||[];if(e[1]==="fixed"&&i.length<e[0]){const s=Array(e[0]-i.length).fill("").map((o,r)=>
5`${r+i.length}`);i=i.concat(s)}return!i||i.length===0?Array(e[0]).fill(0).map((s,o)=>{const r=l();return n[r]={cell:null,input:null},{id:r,value:JSON.stringify(o+1)}}):i.map((s,o)=>{const r=l();return n[r]={cell:null,input:null},{id:r,value:s??""}})}function Tu(t,e,n,l,i=null){return!t||t.length===0?[]:t.map((o,r)=>o.map((u,c)=>{const _=l();e[_]={cell:null,input:null},n[_]=u;let a=i?.[r]?.[c];return a===void 0&&(a=String(u)),{id:_,value:u,display_value:a}}))}const{tick:Nu}=window.__gradio__svelte__internal;async function Ls(t,e,n,l){if(!e.data||!e.data[n]||!e.data[n][l])return;const i=e.data[n][l].value;e.data[n][l].value=t,i!==t&&e.dispatch&&e.dispatch("change",{data:e.data.map(s=>s.map(o=>o.value)),headers:e.headers?.map(s=>s.value)||[],metadata:null}),e.actions.set_selected([n,l])}async function Hu(t,e,n){if(!e.data||!e.headers||!e.els)return;const l=t.target;!l||l.value===void 0||await Ls(l.type==="checkbox"?String(l.checked):l.value,e,n[0],n[1])}function Ou(t,e){const n=Me(e.state),l=n.ui_state.selected_header,i=n.ui_state.header_edit,s=e.headers||[];if(l===!1||i!==!1)return!1;switch(t.key){case"ArrowDown":return e.actions.set_selected_header(!1),e.actions.set_selected([0,l]),e.actions.set_selected_cells([[0,l]]),!0;case"ArrowLeft":return e.actions.set_selected_header(l>0?l-1:l),!0;case"ArrowRight":return e.actions.set_selected_header(l<s.length-1?l+1:l),!0;case"Escape":return t.preventDefault(),e.actions.set_selected_header(!1),!0;case"Enter":return t.preventDefault(),n.config.editable&&e.actions.set_header_edit(l),!0}return!1}function js(t,e){if(!e.data||!e.headers||!e.els||!e.dispatch)return!1;const n=Me(e.state);if(!n.config.editable||t.key!=="Delete"&&t.key!=="Backspace")return!1;const l=n.ui_state.editing,i=n.ui_state.selected_cells;if(l){const[s,o]=l,r=e.els[e.data[s][o].id]?.input;if(r&&r.selectionStart!==r.selectionEnd||t.key==="Delete"&&r?.selectionStart!==r?.value.length||t.key==="Backspace"&&r?.selectionStart!==0)return!1}if(t.preventDefault(),i.length>0){const s=Xo(e.data,i);e.dispatch("change",{data:s.map(o=>o.map(r=>r.value)),headers:e.headers.map(o=>o.value),metadata:null})}return!0}function Pu(t,e,n,l){const i=Me(e.state),s=i.ui_state.editing,o=i.ui_state.selected_cells;if(s||!e.data)return!1;t.preventDefault();const r=e.actions.move_cursor(t,[n,l],e.data);return r?(t.shiftKey?(e.actions.set_selected_cells(e.actions.get_range_selection(o.length>0?o[0]:[n,l],r)),e.actions.set_editing(!1)):(e.actions.set_selected_cells([r]),e.actions.set_editing(!1)),e.actions.set_selected(r)):r===!1&&t.key==="ArrowUp"&&n===0&&(e.actions.set_selected_header(l),e.actions.set_selected(!1),e.actions.set_selected_cells([]),e.actions.set_editing(!1)),!0}async function Ru(t,e,n,l){if(!e.data||!e.els)return!1;const i=Me(e.state);if(!i.config.editable)return!1;t.preventDefault();const s=i.ui_state.editing;if(s&&Vt(s,[n,l])){const o=e.data[n][l].id,r=e.els[o]?.input;r&&await Ls(r.value,e,n,l),e.actions.set_editing(!1)}else e.actions.set_editing([n,l]);return!0}function Fu(t,e,n,l){if(!e.data)return!1;t.preventDefault(),e.actions.set_editing(!1);const i=e.actions.get_next_cell_coordinates([n,l],e.data,t.shiftKey);return i&&(e.actions.set_selected_cells([i]),e.actions.set_selected(i),Me(e.state).config.editable&&e.actions.set_editing(i)),!0}function Iu(t,e,n,l){const i=Me(e.state);if(!i.config.editable)return!1;const s=i.ui_state.editing;return(!s||s&&Vt(s,[n,l]))&&t.key.length===1?(e.actions.set_editing([n,l]),!0):!1}async function Ju(t,e){if(!e.data)return!1;const n=Me(e.state),l=n.ui_state.selected,i=n.ui_state.selected_cells;if(!l)return!1;if(t.key==="c"&&(t.metaKey||t.ctrlKey))return t.preventDefault(),i.length>0&&await gs(e.data,i),e.actions.set_copy_flash(!0),!0;const[s,o]=l;switch(t.key){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":return Pu(t,e,s,o);case"Escape":return n.config.editable?(t.preventDefault(),e.actions.set_editing(!1),Nu().then(()=>{e.parent_element&&e.parent_element.focus()}),!0):!1;case"Enter":return await Ru(t,e,s,o);case"Tab":return Fu(t,e,s,o);case"Delete":case"Backspace":return js(t,e);default:return Iu(t,e,s,o)}}async function Ku(t,e){Ou(t,e)||js(t,e)||await Ju(t,e)}function Vu(t,e,n,l,i,s,o){const r=(_,a,f)=>{_.target instanceof HTMLAnchorElement||s&&f===-1||(_.preventDefault(),_.stopPropagation(),t.mouse_down_pos={x:_.clientX,y:_.clientY},t.drag_start=[a,f],!_.shiftKey&&!_.metaKey&&!_.ctrlKey&&(n([[a,f]]),l([a,f]),i(_,a,f)))},u=_=>{const a=_.target.closest("td");if(!a)return;const f=parseInt(a.getAttribute("data-row")||"0"),k=parseInt(a.getAttribute("data-col")||"0");if(isNaN(f)||isNaN(k))return;const A=ml(t.drag_start,[f,k]);n(A),l([f,k])},c=_=>{!t.is_dragging&&t.drag_start?i(_,t.drag_start[0],t.drag_start[1]):t.is_dragging&&o&&o.focus(),t.is_dragging=!1,e(!1),t.drag_start=null,t.mouse_down_pos=null};return{handle_mouse_down:r,handle_mouse_move(_){if(!t.drag_start||!t.mouse_down_pos)return;if(!(_.buttons&1)){c(_);return}const a=Math.abs(_.clientX-t.mouse_down_pos.x),f=Math.abs(_.clientY-t.mouse_down_pos.y);!t.is_dragging&&(a>3||f>3)&&(t.is_dragging=!0,e(!0)),t.is_dragging&&u(_)},handle_mouse_up:c}}const{SvelteComponent:Uu,add_flush_callback:Ge,append:_e,attr:le,bind:Qe,binding_callbacks:De,bubble:Wu,check_outros:xe,component_subscribe:Yu,create_component:Je,destroy_component:Ke,detach:Ae,element:qe,empty:xt,ensure_array_like:vt,flush:$,globals:Xu,group_outros:et,init:Gu,insert:Ee,is_function:tl,listen:Bt,mount_component:Ve,noop:zs,outro_and_destroy_block:kn,run_all:Qu,safe_not_equal:Zu,set_data:ql,set_style:Yi,space:Re,text:Ml,toggle_class:pt,transition_in:I,transition_out:X,update_keyed_each:pn}=window.__gradio__svelte__internal,{Map:vn,window:$u}=Xu,{afterUpdate:xu,createEventDispatcher:ec,tick:tc,onMount:Xi}=window.__gradio__svelte__internal;function Gi(t,e,n){const l=t.slice();return l[140]=e[n].value,l[141]=e[n].id,l[144]=e,l[145]=n,l}function Qi(t,e,n){const l=t.slice();return l[140]=e[n].value,l[141]=e[n].id,l[142]=e,l[143]=n,l}function Zi(t,e,n){const l=t.slice();return l[140]=e[n].value,l[141]=e[n].id,l[146]=e,l[143]=n,l}function $i(t,e,n){const l=t.slice();return l[140]=e[n].value,l[141]=e[n].id,l[147]=e,l[145]=n,l}function xi(t){let e,n,l,i,s=t[3]&&t[3].length!==0&&t[4]&&es(t);return l=new Du({props:{show_fullscreen_button:t[18],fullscreen:t[23],on_copy:t[87],show_copy_button:t[19],show_search:t[21],on_commit_filter:t[66],current_search_query:t[33].current_search_query}}),l.$on("search",t[88]),l.$on("fullscreen",t[89]),{c(){e=qe("div"),s&&s.c(),n=Re(),Je(l.$$.fragment),le(e,"class","header-row svelte-1vwr9xf")},m(o,r){Ee(o,e,r),s&&s.m(e,null),_e(e,n),Ve(l,e,null),i=!0},p(o,r){o[3]&&o[3].length!==0&&o[4]?s?s.p(o,r):(s=es(o),s.c(),s.m(e,n)):s&&(s.d(1),s=null);const u={};r[0]&262144&&(u.show_fullscreen_button=o[18]),r[0]&8388608&&(u.fullscreen=o[23]),r[0]&67108864&&(u.on_copy=o[87]),r[0]&524288&&(u.show_copy_button=o[19]),r[0]&2097152&&(u.show_search=o[21]),r[1]&4&&(u.current_search_query=o[33].current_search_query),l.$set(u)},i(o){i||(I(l.$$.fragment,o),i=!0)},o(o){X(l.$$.fragment,o),i=!1},d(o){o&&Ae(e),s&&s.d(),Ke(l)}}}function es(t){let e,n,l;return{c(){e=qe("div"),n=qe("p"),l=Ml(t[3]),le(n,"class","svelte-1vwr9xf"),le(e,"class","label svelte-1vwr9xf")},m(i,s){Ee(i,e,s),_e(e,n),_e(n,l)},p(i,s){s[0]&8&&ql(l,i[3])},d(i){i&&Ae(e)}}}function ts(t){let e,n;return{c(){e=qe("caption"),n=Ml(t[3]),le(e,"class","sr-only svelte-1vwr9xf")},m(l,i){Ee(l,e,i),_e(e,n)},p(l,i){i[0]&8&&ql(n,l[3])},d(l){l&&Ae(e)}}}function ns(t){let e,n;return e=new yn({props:{is_header:!0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}
5}}function ls(t,e){let n,l,i,s,o;function r(_){e[90](_,e[145])}function u(_){e[91](_,e[141])}let c={i:e[145],actual_pinned_columns:e[53],header_edit:e[52],selected_header:e[51],headers:e[0],get_cell_width:Al,handle_header_click:e[58],toggle_header_menu:e[63],end_header_edit:e[59],sort_columns:e[33].sort_state.sort_columns,latex_delimiters:e[7],line_breaks:e[14],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[145]),i18n:e[12],col_count:e[5]};return e[25][e[145]].value!==void 0&&(c.value=e[25][e[145]].value),e[24][e[141]].input!==void 0&&(c.el=e[24][e[141]].input),l=new vs({props:c}),De.push(()=>Qe(l,"value",r)),De.push(()=>Qe(l,"el",u)),{key:t,first:null,c(){n=xt(),Je(l.$$.fragment),this.first=n},m(_,a){Ee(_,n,a),Ve(l,_,a),o=!0},p(_,a){e=_;const f={};a[0]&33554432&&(f.i=e[145]),a[1]&4194304&&(f.actual_pinned_columns=e[53]),a[1]&2097152&&(f.header_edit=e[52]),a[1]&1048576&&(f.selected_header=e[51]),a[0]&1&&(f.headers=e[0]),a[1]&4&&(f.sort_columns=e[33].sort_state.sort_columns),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&37748736&&(f.is_static=e[22].includes(e[145])),a[0]&4096&&(f.i18n=e[12]),a[0]&32&&(f.col_count=e[5]),!i&&a[0]&33554432&&(i=!0,f.value=e[25][e[145]].value,Ge(()=>i=!1)),!s&&a[0]&50331648&&(s=!0,f.el=e[24][e[141]].input,Ge(()=>s=!1)),l.$set(f)},i(_){o||(I(l.$$.fragment,_),o=!0)},o(_){X(l.$$.fragment,_),o=!1},d(_){_&&Ae(n),Ke(l,_)}}}function is(t){let e,n;return e=new yn({props:{index:0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}}}function ss(t,e){let n,l,i,s,o=e[143],r;i=new bl({props:{value:e[140],latex_delimiters:e[7],line_breaks:e[14],datatype:Array.isArray(e[2])?e[2][e[143]]:e[2],edit:!1,el:null,root:e[11],editable:e[9],i18n:e[12],show_selection_buttons:e[31].length===1&&e[31][0][0]===0&&e[31][0][1]===e[143],coords:e[39],on_select_column:e[55].handle_select_column,on_select_row:e[55].handle_select_row,is_dragging:e[42]}}),i.$on("blur",e[62]);const u=()=>e[92](n,o),c=()=>e[92](null,o);return{key:t,first:null,c(){n=qe("td"),l=qe("div"),Je(i.$$.fragment),s=Re(),le(l,"class","cell-wrap svelte-1vwr9xf"),le(n,"tabindex","-1"),le(n,"class","svelte-1vwr9xf"),this.first=n},m(_,a){Ee(_,n,a),_e(n,l),Ve(i,l,null),_e(n,s),u(),r=!0},p(_,a){e=_;const f={};a[1]&524288&&(f.value=e[140]),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&4|a[1]&524288&&(f.datatype=Array.isArray(e[2])?e[2][e[143]]:e[2]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&4096&&(f.i18n=e[12]),a[1]&524289&&(f.show_selection_buttons=e[31].length===1&&e[31][0][0]===0&&e[31][0][1]===e[143]),a[1]&256&&(f.coords=e[39]),a[1]&2048&&(f.is_dragging=e[42]),i.$set(f),o!==e[143]&&(c(),o=e[143],u())},i(_){r||(I(i.$$.fragment,_),r=!0)},o(_){X(i.$$.fragment,_),r=!1},d(_){_&&Ae(n),Ke(i),c()}}}function os(t){let e,n;return{c(){e=qe("caption"),n=Ml(t[3]),le(e,"class","sr-only svelte-1vwr9xf")},m(l,i){Ee(l,e,i),_e(e,n)},p(l,i){i[0]&8&&ql(n,l[3])},d(l){l&&Ae(e)}}}function nc(t){let e,n=t[3]&&t[3].length!==0&&os(t);return{c(){n&&n.c(),e=xt()},m(l,i){n&&n.m(l,i),Ee(l,e,i)},p(l,i){l[3]&&l[3].length!==0?n?n.p(l,i):(n=os(l),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(l){l&&Ae(e),n&&n.d(l)}}}function rs(t){let e,n;return e=new yn({props:{is_header:!0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}}}function _s(t,e){let n,l,i,s,o;function r(_){e[97](_,e[145])}function u(_){e[98](_,e[141])}let c={i:e[145],actual_pinned_columns:e[53],header_edit:e[52],selected_header:e[51],headers:e[0],get_cell_width:Al,handle_header_click:e[58],toggle_header_menu:e[63],end_header_edit:e[59],sort_columns:e[33].sort_state.sort_columns,latex_delimiters:e[7],line_breaks:e[14],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[145]),i18n:e[12],col_count:e[5]};return e[25][e[145]].value!==void 0&&(c.value=e[25][e[145]].value),e[24][e[141]].input!==void 0&&(c.el=e[24][e[141]].input),l=new vs({props:c}),De.push(()=>Qe(l,"value",r)),De.push(()=>Qe(l,"el",u)),{key:t,first:null,c(){n=xt(),Je(l.$$.fragment),this.first=n},m(_,a){Ee(_,n,a),Ve(l,_,a),o=!0},p(_,a){e=_;const f={};a[0]&33554432&&(f.i=e[145]),a[1]&4194304&&(f.actual_pinned_columns=e[53]),a[1]&2097152&&(f.header_edit=e[52]),a[1]&1048576&&(f.selected_header=e[51]),a[0]&1&&(f.headers=e[0]),a[1]&4&&(f.sort_columns=e[33].sort_state.sort_columns),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&37748736&&(f.is_static=e[22].includes(e[145])),a[0]&4096&&(f.i18n=e[12]),a[0]&32&&(f.col_
5count=e[5]),!i&&a[0]&33554432&&(i=!0,f.value=e[25][e[145]].value,Ge(()=>i=!1)),!s&&a[0]&50331648&&(s=!0,f.el=e[24][e[141]].input,Ge(()=>s=!1)),l.$set(f)},i(_){o||(I(l.$$.fragment,_),o=!0)},o(_){X(l.$$.fragment,_),o=!1},d(_){_&&Ae(n),Ke(l,_)}}}function lc(t){let e,n,l=[],i=new vn,s,o=t[15]&&rs(),r=vt(t[25]);const u=c=>c[141];for(let c=0;c<r.length;c+=1){let _=Gi(t,r,c),a=u(_);i.set(a,l[c]=_s(a,_))}return{c(){e=qe("tr"),o&&o.c(),n=Re();for(let c=0;c<l.length;c+=1)l[c].c();le(e,"slot","thead"),le(e,"class","svelte-1vwr9xf")},m(c,_){Ee(c,e,_),o&&o.m(e,null),_e(e,n);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);s=!0},p(c,_){c[15]?o?_[0]&32768&&I(o,1):(o=rs(),o.c(),I(o,1),o.m(e,n)):o&&(et(),X(o,1,1,()=>{o=null}),xe()),_[0]&55597729|_[1]&409993220|_[2]&2&&(r=vt(c[25]),et(),l=pn(l,_,u,1,c,r,i,e,kn,_s,null,Gi),xe())},i(c){if(!s){I(o);for(let _=0;_<r.length;_+=1)I(l[_]);s=!0}},o(c){X(o);for(let _=0;_<l.length;_+=1)X(l[_]);s=!1},d(c){c&&Ae(e),o&&o.d();for(let _=0;_<l.length;_+=1)l[_].d()}}}function as(t){let e,n;return e=new yn({props:{index:t[138]}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},p(l,i){const s={};i[4]&16384&&(s.index=l[138]),e.$set(s)},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}}}function us(t,e){let n,l,i,s,o;function r(_){e[95](_,e[138],e[143])}function u(_){e[96](_,e[141])}let c={display_value:e[70](e[138],e[143]),index:e[33].current_search_query!==void 0&&e[27][e[138]]!==void 0?e[27][e[138]]:e[138],j:e[143],actual_pinned_columns:e[53],get_cell_width:Al,handle_cell_click:e[94],handle_blur:e[62],toggle_cell_menu:e[55].toggle_cell_menu,is_cell_selected:Wo,should_show_cell_menu:Go,selected_cells:e[31],copy_flash:e[32],active_cell_menu:e[47],styling:e[35][e[138]][e[143]].styling,latex_delimiters:e[7],line_breaks:e[14],datatype:Array.isArray(e[2])?e[2][e[143]]:e[2],editing:e[48],max_chars:e[20],root:e[11],editable:e[9],is_static:e[22].includes(e[143]),i18n:e[12],components:e[8],handle_select_column:e[55].handle_select_column,handle_select_row:e[55].handle_select_row,is_dragging:e[42],wrap:e[10]};return e[35][e[138]][e[143]].value!==void 0&&(c.value=e[35][e[138]][e[143]].value),e[24][e[141]]!==void 0&&(c.el=e[24][e[141]]),l=new ka({props:c}),De.push(()=>Qe(l,"value",r)),De.push(()=>Qe(l,"el",u)),{key:t,first:null,c(){n=xt(),Je(l.$$.fragment),this.first=n},m(_,a){Ee(_,n,a),Ve(l,_,a),o=!0},p(_,a){e=_;const f={};a[4]&49152&&(f.display_value=e[70](e[138],e[143])),a[0]&134217728|a[1]&4|a[4]&16384&&(f.index=e[33].current_search_query!==void 0&&e[27][e[138]]!==void 0?e[27][e[138]]:e[138]),a[4]&32768&&(f.j=e[143]),a[1]&4194304&&(f.actual_pinned_columns=e[53]),a[1]&16384&&(f.handle_cell_click=e[94]),a[1]&1&&(f.selected_cells=e[31]),a[1]&2&&(f.copy_flash=e[32]),a[1]&65536&&(f.active_cell_menu=e[47]),a[1]&16|a[4]&49152&&(f.styling=e[35][e[138]][e[143]].styling),a[0]&128&&(f.latex_delimiters=e[7]),a[0]&16384&&(f.line_breaks=e[14]),a[0]&4|a[4]&32768&&(f.datatype=Array.isArray(e[2])?e[2][e[143]]:e[2]),a[1]&131072&&(f.editing=e[48]),a[0]&1048576&&(f.max_chars=e[20]),a[0]&2048&&(f.root=e[11]),a[0]&512&&(f.editable=e[9]),a[0]&4194304|a[4]&32768&&(f.is_static=e[22].includes(e[143])),a[0]&4096&&(f.i18n=e[12]),a[0]&256&&(f.components=e[8]),a[1]&2048&&(f.is_dragging=e[42]),a[0]&1024&&(f.wrap=e[10]),!i&&a[1]&16|a[4]&49152&&(i=!0,f.value=e[35][e[138]][e[143]].value,Ge(()=>i=!1)),!s&&a[0]&16777216|a[4]&32768&&(s=!0,f.el=e[24][e[141]],Ge(()=>s=!1)),l.$set(f)},i(_){o||(I(l.$$.fragment,_),o=!0)},o(_){X(l.$$.fragment,_),o=!1},d(_){_&&Ae(n),Ke(l,_)}}}function ic(t){let e,n,l=[],i=new vn,s,o=t[15]&&as(t),r=vt(t[139]);const u=c=>c[141];for(let c=0;c<r.length;c+=1){let _=Qi(t,r,c),a=u(_);i.set(a,l[c]=us(a,_))}return{c(){e=qe("tr"),o&&o.c(),n=Re();for(let c=0;c<l.length;c+=1)l[c].c();le(e,"slot","tbody"),le(e,"class","svelte-1vwr9xf"),pt(e,"row-odd",t[138]%2===0)},m(c,_){Ee(c,e,_),o&&o.m(e,null),_e(e,n);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);s=!0},p(c,_){c[15]?o?(o.p(c,_),_[0]&32768&&I(o,1)):(o=as(c),o.c(),I(o,1),o.m(e,n)):o&&(et(),X(o,1,1,()=>{o=null}),xe()),_[0]&156262276|_[1]&21186583|_[2]&257|_[4]&49152&&(r=vt(c[139]),et(),l=pn(l,_,u,1,c,r,i,e,kn,us,null,Qi),xe()),(!s||_[4]&16384)&&pt(e,"row-odd",c[138]%2===0)},i(c){if(!s){I(o);for(let _=0;_<r.length;_+=1)I(l[_]);s=!0}},o(c){X(o);for(let _=0;_<l.length;_+=1)X(l[_]);s=!1},d(c){c&&Ae(e),o&&o.d();for(let _=0;_<l.length;_+=1)l[_].d()}}}function sc(t){let e,n,l,i,s,o,r,u;function c(C){t[99](C)}function _(C){t[100](C)}function a(C){t[101](C)}function f(C){t[102](C)}function k(C){t[103](C)}let A={max_height:t[13],selected:t[49],disable_scroll:t[47]!==null||t[46]!==null,$$slots:{tbody:[ic,
5({index:C,item:E})=>({138:C,139:E}),({index:C,item:E})=>[0,0,0,0,(C?16384:0)|(E?32768:0)]],thead:[lc],default:[nc]},$$scope:{ctx:t}};return t[35]!==void 0&&(A.items=t[35]),t[37]!==void 0&&(A.actual_height=t[37]),t[38]!==void 0&&(A.table_scrollbar_width=t[38]),t[40]!==void 0&&(A.viewport=t[40]),t[41]!==void 0&&(A.show_scroll_button=t[41]),n=new Za({props:A}),De.push(()=>Qe(n,"items",c)),De.push(()=>Qe(n,"actual_height",_)),De.push(()=>Qe(n,"table_scrollbar_width",a)),De.push(()=>Qe(n,"viewport",f)),De.push(()=>Qe(n,"show_scroll_button",k)),n.$on("scroll_top",rc),{c(){e=qe("div"),Je(n.$$.fragment),le(e,"class","table-wrap svelte-1vwr9xf")},m(C,E){Ee(C,e,E),Ve(n,e,null),u=!0},p(C,E){const m={};E[0]&8192&&(m.max_height=C[13]),E[1]&262144&&(m.selected=C[49]),E[1]&98304&&(m.disable_scroll=C[47]!==null||C[46]!==null),E[0]&189849517|E[1]&7555095|E[4]&16826368&&(m.$$scope={dirty:E,ctx:C}),!l&&E[1]&16&&(l=!0,m.items=C[35],Ge(()=>l=!1)),!i&&E[1]&64&&(i=!0,m.actual_height=C[37],Ge(()=>i=!1)),!s&&E[1]&128&&(s=!0,m.table_scrollbar_width=C[38],Ge(()=>s=!1)),!o&&E[1]&512&&(o=!0,m.viewport=C[40],Ge(()=>o=!1)),!r&&E[1]&1024&&(r=!0,m.show_scroll_button=C[41],Ge(()=>r=!1)),n.$set(m)},i(C){u||(I(n.$$.fragment,C),u=!0)},o(C){X(n.$$.fragment,C),u=!1},d(C){C&&Ae(e),Ke(n)}}}function cs(t){let e,n,l;return{c(){e=qe("button"),e.textContent="â",le(e,"class","scroll-top-button svelte-1vwr9xf")},m(i,s){Ee(i,e,s),n||(l=Bt(e,"click",t[67]),n=!0)},p:zs,d(i){i&&Ae(e),n=!1,l()}}}function fs(t){let e,n;return e=new za({props:{on_click:t[108]}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},p:zs,i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}}}function hs(t){let e,n;return e=new vu({props:{x:t[47]?.x??t[46]?.x??0,y:t[47]?.y??t[46]?.y??0,row:t[46]?-1:t[47]?.row??0,col_count:t[5],row_count:t[6],on_add_row_above:t[109],on_add_row_below:t[110],on_add_column_left:t[111],on_add_column_right:t[112],on_delete_row:t[113],on_delete_col:t[114],editable:t[9],can_delete_rows:!t[46]&&t[26].length>1&&t[9],can_delete_cols:t[26].length>0&&t[26][0]?.length>1&&t[9],i18n:t[12],on_sort:t[46]?t[115]:void 0,on_clear_sort:t[46]?t[116]:void 0,sort_direction:t[46]?t[33].sort_state.sort_columns.find(t[117])?.direction??null:null,sort_priority:t[46]&&t[33].sort_state.sort_columns.findIndex(t[118])+1||null}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),n=!0},p(l,i){const s={};i[1]&98304&&(s.x=l[47]?.x??l[46]?.x??0),i[1]&98304&&(s.y=l[47]?.y??l[46]?.y??0),i[1]&98304&&(s.row=l[46]?-1:l[47]?.row??0),i[0]&32&&(s.col_count=l[5]),i[0]&64&&(s.row_count=l[6]),i[1]&65536&&(s.on_add_row_above=l[109]),i[1]&65536&&(s.on_add_row_below=l[110]),i[1]&98304&&(s.on_add_column_left=l[111]),i[1]&98304&&(s.on_add_column_right=l[112]),i[1]&65536&&(s.on_delete_row=l[113]),i[1]&98304&&(s.on_delete_col=l[114]),i[0]&512&&(s.editable=l[9]),i[0]&67109376|i[1]&32768&&(s.can_delete_rows=!l[46]&&l[26].length>1&&l[9]),i[0]&67109376&&(s.can_delete_cols=l[26].length>0&&l[26][0]?.length>1&&l[9]),i[0]&4096&&(s.i18n=l[12]),i[1]&32768&&(s.on_sort=l[46]?l[115]:void 0),i[1]&32768&&(s.on_clear_sort=l[46]?l[116]:void 0),i[1]&32772&&(s.sort_direction=l[46]?l[33].sort_state.sort_columns.find(l[117])?.direction??null:null),i[1]&32772&&(s.sort_priority=l[46]&&l[33].sort_state.sort_columns.findIndex(l[118])+1||null),e.$set(s)},i(l){n||(I(e.$$.fragment,l),n=!0)},o(l){X(e.$$.fragment,l),n=!1},d(l){Ke(e,l)}}}function oc(t){let e,n,l,i,s,o,r,u,c=[],_=new vn,a,f,k,A,C=[],E=new vn,m,b,w,S,y,j,z,N,D,R,O=(t[3]&&t[3].length!==0&&t[4]||t[18]||t[19]||t[21]!=="none")&&xi(t),F=t[3]&&t[3].length!==0&&ts(t),K=t[15]&&ns(),oe=vt(t[25]);const ae=B=>B[141];for(let B=0;B<oe.length;B+=1){let d=$i(t,oe,B),P=ae(d);_.set(P,c[B]=ls(P,d))}let V=t[15]&&is(),J=vt(t[50]);const p=B=>B[141];for(let B=0;B<J.length;B+=1){let d=Zi(t,J,B),P=p(d);E.set(P,C[B]=ss(P,d))}function ce(B){t[104](B)}let fe={upload:t[16],stream_handler:t[17],flex:!1,center:!1,boundedheight:!1,disable_click:!0,root:t[11],aria_label:t[12]("dataframe.drop_to_upload"),$$slots:{default:[sc]},$$scope:{ctx:t}};t[36]!==void 0&&(fe.dragging=t[36]),b=new Bo({props:fe}),De.push(()=>Qe(b,"dragging",ce)),b.$on("load",t[105]);let W=t[41]&&cs(t),U=t[26].length===0&&t[9]&&t[6][1]==="dynamic"&&fs(t),L=(t[47]||t[46])&&hs(t);return{c(){e=qe("div"),O&&O.c(),n=Re(),l=qe("div"),i=qe("table"),F&&F.c(),s=Re(),o=qe("thead"),r=qe
5("tr"),K&&K.c(),u=Re();for(let B=0;B<c.length;B+=1)c[B].c();a=Re(),f=qe("tbody"),k=qe("tr"),V&&V.c(),A=Re();for(let B=0;B<C.length;B+=1)C[B].c();m=Re(),Je(b.$$.fragment),S=Re(),W&&W.c(),y=Re(),U&&U.c(),j=Re(),L&&L.c(),z=xt(),le(r,"class","svelte-1vwr9xf"),le(o,"class","svelte-1vwr9xf"),le(k,"class","svelte-1vwr9xf"),le(f,"class","svelte-1vwr9xf"),le(i,"aria-hidden","true"),le(i,"class","svelte-1vwr9xf"),le(l,"class","table-wrap svelte-1vwr9xf"),Yi(l,"height",t[37]+"px"),le(l,"role","grid"),le(l,"tabindex","0"),pt(l,"dragging",t[42]),pt(l,"no-wrap",!t[10]),pt(l,"menu-open",t[47]||t[46]),le(e,"class","table-container svelte-1vwr9xf")},m(B,d){Ee(B,e,d),O&&O.m(e,null),_e(e,n),_e(e,l),_e(l,i),F&&F.m(i,null),_e(i,s),_e(i,o),_e(o,r),K&&K.m(r,null),_e(r,u);for(let P=0;P<c.length;P+=1)c[P]&&c[P].m(r,null);_e(i,a),_e(i,f),_e(f,k),V&&V.m(k,null),_e(k,A);for(let P=0;P<C.length;P+=1)C[P]&&C[P].m(k,null);t[93](i),_e(l,m),Ve(b,l,null),_e(l,S),W&&W.m(l,null),t[106](l),Ee(B,y,d),U&&U.m(B,d),Ee(B,j,d),L&&L.m(B,d),Ee(B,z,d),N=!0,D||(R=[Bt($u,"resize",t[86]),Bt(l,"keydown",t[107]),Bt(l,"mousemove",function(){tl(t[44])&&t[44].apply(this,arguments)}),Bt(l,"mouseup",function(){tl(t[43])&&t[43].apply(this,arguments)}),Bt(l,"mouseleave",function(){tl(t[43])&&t[43].apply(this,arguments)})],D=!0)},p(B,d){t=B,t[3]&&t[3].length!==0&&t[4]||t[18]||t[19]||t[21]!=="none"?O?(O.p(t,d),d[0]&2883608&&I(O,1)):(O=xi(t),O.c(),I(O,1),O.m(e,n)):O&&(et(),X(O,1,1,()=>{O=null}),xe()),t[3]&&t[3].length!==0?F?F.p(t,d):(F=ts(t),F.c(),F.m(i,s)):F&&(F.d(1),F=null),t[15]?K?d[0]&32768&&I(K,1):(K=ns(),K.c(),I(K,1),K.m(r,u)):K&&(et(),X(K,1,1,()=>{K=null}
5),xe()),d[0]&55597729|d[1]&409993220|d[2]&2&&(oe=vt(t[25]),et(),c=pn(c,d,ae,1,t,oe,_,r,kn,ls,null,$i),xe()),t[15]?V?d[0]&32768&&I(V,1):(V=is(),V.c(),I(V,1),V.m(k,A)):V&&(et(),X(V,1,1,()=>{V=null}),xe()),d[0]&268458628|d[1]&17303809|d[2]&1&&(J=vt(t[50]),et(),C=pn(C,d,p,1,t,J,E,k,kn,ss,null,Zi),xe());const P={};d[0]&65536&&(P.upload=t[16]),d[0]&131072&&(P.stream_handler=t[17]),d[0]&2048&&(P.root=t[11]),d[0]&4096&&(P.aria_label=t[12]("dataframe.drop_to_upload")),d[0]&189857709|d[1]&7851735|d[4]&16777216&&(P.$$scope={dirty:d,ctx:t}),!w&&d[1]&32&&(w=!0,P.dragging=t[36],Ge(()=>w=!1)),b.$set(P),t[41]?W?W.p(t,d):(W=cs(t),W.c(),W.m(l,null)):W&&(W.d(1),W=null),(!N||d[1]&64)&&Yi(l,"height",t[37]+"px"),(!N||d[1]&2048)&&pt(l,"dragging",t[42]),(!N||d[0]&1024)&&pt(l,"no-wrap",!t[10]),(!N||d[1]&98304)&&pt(l,"menu-open",t[47]||t[46]),t[26].length===0&&t[9]&&t[6][1]==="dynamic"?U?(U.p(t,d),d[0]&67109440&&I(U,1)):(U=fs(t),U.c(),I(U,1),U.m(j.parentNode,j)):U&&(et(),X(U,1,1,()=>{U=null}),xe()),t[47]||t[46]?L?(L.p(t,d),d[1]&98304&&I(L,1)):(L=hs(t),L.c(),I(L,1),L.m(z.parentNode,z)):L&&(et(),X(L,1,1,()=>{L=null}),xe())},i(B){if(!N){I(O),I(K);for(let d=0;d<oe.length;d+=1)I(c[d]);I(V);for(let d=0;d<J.length;d+=1)I(C[d]);I(b.$$.fragment,B),I(U),I(L),N=!0}},o(B){X(O),X(K);for(let d=0;d<c.length;d+=1)X(c[d]);X(V);for(let d=0;d<C.length;d+=1)X(C[d]);X(b.$$.fragment,B),X(U),X(L),N=!1},d(B){B&&(Ae(e),Ae(y),Ae(j),Ae(z)),O&&O.d(),F&&F.d(),K&&K.d();for(let d=0;d<c.length;d+=1)c[d].d();V&&V.d();for(let d=0;d<C.length;d+=1)C[d].d();t[93](null),Ke(b),W&&W.d(),t[106](null),U&&U.d(B),L&&L.d(B),D=!1,Qu(R)}}}function Mt(){return Math.random().toString(36).substring(2,15)}function Al(t){return`var(--cell-width-${t})`}const rc=t=>{};function _c(t,e,n){let l,i,s,o,r,u,c,_,a,f,k,A,C,E,m,{datatype:b}=e,{label:w=null}=e,{show_label:S=!0}=e,{headers:y=[]}=e,{values:j=[]}=e,{col_count:z}=e,{row_count:N}=e,{latex_delimiters:D}=e,{components:R={}}=e,{editable:O=!0}=e,{wrap:F=!1}=e,{root:K}=e,{i18n:oe}=e,{max_height:ae=500}=e,{line_breaks:V=!0}=e,{column_widths:J=[]}=e,{show_row_numbers:p=!1}=e,{upload:ce}=e,{stream_handler:fe}=e,{show_fullscreen_button:W=!1}=e,{show_copy_button:U=!1}=e,{value_is_output:L=!1}=e,{max_chars:B=void 0}=e,{show_search:d="none"}=e,{pinned_columns:P=0}=e,{static_columns:Be=[]}=e,{fullscreen:Ue=!1}=e;const q=lr({show_fullscreen_button:W,show_copy_button:U,show_search:d,show_row_numbers:p,editable:O,pinned_columns:P,show_label:S,line_breaks:V,wrap:F,max_height:ae,column_widths:J,max_chars:B}),{state:ye,actions:v}=q;Yu(t,ye,h=>n(33,m=h)),Xi(()=>{n(34,q.parent_element=te,q),n(34,q.get_data_at=Ns,q),n(34,q.get_column=Hs,q),n(34,q.get_row=Os,q),n(34,q.dispatch=wt,q),Pl();const h=new IntersectionObserver(T=>{T.forEach(x=>{x.isIntersecting&&!Bl&&n(82,Ct=!1),Bl=x.isIntersecting})});h.observe(te),document.addEventListener("click",zl),window.addEventListener("resize",Hl);const M=T=>{(Ft||Vn)&&E(T)};return document.addEventListener("mouseup",M),()=>{h.disconnect(),document.removeEventListener("click",zl),window.removeEventListener("resize",Hl),document.removeEventListener("mouseup",M)}});const wt=ec();let G={},yt={},Ce=cn(y,z,G,Mt),Pt=y,H=[[]],He,We=[[]],jn=!1,El,jt=[];Xi(()=>{El=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()+"40",document.documentElement.style.setProperty("--color-accent-copied",El)});const Ns=(h,M)=>H?.[h]?.[M]?.value,Hs=h=>H?.map(M=>M[h]?.value)??[],Os=h=>H?.[h]?.map(M=>M.value)??[];let{display_value:rt=null}=e,{styling:_t=null}=e,zn=Ce.map(h=>h.value),Bn=H.map(h=>h.map(M=>String(M.value)));function Ll(h,M){v.handle_sort(h,M),Rn(H,rt,_t)}function jl(){v.reset_sort_state()}async function Ps(h,M=!1){!O||o===h||z[1]!=="dynamic"||v.set_header_edit(h)}function Rs(h,M){h.target instanceof HTMLAnchorElement||(h.preventDefault(),h.stopPropagation(),O&&(v.set_editing(!1),v.handle_header_click(M,O),te.focus()))}function Fs(h){O&&(v.end_header_edit(h.detail.key),te.focus())}async function Dn(h){if(te.focus(),N[1]!=="dynamic")return;const M=Array(H[0]?.length||y.length).fill(0).map((T,x)=>{const ne=Mt();return n(24,G[ne]={cell:null,input:null},G),{id:ne,value:""}});H.length===0?n(26,H=[M]):h!==void 0&&h>=0&&h<=H.length?H.splice(h,0,M):H.push(M),n(85,i=[h!==void 0?h:H.length-1,0])}async function Is(h){if(te.focus(),z[1]!=="dynamic")return;const M=v.add_col(H,y,Mt,h);M.data.forEach(T=>{T.forEach(x=>{G[x.id]||n(24,G[x.id]={cell:null,input:null},G)})}),n(26,H=M.data),n(0,y=M.headers),await tc(),requestAnimationFrame(()=>{Ps(h!==void 0?h:H[0].length-1,!0);const T=te.querySelectorAll("tbody")[1].offsetWidth;te.querySelectorAll("table")[1].scrollTo({left:T})})}function zl(h){xo(h,te)&&(v.clear_ui_state(),n(52,o=!1),n(51,r=!1))}let Tn,Ct=!1,lt=[],te,en,Nn=0,Hn=0;function Rt(){const h=H[0]?.length||0;if(Nn===H.length&&Hn===h&&m.sort_state.sort_columns.length>0)return;Nn=H.length,Hn=h;const M=lt.map(T=>T?.clientWidth||0);if(M.length!==0){p&&te.style.setProperty("--cell-width-row-number",`${M[0]}px`);for(let T=0;T<50;T++)if(!J[T])te.style.removeProperty(`--cell-width-${T}`);else if(J[T].endsWith("%")){const x=parseFloat(J[T]),ne=Math.floor(x/100*te.clientWidth);te.style.setProperty(`--cell-width-${T}`,`${ne}px`)}else te.style.setProperty(`--cell-width-${T}`,J[T]);M.forEach((T,x)=>{if(!J[x]){const ne=`${Math.max(T,45)}px`;te.style.setProperty(`--cell-width-${x}`,ne)}})}}let On=j.slice(0,ae/j.length*37).length*37+37,Pn=0;function Rn(h,M,T){const x=Fo(h,M,T,m.sort_state.sort_columns,i,$o);n(26,H=x.data),n(85,i=x.selected)}let Bl=!1;const Js=h=>{v.set_copy_flash(h)};let Fn=[];function Ks(h){const{blur_event:M,coords:T}=h.detail;Hu(M,q,T)}
5function Vs(h,M){if(h.stopPropagation(),c&&c.col===M)v.set_active_header_menu(null);else{const T=h.target.closest("th");if(T){const x=T.getBoundingClientRect();v.set_active_header_menu({col:M,x:x.right,y:x.bottom})}}}xu(()=>{n(71,L=!1)});function Dl(h){if(z[1]!=="dynamic"||H[0].length<=1)return;const M=v.delete_col_at(H,y,h);n(26,H=M.data),n(0,y=M.headers),n(25,Ce=cn(y,z,G,Mt)),v.set_active_cell_menu(null),v.set_active_header_menu(null),v.set_selected(!1),v.set_selected_cells([]),v.set_editing(!1)}function Tl(h){n(26,H=v.delete_row_at(H,h)),v.set_active_cell_menu(null),v.set_active_header_menu(null)}let Nl;function Us(){if(m.current_search_query&&d==="filter"){const h=[],M=[],T=[];We.forEach(ne=>{const ln=[],Rl=[],Fl=[];ne.forEach(Jt=>{ln.push(Jt.value),Rl.push(Jt.display_value!==void 0?Jt.display_value:String(Jt.value)),Fl.push(Jt.styling||"")}),h.push(ln),M.push(Rl),T.push(Fl)});const x={data:h,headers:Ce.map(ne=>ne.value),metadata:{display_value:M,styling:T}};wt("change",x),L||wt("input"),v.handle_search(null)}}let tn,In=!1;function Ws(){tn.scrollTo({top:0})}function Hl(){v.set_active_cell_menu(null),v.set_active_header_menu(null),n(31,l=[]),n(85,i=!1),n(48,s=!1),n(82,Ct=!1),Rt()}function Jn(h,M){const T=M==="above"?h:h+1;Dn(T),n(47,u=null),n(46,c=null)}function Kn(h,M){const T=M==="left"?h:h+1;Is(T),n(47,u=null),n(46,c=null)}function Ys(){v.reset_sort_state()}let Ft=!1,Vn=null,Ol=null;const nn={is_dragging:Ft,drag_start:Vn,mouse_down_pos:Ol};let It;function Pl(){n(84,It=Vu(nn,h=>n(42,Ft=h),h=>v.set_selected_cells(h),h=>v.set_selected(h),(h,M,T)=>v.handle_cell_click(h,M,T),p,te))}function Xs(h,M){return m.current_search_query!==void 0&&We?.[h]?.[M]?We[h][M].display_value!==void 0?We[h][M].display_value:String(We[h][M].value):H?.[h]?.[M]?H[h][M].display_value!==void 0?H[h][M].display_value:String(H[h][M].value):""}const Gs=()=>Rt(),Qs=async()=>await gs(H,null),Zs=h=>v.handle_search(h.detail);function $s(h){Wu.call(this,t,h)}function xs(h,M){t.$$.not_equal(Ce[M].value,h)&&(Ce[M].value=h,n(25,Ce),n(0,y),n(77,Pt),n(5,z),n(24,G))}function eo(h,M){t.$$.not_equal(G[M].input,h)&&(G[M].input=h,n(24,G))}function to(h,M){De[h?"unshift":"push"](()=>{lt[M]=h,n(28,lt)})}function no(h){De[h?"unshift":"push"](()=>{en=h,n(30,en)})}const lo=(h,M,T)=>A(h,M,T);function io(h,M,T){t.$$.not_equal(We[M][T].value,h)&&(We[M][T].value=h,n(35,We),n(33,m),n(26,H),n(27,jt),n(75,_t),n(1,j),n(78,He),n(29,te),n(24,G),n(126,yt),n(74,rt),n(28,lt))}function so(h,M){t.$$.not_equal(G[M],h)&&(G[M]=h,n(24,G))}function oo(h,M){t.$$.not_equal(Ce[M].value,h)&&(Ce[M].value=h,n(25,Ce),n(0,y),n(77,Pt),n(5,z),n(24,G))}function ro(h,M){t.$$.not_equal(G[M].input,h)&&(G[M].input=h,n(24,G))}function _o(h){We=h,n(35,We),n(33,m),n(26,H),n(27,jt),n(75,_t),n(1,j),n(78,He),n(29,te),n(24,G),n(126,yt),n(74,rt),n(28,lt)}function ao(h){On=h,n(37,On)}function uo(h){Pn=h,n(38,Pn)}function co(h){tn=h,n(40,tn)}function fo(h){In=h,n(41,In)}function ho(h){jn=h,n(36,jn)}const mo=({detail:h})=>Vo(h.data,M=>(n(25,Ce=cn(M.map(T=>T??""),z,G,Mt)),Ce),M=>{n(1,j=M)});function go(h){De[h?"unshift":"push"](()=>{te=h,n(29,te)})}const bo=h=>Ku(h,q),wo=()=>Dn(),ko=()=>Jn(u?.row??-1,"above"),po=()=>Jn(u?.row??-1,"below"),vo=()=>Kn(u?.col??c?.col??-1,"left"),yo=()=>Kn(u?.col??c?.col??-1,"right"),Co=()=>Tl(u?.row??-1),So=()=>Dl(u?.col??c?.col??-1),qo=h=>{c&&(Ll(c.col,h),v.set_active_header_menu(null))},Mo=()=>{jl(),v.set_active_header_menu(null)},Ao=h=>h.col===(c?.col??-1),Eo=h=>h.col===(c?.col??-1);return t.$$set=h=>{"datatype"in h&&n(2,b=h.datatype),"label"in h&&n(3,w=h.label),"show_label"in h&&n(4,S=h.show_label),"headers"in h&&n(0,y=h.headers),"values"in h&&n(1,j=h.values),"col_count"in h&&n(5,z=h.col_count),"row_count"in h&&n(6,N=h.row_count),"latex_delimiters"in h&&n(7,D=h.latex_delimiters),"components"in h&&n(8,R=h.components),"editable"in h&&n(9,O=h.editable),"wrap"in h&&n(10,F=h.wrap),"root"in h&&n(11,K=h.root),"i18n"in h&&n(12,oe=h.i18n),"max_height"in h&&n(13,ae=h.max_height),"line_breaks"in h&&n(14,V=h.line_breaks),"column_widths"in h&&n(72,J=h.column_widths),"show_row_numbers"in h&&n(15,p=h.show_row_numbers),"upload"in h&&n(16,ce=h.upload),"stream_handler"in h&&n(17,fe=h.stream_handler),"show_fullscreen_button"in h&&n(18,W=h.show_fullscreen_button),"show_copy_button"in h&&n(19,U=h.show_copy_button),"value_is_output"in h&&n(71,L=h.value_is_output),"max_chars"in h&&n(20,B=h.max_chars),"show_search"in h&&n(21,d=h.show_search),"pinned_columns"in h&&n(73,P=h.pinned_columns),"static_columns"in h&&n(22,Be=h.static_columns),"fullscreen"in h&&n(23,Ue=h.fullscreen),"display_value"in h&&n(74,rt=h.display_value),"styling"in h&&n(75,_t=h.styling)},t.$$.update=()=>{if(t.$$.dirty[1]&4&&n(31,l=m.ui_state.selected_cells),t.$$.dirty[1]&4&&n(85,i=m.ui_state.selected),t.$$.dirty[1]&4&&n(48,s=m.ui_state.editing),t.$$.dirty[1]&4&&n(52,o=m.ui_state.header_edit),t.$$.dirty[1]&4&&n(51,r=m.ui_state.selected_header),t.$$.dirty[1]&4&&n(47,u=m.ui_state.active_cell_menu),t.$$.dirty[1]&4&&n(46,c=m.ui_state.active_header_menu),t.$$.dirty[1]&4&&n(32,_=m.ui_state.copy_flash),t.$$.dirty[0]&889192450|t.$$.dirty[1]&4|t.$$.dirty[2]&77824&&!Vt(j,He)){if(te){const T=j.length===0||j.length===1&&j[0].length===0,x=He!==void 0&&(j.length!==He.length||j[0]&&He[0]&&j[0].length!==He[0].length);if(T||x){for(let ne=0;ne<50;ne++)te.style.removeProperty(`--cell-width-${ne}`);Nn=0,Hn=0,n(82,Ct=!1)}}const h=j.length===0||j.length===1&&j[0].length===0,M=He!==void 0&&(j.length!==He.length||j[0]&&He[0]&&j[0].length!==He[0].length);n(26,H=Tu(j,G,yt,Mt,rt)),n(78,He=JSON.parse(JSON.stringify(j))),h||M?v.reset_sort_state():m.sort_state.sort_columns.length>0?Rn(H,rt,_t):(v.handle_sort(-1,"asc"),v.reset_sort_state()),m.current_search_query&&v.handle_search(null),te&<.length>0&&(h||M)&&n(82,Ct=!1)}if(t.$$.dirty[0]&67108864|t.$$.dirty[2]&2048&&n(53,a=P&&H?.[0]?.length?Math.min(P,H[0].length):0),t.$$.dirty[0]&16777249|t.$$.dirty[2]&32768&&(Vt(y,Pt)||(n(25,Ce=cn(y,z,G,Mt)),n(77,Pt=J
5SON.parse(JSON.stringify(y))))),t.$$.dirty[0]&117440512|t.$$.dirty[2]&12288&&(H||Ce||G)&&(n(34,q.data=H,q),n(34,q.headers=Ce,q),n(34,q.els=G,q),n(34,q.display_value=rt,q),n(34,q.styling=_t,q)),t.$$.dirty[0]&201326592|t.$$.dirty[1]&4|t.$$.dirty[2]&8192)if(m.current_search_query!==void 0){const h=new Map;n(27,jt=[]),H.forEach((T,x)=>{T.some(ne=>String(ne?.value).toLowerCase().includes(m.current_search_query?.toLowerCase()||""))&&jt.push(x),T.forEach((ne,ln)=>{h.set(ne.id,{value:ne.value,display_value:ne.display_value!==void 0?ne.display_value:String(ne.value),styling:_t?.[x]?.[ln]||""})})});const M=v.filter_data(H);n(35,We=M.map(T=>T.map(x=>{const ne=h.get(x.id);return{...x,display_value:ne?.display_value!==void 0?ne.display_value:String(x.value),styling:ne?.styling||""}})))}else n(27,jt=[]);if(t.$$.dirty[0]&100663296|t.$$.dirty[2]&393728&&(H||Ce)&&(v.trigger_change(H,Ce,Bn,zn,L,wt),n(80,Bn=H.map(h=>h.map(M=>String(M.value)))),n(79,zn=Ce.map(h=>h.value))),t.$$.dirty[0]&67108864|t.$$.dirty[1]&4|t.$$.dirty[2]&12288&&m.sort_state.sort_columns.length>0&&(Rn(H,rt,_t),v.update_row_order(H)),t.$$.dirty[0]&67108864&&n(50,f=I
5o(H)),t.$$.dirty[0]&268435456|t.$$.dirty[2]&524288&<[0]&<[0]?.clientWidth&&(clearTimeout(Tn),n(81,Tn=setTimeout(()=>Rt(),100))),t.$$.dirty[0]&268435456|t.$$.dirty[2]&1048576&<[0]&&!Ct&&(Rt(),n(82,Ct=!0)),t.$$.dirty[2]&8388608&&n(49,k=!!i&&i[0]),t.$$.dirty[1]&3|t.$$.dirty[2]&2097152&&(_&&!Vt(l,Fn)&&Js(!1),n(83,Fn=l)),t.$$.dirty[2]&8388608&&i!==!1&&n(39,Nl=i),t.$$.dirty[0]&1694498816|t.$$.dirty[2]&8388608&&i!==!1){const h=er(i,H,G,te,en);document.documentElement.style.setProperty("--selected-col-pos",h.col_pos),document.documentElement.style.setProperty("--selected-row-pos",h.row_pos||"0px")}t.$$.dirty[0]&536870912&&te&&Pl(),t.$$.dirty[2]&4194304&&n(45,A=It?.handle_mouse_down||(()=>{})),t.$$.dirty[2]&4194304&&n(44,C=It?.handle_mouse_move||(()=>{})),t.$$.dirty[2]&4194304&&n(43,E=It?.handle_mouse_up||(()=>{}))},n(42,Ft=nn.is_dragging),Vn=nn.drag_start,Ol=nn.mouse_down_pos,[y,j,b,w,S,z,N,D,R,O,F,K,oe,ae,V,p,ce,fe,W,U,B,d,Be,Ue,G,Ce,H,jt,lt,te,en,l,_,m,q,We,jn,On,Pn,Nl,tn,In,Ft,E,C,A,c,u,s,k,f,r,o,a,ye,v,Ll,jl,Rs,Fs,Dn,Rt,Ks,Vs,Dl,Tl,Us,Ws,Jn,Kn,Xs,L,J,P,rt,_t,Ys,Pt,He,zn,Bn,Tn,Ct,Fn,It,i,Gs,Qs,Zs,$s,xs,eo,to,no,lo,io,so,oo,ro,_o,ao,uo,co,fo,ho,mo,go,bo,wo,ko,po,vo,yo,Co,So,qo,Mo,Ao,Eo]}class ac extends Uu{constructor(e){super(),Gu(this,e,_c,oc,Zu,{datatype:2,label:3,show_label:4,headers:0,values:1,col_count:5,row_count:6,latex_delimiters:7,components:8,editable:9,wrap:10,root:11,i18n:12,max_height:13,line_breaks:14,column_widths:72,show_row_numbers:15,upload:16,stream_handler:17,show_fullscreen_button:18,show_copy_button:19,value_is_output:71,max_chars:20,show_search:21,pinned_columns:73,static_columns:22,fullscreen:23,display_value:74,styling:75,reset_sort_state:76},null,[-1,-1,-1,-1,-1])}get datatype(){return this.$$.ctx[2]}set datatype(e){this.$$set({datatype:e}),$()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),$()}get show_label(){return this.$$.ctx[4]}set show_label(e){this.$$set({show_label:e}),$()}get headers(){return this.$$.ctx[0]}set headers(e){this.$$set({headers:e}),$()}get values(){return this.$$.ctx[1]}set values(e){this.$$set({values:e}),$()}get col_count(){return this.$$.ctx[5]}set col_count(e){this.$$set({col_count:e}),$()}get row_count(){return this.$$.ctx[6]}set row_count(e){this.$$set({row_count:e}),$()}get latex_delimiters(){return this.$$.ctx[7]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),$()}get components(){return this.$$.ctx[8]}set components(e){this.$$set({components:e}),$()}get editable(){return this.$$.ctx[9]}set editable(e){this.$$set({editable:e}),$()}get wrap(){return this.$$.ctx[10]}set wrap(e){this.$$set({wrap:e}),$()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),$()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),$()}get max_height(){return this.$$.ctx[13]}set max_height(e){this.$$set({max_height:e}),$()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),$()}get column_widths(){return this.$$.ctx[72]}set column_widths(e){this.$$set({column_widths:e}),$()}get show_row_numbers(){return this.$$.ctx[15]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),$()}get upload(){return this.$$.ctx[16]}set upload(e){this.$$set({upload:e}),$()}get stream_handler(){return this.$$.ctx[17]}set stream_handler(e){this.$$set({stream_handler:e}),$()}get show_fullscreen_button(){return this.$$.ctx[18]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),$()}get show_copy_button(){return this.$$.ctx[19]}set show_copy_button(e){this.$$set({show_copy_button:e}),$()}get value_is_output(){return this.$$.ctx[71]}set value_is_output(e){this.$$set({value_is_output:e}),$()}get max_chars(){return this.$$.ctx[20]}set max_chars(e){this.$$set({max_chars:e}),$()}get show_search(){return this.$$.ctx[21]}set show_search(e){this.$$set({show_search:e}),$()}get pinned_columns(){return this.$$.ctx[73]}set pinned_columns(e){this.$$set({pinned_columns:e}),$()}get static_columns(){return this.$$.ctx[22]}set static_columns(e){this.$$set({static_columns:e}),$()}get fullscreen(){return this.$$.ctx[23]}set fullscreen(e){this.$$set({fullscreen:e}),$()}get display_value(){return this.$$.ctx[74]}set display_value(e){this.$$set({display_value:e}),$()}get styling(){return this.$$.ctx[75]}set styling(e){this.$$set({styling:e}),$()}get reset_sort_state(){return this.$$.ctx[76]}}const uc=ac,{SvelteComponent:cc,add_flush_callback:Bs,assign:fc,bind:Ds,binding_callbacks:Ts,create_component:ul,destroy_component:cl,detach:hc,flush:Z,get_spread_object:dc,get_spread_update:mc,init:gc,insert:bc,mount_component:fl,safe_not_equal:wc,space:kc,transition_in:hl,transition_out:dl}=window.__gradio__svelte__internal;function pc(t){let e,n,l,i,s;const o=[{autoscroll:t[17].autoscroll},{i18n:t[17].i18n},t[20]];let r={};for(let _=0;_<o.length;_+=1)r=fc(r,o[_]);e=new Oo({props:r}),e.$on("clear_status",t[33]);function u(_){t[36](_)}let c={root:t[14],label:t[8],show_label:t[9],row_count:t[7],col_count:t[6],values:t[0].data,display_value:t[30],styling:t[29],headers:t[31],fullscreen:t[2],wrap:t[10],datatype:t[11],latex_delimiters:t[18],editable:t[21],max_height:t[19],i18n:t[17].i18n,line_breaks:t[15],column_widths:t[16],upload:t[34],stream_handler:t[35],show_fullscreen_button:t[22],max_chars:t[23],show_copy_button:t[24],show_row_numbers:t[25],show_search:t[26],pinned_columns:t[27],components:{image:Po},static_columns:t[28]};return t[1]!==void 0&&(c.value_is_output=t[1]),l=new uc({props:c}),Ts.push(()=>Ds(l,"value_is_output",u)),l.$on("change",t[37]),l.$on("input",t[38]),l.$on("select",t[39]),l.$on("fullscreen",t[40]),{c(){ul(e.$$.fragment),n=kc(),ul(l.$$.fragment)}
5,m(_,a){fl(e,_,a),bc(_,n,a),fl(l,_,a),s=!0},p(_,a){const f=a[0]&1179648?mc(o,[a[0]&131072&&{autoscroll:_[17].autoscroll},a[0]&131072&&{i18n:_[17].i18n},a[0]&1048576&&dc(_[20])]):{};e.$set(f);const k={};a[0]&16384&&(k.root=_[14]),a[0]&256&&(k.label=_[8]),a[0]&512&&(k.show_label=_[9]),a[0]&128&&(k.row_count=_[7]),a[0]&64&&(k.col_count=_[6]),a[0]&1&&(k.values=_[0].data),a[0]&1073741824&&(k.display_value=_[30]),a[0]&536870912&&(k.styling=_[29]),a[1]&1&&(k.headers=_[31]),a[0]&4&&(k.fullscreen=_[2]),a[0]&1024&&(k.wrap=_[10]),a[0]&2048&&(k.datatype=_[11]),a[0]&262144&&(k.latex_delimiters=_[18]),a[0]&2097152&&(k.editable=_[21]),a[0]&524288&&(k.max_height=_[19]),a[0]&131072&&(k.i18n=_[17].i18n),a[0]&32768&&(k.line_breaks=_[15]),a[0]&65536&&(k.column_widths=_[16]),a[0]&131072&&(k.upload=_[34]),a[0]&131072&&(k.stream_handler=_[35]),a[0]&4194304&&(k.show_fullscreen_button=_[22]),a[0]&8388608&&(k.max_chars=_[23]),a[0]&16777216&&(k.show_copy_button=_[24]),a[0]&33554432&&(k.show_row_numbers=_[25]),a[0]&67108864&&(k.show_search=_[26]),a[0]&134217728&&(k.pinned_columns=_[27]),a[0]&268435456&&(k.static_columns=_[28]),!i&&a[0]&2&&(i=!0,k.value_is_output=_[1],Bs(()=>i=!1)),l.$set(k)},i(_){s||(hl(e.$$.fragment,_),hl(l.$$.fragment,_),s=!0)},o(_){dl(e.$$.fragment,_),dl(l.$$.fragment,_),s=!1},d(_){_&&hc(n),cl(e,_),cl(l,_)}}}function vc(t){let e,n,l;function i(o){t[41](o)}let s={visible:t[5],padding:!1,elem_id:t[3],elem_classes:t[4],container:!1,scale:t[12],min_width:t[13],overflow_behavior:"visible",$$slots:{default:[pc]},$$scope:{ctx:t}};return t[2]!==void 0&&(s.fullscreen=t[2]),e=new Lo({props:s}),Ts.push(()=>Ds(e,"fullscreen",i)),{c(){ul(e.$$.fragment)},m(o,r){fl(e,o,r),l=!0},p(o,r){const u={};r[0]&32&&(u.visible=o[5]),r[0]&8&&(u.elem_id=o[3]),r[0]&16&&(u.elem_classes=o[4]),r[0]&4096&&(u.scale=o[12]),r[0]&8192&&(u.min_width=o[13]),r[0]&2147471303|r[1]&2049&&(u.$$scope={dirty:r,ctx:o}),!n&&r[0]&4&&(n=!0,u.fullscreen=o[2],Bs(()=>n=!1)),e.$set(u)},i(o){l||(hl(e.$$.fragment,o),l=!0)},o(o){dl(e.$$.fragment,o),l=!1},d(o){cl(e,o)}}}function yc(t,e,n){let l,i,s,{headers:o=[]}=e,{elem_id:r=""}=e,{elem_classes:u=[]}=e,{visible:c=!0}=e,{value:_={data:[["","",""]],headers:["1","2","3"],metadata:null}}=e,{value_is_output:a=!1}=e,{col_count:f}=e,{row_count:k}=e,{label:A=null}=e,{show_label:C=!0}=e,{wrap:E}=e,{datatype:m}=e,{scale:b=null}=e,{min_width:w=void 0}=e,{root:S}=e,{line_breaks:y=!0}=e,{column_widths:j=[]}=e,{gradio:z}=e,{latex_delimiters:N}=e,{max_height:D=void 0}=e,{loading_status:R}=e,{interactive:O}=e,{show_fullscreen_button:F=!1}=e,{max_chars:K=void 0}=e,{show_copy_button:oe=!1}=e,{show_row_numbers:ae=!1}=e,{show_search:V="none"}=e,{pinned_columns:J=0}=e,{static_columns:p=[]}=e,{fullscreen:ce=!1}=e;const fe=()=>z.dispatch("clear_status",R),W=(...q)=>z.client.upload(...q),U=(...q)=>z.client.stream(...q);function L(q){a=q,n(1,a)}const B=q=>{n(0,_.data=q.detail.data,_),n(0,_.headers=q.detail.headers,_),z.dispatch("change")},d=q=>z.dispatch("input"),P=q=>z.dispatch("select",q.detail),Be=({detail:q})=>{n(2,ce=q)};function Ue(q){ce=q,n(2,ce)}return t.$$set=q=>{"headers"in q&&n(32,o=q.headers),"elem_id"in q&&n(3,r=q.elem_id),"elem_classes"in q&&n(4,u=q.elem_classes),"visible"in q&&n(5,c=q.visible),"value"in q&&n(0,_=q.value),"value_is_output"in q&&n(1,a=q.value_is_output),"col_count"in q&&n(6,f=q.col_count),"row_count"in q&&n(7,k=q.row_count),"label"in q&&n(8,A=q.label),"show_label"in q&&n(9,C=q.show_label),"wrap"in q&&n(10,E=q.wrap),"datatype"in q&&n(11,m=q.datatype),"scale"in q&&n(12,b=q.scale),"min_width"in q&&n(13,w=q.min_width),"root"in q&&n(14,S=q.root),"line_breaks"in q&&n(15,y=q.line_breaks),"column_widths"in q&&n(16,j=q.column_widths),"gradio"in q&&n(17,z=q.gradio),"latex_delimiters"in q&&n(18,N=q.latex_delimiters),"max_height"in q&&n(19,D=q.max_height),"loading_status"in q&&n(20,R=q.loading_status),"interactive"in q&&n(21,O=q.interactive),"show_fullscreen_button"in q&&n(22,F=q.show_fullscreen_button),"max_chars"in q&&n(23,K=q.max_chars),"show_copy_button"in q&&n(24,oe=q.show_copy_button),"show_row_numbers"in q&&n(25,ae=q.show_row_numbers),"show_search"in q&&n(26,V=q.show_search),"pinned_columns"in q&&n(27,J=q.pinned_columns),"static_columns"in q&&n(28,p=q.static_columns),"fullscreen"in q&&n(2,ce=q.fullscreen)},t.$$.update=()=>{t.$$.dirty[0]&1|t.$$.dirty[1]&2&&n(31,l=[..._.headers||o]),t.$$.dirty[0]&1&&n(30,i=_?.metadata?.display_value?[..._?.metadata?.display_value]:null),t.$$.dirty[0]&2097153&&n(29,s=!O&&_?.metadata?.styling?[..._?.metadata?.styling]:null)},[_,a,ce,r,u,c,f,k,A,C,E,m,b,w,S,y,j,z,N,D,R,O,F,K,oe,ae,V,J,p,s,i,l,o,fe,W,U,L,B,d,P,Be,Ue]}class gf extends cc{constructor(e){super(),gc(this,e,yc,vc,wc,{headers:32,elem_id:3,elem_classes:4,visible:5,value:0,value_is_output:1,col_count:6,row_count:7,label:8,show_label:9,wrap:10,datatype:11,scale:12,min_width:13,root:14,line_breaks:15,column_widths:16,gradio:17,latex_delimiters:18,max_height:19,loading_status:20,interactive:21,show_fullscreen_button:22,max_chars:23,show_copy_button:24,show_row_numbers:25,show_search:26,pinned_columns:27,static_columns:28,fullscreen:2},null,[-1,-1])}get headers(){return this.$$.ctx[32]}set headers(e){this.$$set({headers:e}),Z()}get elem_id(){return this.$$.ctx[3]}set elem_id(e){this.$$set({elem_id:e}),Z()}get elem_classes(){return this.$$.ctx[4]}set elem_classes(e){this.$$set({elem_classes:e}),Z()}get visible(){return this.$$.ctx[5]}set visible(e){this.$$set({visible:e}),Z()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),Z()}get value_is_output(){return this.$$.ctx[1]}set value_is_output(e){this.$$set({value_is_output:e}),Z()}get col_count(){return this.$$.ctx[6]}set col_count(e){this.$$set({col_count:e}),Z()}get row_count(){return this.$$.ctx[7]}set row_count(e){this.$$set({row_count:e}),Z()}get label(){return this.$$.ctx[8]}set label(e){this.$$set({label:e}),Z()}get show_label(){return this.$$.ctx[9]}set show_label(e){this.$$set({show_label:e}),Z()}get wrap(){return this.$$.ctx[10]}set wrap(e){this.$$set({wrap:e}),Z()}get datatype(){return this.$$.ctx[11]}set datatype(e){this.$$set({datatype:e}),Z()}get scale(){return this.$$.ctx[12]}set scale(e){this.$$set({scale:e}),Z()}get min_width(){return this.$$.ctx[13]}set min_width(e){this.$$set({min_width:e}),Z()}get root(){return this.$$.ctx[14]}set root(e){this.$$set({root:e}),Z()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),Z()}get column_widths(){return this.$$.ctx[16]}set column_widths(e){this.$$set({column_widths:e}),Z()}get gradio(){return this.$$.ctx[17]}set gradio(e){this.$$set({gradio:e}),Z()}get latex_delimiters(){return this.$$.ctx[18]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),Z()}get max_height(){return this.$$.ctx[19]}set max_height(e){this.$$set({max_height:e}),Z()}get loading_status(){return this.$$.ctx[20]}set loading_status(e){this.$$set({loading_status:e}),Z()}get interactive(){return this.$$.ctx[21]}set interactive(e){this.$$set({interactive:e}),Z()}get show_fullscreen_button(){return this.$$.ctx[22]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),Z()}get max_chars(){return this.$$.ctx[23]}set max_chars(e){this.$$set({max_chars:e}),Z()}get show_copy_button(){return this.$$.ctx[24]}set show_copy_button(e){this.$$set({show_copy_button:e}),Z()}get show_row_numbers(){return this.$$.ctx[25]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),Z()}get show_search(){return this.$$.ctx[26]}set show_search(e){this.$$set({show_search:e}),Z()}get pinned_columns(){return this.$$.ctx[27]}set pinned_columns(e){this.$$set({pinned_columns:e}),Z()}get static_columns(){return this.$$.ctx[28]}set static_columns(e){this.$$set({static_columns:e}),Z()}get fullscreen(){return this.$$.ctx[2]}set fullscreen(e){this.$$set({fullscreen:e}),Z()}}export{uc as BaseDataFrame,kf as BaseExample,gf as default};
6//# sourceMappingURL=Index-Dt383qXe.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.