PageSourceSearch

https://mohammedaly22-metro-asr.hf.space/assets/Index-xVIt7Xy1.js

js mohammedaly22-metro-asr.hf.space collected 2026-10-03 17:08:18 UTC 129,095 bytes, 6 lines download raw bytes

vendor: 4,779 bytes, lines 1-4
1import{B as Lo}from"./Block-CJdXVpa7.js";import"./MarkdownCode.svelte_svelte_type_style_lang-DwuBo7pZ.js";/* empty css                                                        */import{x as Me,w as jo}from"./index-Co_Q4qaw.js";import{d as Un}from"./index-tFQomdd2.js";import{d as zo}from"./dsv-DB8NKgIY.js";import{d as Kt}from"./index-CnqicUFC.js";import{a as Bo}from"./Upload-DaUyhzzH.js";import"./DownloadLink.svelte_svelte_type_style_lang-C_5UIfol.js";import{M as Do}from"./MarkdownCode-D_G1OEp4.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-Ax22reAF.js";import{S as Oo}from"./index-CdIv-E5z.js";import Po from"./Index-BJyL3Qby.js";import{default as kf}from"./Example-CqPGqNav.js";import"./prism-python-PMlrFIzj.js";import"./svelte/svelte.js";/* empty css                                             */import"./IconButton-C_HS7fTi.js";import"./Clear-By3xiIwg.js";import"./ImagePreview-CiBci1tw.js";import"./utils-BsGrhMNe.js";import"./BlockLabel-3KxTaaiM.js";import"./Empty-ZqppqzTN.js";import"./ShareButton-Abt--d8M.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-DQ9G2_fC.js";import"./SelectSource-NzBAQDjw.js";import"./DropdownArrow-DYWFcSFn.js";import"./Square-oAGqOwsh.js";import"./index-DTl--HH3.js";import"./StreamingBar-BpqwJkLy.js";import"./UploadText-CB7MgDGs.js";import"./Example-CC8yxxGn.js";/* empty css                                              */function ln(n,e,t){if(!e.length)return"none";const l=e.find(i=>{const s=i.col;return s<0||s>=t.length?!1:t[s]===n});return l?l.direction:"none"}function Ro(n,e){if(!n||!n.length||!n[0])return[];if(e.length>0){const t=[...Array(n.length)].map((l,i)=>i);return t.sort((l,i)=>{const s=n[l],o=n[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}),t}return[...Array(n.length)].map((t,l)=>l)}function Fo(n,e,t,l,i,s){let o=null;i&&i[0]in n&&i[1]in n[i[0]]&&(o=n[i[0]][i[1]].id),ms(n,e,t,l);let r=i;if(o){const[u,c]=s(o,n);r=[u,c]}return{data:n,selected:r}}function Io(n){if(!n||!n.length)return[];let e=n[0].slice();for(let t=0;t<n.length;t++)for(let l=0;l<n[t].length;l++)`${e[l].value}`.length<`${n[t][l].value}`.length&&(e[l]=n[t][l]);return e}function ms(n,e,t,l){if(!l.length||!n||!n.length)return;const i=Ro(n,l),s=i.map(o=>n[o]);if(n.splice(0,n.length,...s),e){const o=i.map(r=>e[r]);e.splice(0,e.length,...o)}if(t){const o=i.map(r=>t[r]);t.splice(0,t.length,...o)}}async function gs(n,e){if(!n||!n.length)return;const l=(e||n.flatMap((r,u)=>r.map((c,_)=>[u,_]))).reduce((r,[u,c])=>{r[u]=r[u]||{};const _=String(n[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(n,e){return e.filter(t);function t(l){var i=-1;return n.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(n){const e=atob(n.split(",")[1]),t=n.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:t})}function Vo(n,e,t){const l=Ko(n),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),t(u)}),i.readAsText(l)}function Uo(n,e){const[t,l]=n;return e.some(([i,s])=>i===t&&s===l)}function Wo(n,e){const[t,l]=n;if(!e.some(([u,c])=>u===t&&c===l))return"";const i=e.some(([u,c])=>u===t-1&&c===l),s=e.some(([u,c])=>u===t+1&&c===l),o=e.some(([u,c])=>u===t&&c===l-1),r=e.some(([u,c])=>u===t&&c===l+1);return`cell-selected${i?" no-top":""}${s?" no-bottom":""}${o?" no-left":""}${r?" no-right":""}`}function ml(n,e){const[t,l]=n,[i,s]=e,o=Math.min(t,i),r=Math.max(t,i),u=Math.min(l,s),c=Math.max(l,s),_=[];_.push(n);for(let a=o;a<=r;a++)for(let f=u;f<=c;f++)a===t&&f===l||_.push([a,f]);return _}function Yo(n,e,t){if(t.shiftKey&&e.length>0)return ml(e[e.length-1],n);
4if(t.metaKey||t.ctrlKey){const l=([s,o])=>s===n[0]&&o===n[1],i=e.findIndex(l);return i===-1?[...e,n]:e.filter((s,o)=>o!==i)}return[n]}function Xo(n,e){const t=n.map(l=>[...l]);return e.forEach(([l,i])=>{t[l]&&t[l][i]&&(t[l][i]={...t[l][i],value:""})}),t}function Go(n,e,t){const[l,i]=n;return t&&e.length===1&&e[0][0]===l&&e[0][1]===i}function Qo(n,e,t){const[l,i]=n,s=t?-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(n,e,t){const l=n.key,i={ArrowRight:[0,1],ArrowLeft:[0,-1],ArrowDown:[1,0],ArrowUp:[-1,0]}[l];let s,o;if(n.metaKey||n.ctrlKey)if(l==="ArrowRight")s=e[0],o=t[0].length-1;else if(l==="ArrowLeft")s=e[0],o=0;else if(l==="ArrowDown")s=t.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:t[s]?.[o]?[s,o]:!1}function $o(n,e){return e.reduce((t,l,i)=>{const s=l.reduce((o,r,u)=>n===r.id?u:o,-1);return s===-1?t:[i,s]},[-1,-1])}function xo(n,e){const[t]=n.composedPath();return!e.contains(t)}function er(n,e,t,l,i){const[s,o]=n;if(!e[s]?.[o])return{col_pos:"0px",row_pos:void 0};const r=e[s][o].id,u=t[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(n,e){const t=s=>n.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=>t(o=>({current_search_query:s})),handle_sort:(s,o)=>t(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(n).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(n);u.length&&ms(s,o,r,u)},update_row_order:s=>t(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(n).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(n).current_search_query)return;const f=o.map(L=>L.value),k=s.map(L=>L.map(v=>String(v.value)));(!Un(k,r)||!Un(f,u))&&(Un(f,u)||t(L=>({sort_state:{sort_columns:[],row_order:[],initial_data:null}})),_("change",{data:s.map(L=>L.map(v=>v.value)),headers:f,metadata:null}),c||_("input"))},reset_sort_state:()=>t(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=>t(o=>({ui_state:{...o.ui_state,active_cell_menu:s}})),set_active_header_menu:s=>t(o=>({ui_state:{...o.ui_state,active_header_menu:s}})),set_selected_cells:s=>t(o=>({ui_state:{...o.ui_state,selected_cells:s}})),set_selected:s=>t(o=>({ui_state:{...o.ui_state,selected:s}})),set_editing:s=>t(o=>({ui_state:{...o.ui_state,editing:s}})),clear_ui_state:()=>t(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=>t(o=>({ui_state:{...o.ui_state,selected_cells:[],selected_header:s,header_edit:s}})),set_selected_header:s=>t(o=>({ui_state:{...o.ui_state,selected_header:s,selected:!1,selected_cells:[]}})),handle_header_click:(s,o)=>t(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)&&t(o=>({ui_state:{...o.ui_state,selected:!1,header_edit:!1}}))},get_selected_cells:()=>Me(n).ui_state.selected_cells,get_active_cell_menu:()=>Me(n).ui_state.active_cell_menu,get_active_button:()=>Me(n).ui_state.active_button,set_active_button:s=>t(o=>({ui_state:{...o.ui_state,active_button:s}})),set_copy_flash:s=>t(o=>({ui_state:{...o.ui_state,copy_flash:s}})),handle_cell_click:(s,o,r)=>{s.preventDefault(),s.stopPropagation();const u=Me(n);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(L=>String(L?.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);t(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?(t(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(n).ui_state.active_cell_menu;if(u?.row===o&&u.col===r)t(c=>({ui_state:{...c.ui_state,active_cell_menu:null}}));else{const c=s.target.closest("td");if(c){const _=c.getBoundingClientRect();t(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(n).ui_state.active_button,u=r?.type==="cell"&&r.row===s&&r.col===o?null:{type:"cell",row:s,col:o};t(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]);t(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]);t(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(n){const e=jo({config:n,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}}),t={state:e,actions:null};t.actions=nr(e,t);const l=Symbol(`dataframe_${Math.random().toString(36).substring(2)}`);return Il(l,t),Il(tr,{instance_id:l,context:t}),t}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(n){let e,t,l,i,s,o,r,u,c;return{c(){e=Kl("button"),t=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",n[3]),Ye(l,"xmlns","http://www.w3.org/2000/svg"),Ye(l,"viewBox","0 0 24 24"),Ye(l,"class","svelte-1mp8yw1"),Ye(t,"class",s=Ul(n[3])+" svelte-1mp8yw1"),Ye(e,"class",o="selection-button selection-button-"+n[0]+" "+(n[2]?`move-${n[3]}`:"")+" svelte-1mp8yw1"),Ye(e,"aria-label",r=`Select ${n[0]}`)},m(_,a){rr(_,e,a),Wn(e,t),Wn(t,l),Wn(l,i),u||(c=_r(e,"click",ur(n[5])),u=!0)},p(_,[a]){a&8&&Ye(i,"data-name",_[3]),a&8&&s!==(s=Ul(_[3])+" svelte-1mp8yw1")&&Ye(t,"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(n,e,t){let l,i,{position:s}=e,{coords:o}=e,{on_click:r=null}=e;const u=()=>r&&r();return n.$$set=c=>{"position"in c&&t(0,s=c.position),"coords"in c&&t(4,o=c.coords),"on_click"in c&&t(1,r=c.on_click)},n.$$.update=()=>{n.$$.dirty&17&&t(2,l=s==="column"?o[0]===0:o[1]===0),n.$$.dirty&5&&t(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(n){let e,t,l,i,s,o;function r(c){n[5](c)}let u={label:"",interactive:n[0]};return n[1]!==void 0&&(u.value=n[1]),t=new To({props:u}),gr.push(()=>mr(t,"value",r)),t.$on("change",n[2]),{c(){e=pr("div"),br(t.$$.fragment),Xn(e,"class","bool-cell checkbox svelte-1s702wr"),Xn(e,"role","button"),Xn(e,"tabindex","-1")},m(c,_){yr(c,e,_),Cr(t,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)),t.$set(a)},i(c){i||(Mr(t.$$.fragment,c),i=!0)},o(c){Ar(t.$$.fragment,c),i=!1},d(c){c&&kr(e),wr(t),s=!1,Sr(o)}}}function Lr(n){n.stopPropagation()}function jr(n){(n.key==="Enter"||n.key===" ")&&n.stopPropagation()}function zr(n,e,t){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,t(1,l),t(3,i)}return n.$$set=c=>{"value"in c&&t(3,i=c.value),"editable"in c&&t(0,s=c.editable),"on_change"in c&&t(4,o=c.on_change)},n.$$.update=()=>{n.$$.dirty&8&&t(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:ke,binding_callbacks:Hr,bubble:sn,check_outros:mn,construct_svelte_component:Gl,create_component:Dt,destroy_component:Tt,detach:ct,element:bs,empty:gl,flush:he,group_outros:gn,init:Or,insert:ft,listen:at,mount_component:Nt,noop:bn,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(n){let e,t,l,i;return{c(){e=bs("input"),e.readOnly=n[9],ke(e,"aria-readonly",n[9]),ke(e,"role","textbox"),ke(e,"aria-label",t=n[9]?"Cell is read-only":"Edit cell"),ke(e,"tabindex","-1"),ke(e,"class","svelte-1y3tas2"),Te(e,"header",n[4])},m(s,o){ft(s,e,o),n[32](e),Ql(e,n[0]),l||(i=[at(e,"input",n[33]),at(e,"blur",n[22]),at(e,"mousedown",Qn(n[29])),at(e,"mouseup",Qn(n[30])),at(e,"click",Qn(n[31])),Nr(Zr.call(null,e)),at(e,"keydown",n[23])],l=!0)},p(s,o){o[0]&512&&(e.readOnly=s[9]),o[0]&512&&ke(e,"aria-readonly",s[9]),o[0]&512&&t!==(t=s[9]?"Cell is read-only":"Edit cell")&&ke(e,"aria-label",t),o[0]&1&&e.value!==s[0]&&Ql(e,s[0]),o[0]&16&&Te(e,"header",s[4])},d(s){s&&ct(e),n[32](null),l=!1,ws(i)}}}function Kr(n){let e,t,l,i,s,o;const r=[Xr,Yr,Wr,Ur],u=[];function c(_,a){return _[5]==="image"&&_[11].image?0:_[5]==="html"?1:_[5]==="markdown"?2:3}return t=c(n),l=u[t]=r[t](n),{c(){e=bs("span"),l.c(),ke(e,"tabindex","0"),ke(e,"role","button"),ke(e,"style",n[3]),
4ke(e,"data-editable",n[8]),ke(e,"data-max-chars",n[10]),ke(e,"data-expanded",n[19]),ke(e,"placeholder"," "),ke(e,"class","svelte-1y3tas2"),Te(e,"dragging",n[13]),Te(e,"edit",n[2]),Te(e,"expanded",n[19]),Te(e,"multiline",n[4]),Te(e,"text",n[5]==="str"),Te(e,"wrap",n[14])},m(_,a){ft(_,e,a),u[t].m(e,null),i=!0,s||(o=[at(e,"click",n[24]),at(e,"keydown",n[23]),at(e,"focus",Pr(n[28]))],s=!0)},p(_,a){let f=t;t=c(_),t===f?u[t].p(_,a):(gn(),Ze(u[f],1,1,()=>{u[f]=null}),mn(),l=u[t],l?l.p(_,a):(l=u[t]=r[t](_),l.c()),Ie(l,1),l.m(e,null)),(!i||a[0]&8)&&ke(e,"style",_[3]),(!i||a[0]&256)&&ke(e,"data-editable",_[8]),(!i||a[0]&1024)&&ke(e,"data-max-chars",_[10]),(!i||a[0]&524288)&&ke(e,"data-expanded",_[19]),(!i||a[0]&8192)&&Te(e,"dragging",_[13]),(!i||a[0]&4)&&Te(e,"edit",_[2]),(!i||a[0]&524288)&&Te(e,"expanded",_[19]),(!i||a[0]&16)&&Te(e,"multiline",_[4]),(!i||a[0]&32)&&Te(e,"text",_[5]==="str"),(!i||a[0]&16384)&&Te(e,"wrap",_[14])},i(_){i||(Ie(l),i=!0)},o(_){Ze(l),i=!1},d(_){_&&ct(e),u[t].d(),s=!1,ws(o)}}}function Vr(n){let e,t;return e=new Br({props:{value:String(n[20]),editable:n[8],on_change:n[25]}}),{c(){Dt(e.$$.fragment)},m(l,i){Nt(e,l,i),t=!0},p(l,i){const s={};i[0]&1048576&&(s.value=String(l[20])),i[0]&256&&(s.editable=l[8]),e.$set(s)},i(l){t||(Ie(e.$$.fragment,l),t=!0)},o(l){Ze(e.$$.fragment,l),t=!1},d(l){Tt(e,l)}}}function Ur(n){let e;return{c(){e=Ir(n[21])},m(t,l){ft(t,e,l)},p(t,l){l[0]&2097152&&Fr(e,t[21])},i:bn,o:bn,d(t){t&&ct(e)}}}function Wr(n){let e,t;return e=new Do({props:{message:n[21].toLocaleString(),latex_delimiters:n[6],line_breaks:n[7],chatbot:!1}}),{c(){Dt(e.$$.fragment)},m(l,i){Nt(e,l,i),t=!0},p(l,i){const s={};i[0]&2097152&&(s.message=l[21].toLocaleString()),i[0]&64&&(s.latex_delimiters=l[6]),i[0]&128&&(s.line_breaks=l[7]),e.$set(s)},i(l){t||(Ie(e.$$.fragment,l),t=!0)},o(l){Ze(e.$$.fragment,l),t=!1},d(l){Tt(e,l)}}}function Yr(n){let e,t;return{c(){e=new Dr(!1),t=gl(),e.a=t},m(l,i){e.m(n[21],l,i),ft(l,t,i)},p(l,i){i[0]&2097152&&e.p(l[21])},i:bn,o:bn,d(l){l&&(ct(t),e.d())}}}function Xr(n){let e,t,l;var i=n[11].image;function s(o,r){return{props:{value:{url:o[21]},show_label:!1,label:"cell-image",show_download_button:!1,i18n:o[12],gradio:{dispatch:$r}}}}return i&&(e=Gl(i,s(n))),{c(){e&&Dt(e.$$.fragment),t=gl()},m(o,r){e&&Nt(e,o,r),ft(o,t,r),l=!0},p(o,r){if(r[0]&2048&&i!==(i=o[11].image)){if(e){gn();const u=e;Ze(u.$$.fragment,1,0,()=>{Tt(u,1)}),mn()}i?(e=Gl(i,s(o)),Dt(e.$$.fragment),Ie(e.$$.fragment,1),Nt(e,t.parentNode,t)):e=null}else if(i){const u={};r[0]&2097152&&(u.value={url:o[21]}),r[0]&4096&&(u.i18n=o[12]),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(t),e&&Tt(e,o)}}}function $l(n){let e,t,l,i;return e=new Yl({props:{position:"column",coords:n[16],on_click:n[34]}}),l=new Yl({props:{position:"row",coords:n[16],on_click:n[35]}}),{c(){Dt(e.$$.fragment),t=nl(),Dt(l.$$.fragment)},m(s,o){Nt(e,s,o),ft(s,t,o),Nt(l,s,o),i=!0},p(s,o){const r={};o[0]&65536&&(r.coords=s[16]),o[0]&196608&&(r.on_click=s[34]),e.$set(r);const u={};o[0]&65536&&(u.coords=s[16]),o[0]&327680&&(u.on_click=s[35]),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(t),Tt(e,s),Tt(l,s)}}}function Gr(n){let e,t,l,i,s,o,r=n[2]&&n[5]!=="bool"&&Zl(n);const u=[Vr,Kr],c=[];function _(f,k){return f[5]==="bool"?0:1}t=_(n),l=c[t]=u[t](n);let a=n[15]&&n[16]&&n[17]&&n[18]&&$l(n);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[t].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 L=t;t=_(f),t===L?c[t].p(f,k):(gn(),Ze(c[L],1,1,()=>{c[L]=null}),mn(),l=c[t],l?l.p(f,k):(l=c[t]=u[t](f),l.c()),Ie(l,1),l.m(i.parentNode,i)),f[15]&&f[16]&&f[17]&&f[18]?a?(a.p(f,k),k[0]&491520&&Ie(a,1)):(a=$l(f),a.c(),Ie(a,1),a.m(s.parentNode,s)):a&&(gn(),Ze(a,1,1,()=>{a=null}),mn())},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[t].d(f),a&&a.d(f)}}}function Qr(n,e=null,t=!1){if(t)return String(n);const l=String(n);return!e||e<=0||l.length<=e?l:l.slice(0,e)+"..."}function Zr(n){return requestAnimationFrame(()=>{n.focus()}),{}}const $r=()=>{};function xr(n,e,t){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:L=!0}=e,{is_static:v=!1}=e,{max_chars:M=null}=e,{components:d={}}=e,{i18n:g}=e,{is_dragging:b=!1}=e,{wrap_text:y=!1}=e,{show_selection_buttons:p=!1}=e,{coords:j}=e,{on_select_column:B=null}=e,{on_select_row:P=null}=e,{el:T}=e;const K=Jr();let H=!1;function W(w){K("blur",{blur_event:w,coords:j})}function V(w){w.key==="Enter"&&(_||t(19,H=!H)),K("keydown",w)}function re(){!o&&!_&&t(19,H=!H)}function ue(w){t(0,r=w.toString()),K("blur",{blur_event:{target:{type:"checkbox",checked:w,value:w.toString()}},coords:j})}function I(w){sn.call(this,n,w)}function q(w){sn.call(this,n,w)}function D(w){sn.call(this,n,w)}function fe(w){sn.call(this,n,w)}function ce(w){Hr[w?"unshift":"push"](()=>{T=w,t(1,T)})}function X(){r=this.value,t(0,r)}const U=()=>B(j[1]),z=()=>P(j[0]);return n.$$set=w=>{"edit"in w&&t(2,o=w.edit),"value"in w&&t(0,r=w.value),"display_value"in w&&t(26,u=w.display_value),"styling"in w&&t(3,c=w.styling),"header"in w&&t(4,_=w.header),"datatype"in w&&t(5,a=w.datatype),"latex_delimiters"in w&&t(6,f=w.latex_delimiters),"line_breaks"in w&&t(7,
4k=w.line_breaks),"editable"in w&&t(8,L=w.editable),"is_static"in w&&t(9,v=w.is_static),"max_chars"in w&&t(10,M=w.max_chars),"components"in w&&t(11,d=w.components),"i18n"in w&&t(12,g=w.i18n),"is_dragging"in w&&t(13,b=w.is_dragging),"wrap_text"in w&&t(14,y=w.wrap_text),"show_selection_buttons"in w&&t(15,p=w.show_selection_buttons),"coords"in w&&t(16,j=w.coords),"on_select_column"in w&&t(17,B=w.on_select_column),"on_select_row"in w&&t(18,P=w.on_select_row),"el"in w&&t(1,T=w.el)},n.$$.update=()=>{n.$$.dirty[0]&525316&&t(27,l=!o&&!H&&M!==null&&M>0),n.$$.dirty[0]&67109121&&t(20,i=L?r:u!==null?u:r),n.$$.dirty[0]&135267360&&t(21,s=l?Qr(i,M,a==="image"):i)},[r,T,o,c,_,a,f,k,L,v,M,d,g,b,y,p,j,B,P,H,i,s,W,V,re,ue,u,l,I,q,D,fe,ce,X,U,z]}class bl extends Tr{constructor(e){super(),Or(this,e,xr,Gr,Rr,{edit:2,value:0,display_value:26,styling:3,header:4,datatype:5,latex_delimiters:6,line_breaks:7,editable:8,is_static:9,max_chars:10,components:11,i18n:12,is_dragging:13,wrap_text:14,show_selection_buttons:15,coords:16,on_select_column:17,on_select_row:18,el:1},null,[-1,-1])}get edit(){return this.$$.ctx[2]}set edit(e){this.$$set({edit:e}),he()}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),he()}get display_value(){return this.$$.ctx[26]}set display_value(e){this.$$set({display_value:e}),he()}get styling(){return this.$$.ctx[3]}set styling(e){this.$$set({styling:e}),he()}get header(){return this.$$.ctx[4]}set header(e){this.$$set({header:e}),he()}get datatype(){return this.$$.ctx[5]}set datatype(e){this.$$set({datatype:e}),he()}get latex_delimiters(){return this.$$.ctx[6]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),he()}get line_breaks(){return this.$$.ctx[7]}set line_breaks(e){this.$$set({line_breaks:e}),he()}get editable(){return this.$$.ctx[8]}set editable(e){this.$$set({editable:e}),he()}get is_static(){return this.$$.ctx[9]}set is_static(e){this.$$set({is_static:e}),he()}get max_chars(){return this.$$.ctx[10]}set max_chars(e){this.$$set({max_chars:e}),he()}get components(){return this.$$.ctx[11]}set components(e){this.$$set({components:e}),he()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),he()}get is_dragging(){return this.$$.ctx[13]}set is_dragging(e){this.$$set({is_dragging:e}),he()}get wrap_text(){return this.$$.ctx[14]}set wrap_text(e){this.$$set({wrap_text:e}),he()}get show_selection_buttons(){return this.$$.ctx[15]}set show_selection_buttons(e){this.$$set({show_selection_buttons:e}),he()}get coords(){return this.$$.ctx[16]}set coords(e){this.$$set({coords:e}),he()}get on_select_column(){return this.$$.ctx[17]}set on_select_column(e){this.$$set({on_select_column:e}),he()}get on_select_row(){return this.$$.ctx[18]}set on_select_row(e){this.$$set({on_select_row:e}),he()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),he()}}const{SvelteComponent:e_,append:t_,attr:Mt,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_(n){let e,t=(n[0]!==null?n[0]+1:"")+"",l;return{c(){e=ks("td"),l=o_(t),Mt(e,"class","row-number svelte-ux4in1"),Mt(e,"tabindex","-1"),Mt(e,"data-row",n[0]),Mt(e,"data-col","row-number")},m(i,s){kl(i,e,s),t_(e,l)},p(i,s){s&1&&t!==(t=(i[0]!==null?i[0]+1:"")+"")&&s_(l,t),s&1&&Mt(e,"data-row",i[0])},d(i){i&&wl(e)}}}function __(n){let e;return{c(){e=ks("th"),e.innerHTML='<div class="cell-wrap"><div class="header-content"><div class="header-text"></div></div></div>',Mt(e,"tabindex","-1"),Mt(e,"class","row-number svelte-ux4in1")},m(t,l){kl(t,e,l)},p:ll,d(t){t&&wl(e)}}}function a_(n){let e;function t(s,o){return s[1]?__:r_}let l=t(n),i=l(n);return{c(){i.c(),e=n_()},m(s,o){i.m(s,o),kl(s,e,o)},p(s,[o]){l===(l=t(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_(n,e,t){let{index:l=null}=e,{is_header:i=!1}=e;return n.$$set=s=>{"index"in s&&t(0,l=s.index),"is_header"in s&&t(1,i=s.is_header)},[l,i]}class vn 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_(n){let e,t,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),t||(l=[ei(e,"click",function(){b_(n[0])&&n[0].apply(this,arguments)}),ei(e,"touchstart",n[1])],t=!0)},p(i,[s]){n=i},i:ti,o:ti,d(i){i&&f_(e),t=!1,w_(l)}}}function v_(n,e,t){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 n.$$set=s=>{"on_click"in s&&t(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_(n){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(t,l){M_(t,e,l)},p:$n,i:$n,o:$n,d(t){t&&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_(n){let e,t,l;return{c(){e=xn("svg"),t=xn("path"),l=xn("path"),Le(t,"d","M4 8L8 4L12 8"),Le(t,"stroke","currentColor"),Le(t,"stroke-width","1.5"),Le(t,"stroke-linecap","round"),Le(t,"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",n[0]),Le(e,"height",n[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,t),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_(n,e,t){let{size:l=16}=e;return n.$$set=i=>{"size"in i&&t(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_(n){let e,t,l;return{c(){e=el("svg"),t=el("path"),l=el("path"),je(t,"d","M4 8L8 12L12 8"),je(t,"stroke","currentColor"),je(t,"stroke-width","1.5"),je(t,"stroke-linecap","round"),je(t,"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",n[0]),je(e,"height",n[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,t),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_(n,e,t){let{size:l=16}=e;return n.$$set=i=>{"size"in i&&t(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:cn,create_component:Gt,destroy_component:Qt,detach:pl,element:Et,flush:be,group_outros:fn,init:G_,insert:vl,listen:on,mount_component:Zt,run_all:Q_,safe_not_equal:Z_,set_data:$_,set_style:rn,space:hn,text:x_,toggle_class:wt,transition_in:ze,transition_out:Fe}=window.__gradio__svelte__internal;function ui(n){let e,t,l,i,s,o;const r=[ta,ea],u=[];function c(a,f){return a[19]==="asc"?0:1}l=c(n),i=u[l]=r[l](n);let _=n[11].length>1&&ci(n);return{c(){e=Et("div"),t=Et("span"),i.c(),s=hn(),_&&_.c(),Pe(t,"class","sort-arrow svelte-sy2j2s"),Pe(e,"class","sort-indicators svelte-sy2j2s")},m(a,f){vl(a,e,f),ut(e,t),u[l].m(t,null),ut(e,s),_&&_.m(e,null),o=!0},p(a,f){let k=l;l=c(a),l!==k&&(fn(),Fe(u[k],1,1,()=>{u[k]=null}),cn(),i=u[l],i||(i=u[l]=r[l](a),i.c()),ze(i,1),i.m(t,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(n){let e,t;return e=new Y_({props:{size:12}}),{c(){Gt(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},i(l){t||(ze(e.$$.fragment,l),t=!0)},o(l){Fe(e.$$.fragment,l),t=!1},d(l){Qt(e,l)}}}function ta(n){let e,t;return e=new P_({props:{size:12}}),{c(){Gt(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},i(l){t||(ze(e.$$.fragment,l),t=!0)},o(l){Fe(e.$$.fragment,l),t=!1},d(l){Qt(e,l)}}}function ci(n){let e,t;return{c(){e=Et("span"),t=x_(n[20]),Pe(e,"class","sort-priority svelte-sy2j2s")},m(l,i){vl(l,e,i),ut(e,t)},p(l,i){i&1048576&&$_(t,l[20])},d(l){l&&pl(e)}}}function fi(n){let e,t;return e=new L_({}),{c(){Gt(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},i(l){t||(ze(e.$$.fragment,l),t=!0)},o(l){Fe(e.$$.fragment,l),t=!1},d(l){Qt(e,l)}}}function hi(n){let e,t;return e=new ps({props:{on_click:n[28]}}),{c(){Gt(e.$$.fragment)},m(l,i){Zt(e,l,i),t=!0},p(l,i){const s={};i&516&&(s.on_click=l[28]),e.$set(s)},i(l){t||(ze(e.$$.fragment,l),t=!0)},o(l){Fe(e.$$.fragment,l),t=!1},d(l){Qt(e,l)}}}function na(n){let e,t,l,i,s,o,r,u,c,_,a,f,k,L;function v(p){n[24](p)}function M(p){n[25](p)}let d={max_chars:n[14],latex_delimiters:n[12],line_breaks:n[13],edit:n[4]===n[2],header:!0,editable:n[15],is_static:n[17],i18n:n[16],coords:[n[2],0]};n[0]!==void 0&&(d.value=n[0]),n[1]!==void 0&&(d.el=n[1]),s=new bl({props:d}),ai.push(()=>_i(s,"value",v)),ai.push(()=>
4_i(s,"el",M)),s.$on("keydown",n[26]);let g=n[18]!==-1&&ui(n),b=n[17]&&fi(),y=n[21]&&hi(n);return{c(){e=Et("th"),t=Et("div"),l=Et("div"),i=Et("button"),Gt(s.$$.fragment),u=hn(),g&&g.c(),c=hn(),b&&b.c(),_=hn(),y&&y.c(),Pe(i,"class","header-button svelte-sy2j2s"),Pe(i,"title",n[0]),Pe(l,"class","header-content svelte-sy2j2s"),Pe(t,"class","cell-wrap svelte-sy2j2s"),Pe(e,"aria-sort",a=ln(n[0],n[11],n[6])==="none"?"none":ln(n[0],n[11],n[6])==="asc"?"ascending":"descending"),rn(e,"width",n[7](n[2])),rn(e,"left",n[22](n[2])),Pe(e,"title",n[0]),Pe(e,"class","svelte-sy2j2s"),wt(e,"pinned-column",n[2]<n[3]),wt(e,"last-pinned",n[2]===n[3]-1),wt(e,"focus",n[4]===n[2]||n[5]===n[2]),wt(e,"sorted",n[18]!==-1)},m(p,j){vl(p,e,j),ut(e,t),ut(t,l),ut(l,i),Zt(s,i,null),ut(i,u),g&&g.m(i,null),ut(l,c),b&&b.m(l,null),ut(t,_),y&&y.m(t,null),f=!0,k||(L=[on(i,"click",n[27]),on(i,"mousedown",la),on(e,"click",n[29]),on(e,"mousedown",ia)],k=!0)},p(p,[j]){const B={};j&16384&&(B.max_chars=p[14]),j&4096&&(B.latex_delimiters=p[12]),j&8192&&(B.line_breaks=p[13]),j&20&&(B.edit=p[4]===p[2]),j&32768&&(B.editable=p[15]),j&131072&&(B.is_static=p[17]),j&65536&&(B.i18n=p[16]),j&4&&(B.coords=[p[2],0]),!o&&j&1&&(o=!0,B.value=p[0],ri(()=>o=!1)),!r&&j&2&&(r=!0,B.el=p[1],ri(()=>r=!1)),s.$set(B),p[18]!==-1?g?(g.p(p,j),j&262144&&ze(g,1)):(g=ui(p),g.c(),ze(g,1),g.m(i,null)):g&&(fn(),Fe(g,1,1,()=>{g=null}),cn()),(!f||j&1)&&Pe(i,"title",p[0]),p[17]?b?j&131072&&ze(b,1):(b=fi(),b.c(),ze(b,1),b.m(l,null)):b&&(fn(),Fe(b,1,1,()=>{b=null}),cn()),p[21]?y?(y.p(p,j),j&2097152&&ze(y,1)):(y=hi(p),y.c(),ze(y,1),y.m(t,null)):y&&(fn(),Fe(y,1,1,()=>{y=null}),cn()),(!f||j&2113&&a!==(a=ln(p[0],p[11],p[6])==="none"?"none":ln(p[0],p[11],p[6])==="asc"?"ascending":"descending"))&&Pe(e,"aria-sort",a),(!f||j&132)&&rn(e,"width",p[7](p[2])),(!f||j&4)&&rn(e,"left",p[22](p[2])),(!f||j&1)&&Pe(e,"title",p[0]),(!f||j&12)&&wt(e,"pinned-column",p[2]<p[3]),(!f||j&12)&&wt(e,"last-pinned",p[2]===p[3]-1),(!f||j&52)&&wt(e,"focus",p[4]===p[2]||p[5]===p[2]),(!f||j&262144)&&wt(e,"sorted",p[18]!==-1)},i(p){f||(ze(s.$$.fragment,p),ze(g),ze(b),ze(y),f=!0)},o(p){Fe(s.$$.fragment,p),Fe(g),Fe(b),Fe(y),f=!1},d(p){p&&pl(e),Qt(s),g&&g.d(),b&&b.d(),y&&y.d(),k=!1,Q_(L)}}}const la=n=>{n.preventDefault(),n.stopPropagation()},ia=n=>{n.preventDefault(),n.stopPropagation()};function sa(n,e,t){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:L}=e,{toggle_header_menu:v}=e,{end_header_edit:M}=e,{sort_columns:d=[]}=e,{latex_delimiters:g}=e,{line_breaks:b}=e,{max_chars:y}=e,{editable:p}=e,{i18n:j}=e,{el:B}=e,{is_static:P}=e,{col_count:T}=e;function K(q){return q>=c?"auto":q===0?"0":`calc(${Array(q).fill(0).map((fe,ce)=>k(ce)).join(" + ")})`}function H(q){r=q,t(0,r)}function W(q){B=q,t(1,B)}const V=q=>
4{(q.detail.key==="Enter"||q.detail.key==="Escape"||q.detail.key==="Tab")&&M(q)},re=q=>L(q,u),ue=q=>v(q,u),I=q=>L(q,u);return n.$$set=q=>{"value"in q&&t(0,r=q.value),"i"in q&&t(2,u=q.i),"actual_pinned_columns"in q&&t(3,c=q.actual_pinned_columns),"header_edit"in q&&t(4,_=q.header_edit),"selected_header"in q&&t(5,a=q.selected_header),"headers"in q&&t(6,f=q.headers),"get_cell_width"in q&&t(7,k=q.get_cell_width),"handle_header_click"in q&&t(8,L=q.handle_header_click),"toggle_header_menu"in q&&t(9,v=q.toggle_header_menu),"end_header_edit"in q&&t(10,M=q.end_header_edit),"sort_columns"in q&&t(11,d=q.sort_columns),"latex_delimiters"in q&&t(12,g=q.latex_delimiters),"line_breaks"in q&&t(13,b=q.line_breaks),"max_chars"in q&&t(14,y=q.max_chars),"editable"in q&&t(15,p=q.editable),"i18n"in q&&t(16,j=q.i18n),"el"in q&&t(1,B=q.el),"is_static"in q&&t(17,P=q.is_static),"col_count"in q&&t(23,T=q.col_count)},n.$$.update=()=>{n.$$.dirty&8388608&&t(21,l=T&&T[1]==="dynamic"),n.$$.dirty&2052&&t(18,i=d.findIndex(q=>q.col===u)),n.$$.dirty&262144&&t(20,s=i!==-1?i+1:null),n.$$.dirty&264192&&t(19,o=i!==-1?d[i].direction:null)},[r,B,u,c,_,a,f,k,L,v,M,d,g,b,y,p,j,P,i,o,s,l,K,T,H,W,V,re,ue,I]}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,editable:15,i18n:16,el:1,is_static:17,col_count:23})}get value(){return this.$$.ctx[0]}set value(e){this.$$set({value:e}),be()}get i(){return this.$$.ctx[2]}set i(e){this.$$set({i:e}),be()}get actual_pinned_columns(){return this.$$.ctx[3]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),be()}get header_edit(){return this.$$.ctx[4]}set header_edit(e){this.$$set({header_edit:e}),be()}get selected_header(){return this.$$.ctx[5]}set selected_header(e){this.$$set({selected_header:e}),be()}get headers(){return this.$$.ctx[6]}set headers(e){this.$$set({headers:e}),be()}get get_cell_width(){return this.$$.ctx[7]}set get_cell_width(e){this.$$set({get_cell_width:e}),be()}get handle_header_click(){return this.$$.ctx[8]}set handle_header_click(e){this.$$set({handle_header_click:e}),be()}get toggle_header_menu(){return this.$$.ctx[9]}set toggle_header_menu(e){this.$$set({toggle_header_menu:e}),be()}get end_header_edit(){return this.$$.ctx[10]}set end_header_edit(e){this.$$set({end_header_edit:e}),be()}get sort_columns(){return this.$$.ctx[11]}set sort_columns(e){this.$$set({sort_columns:e}),be()}get latex_delimiters(){return this.$$.ctx[12]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),be()}get line_breaks(){return this.$$.ctx[13]}set line_breaks(e){this.$$set({line_breaks:e}),be()}get max_chars(){return this.$$.ctx[14]}set max_chars(e){this.$$set({max_chars:e}),be()}get editable(){return this.$$.ctx[15]}set editable(e){this.$$set({editable:e}),be()}get i18n(){return this.$$.ctx[16]}set i18n(e){this.$$set({i18n:e}),be()}get el(){return this.$$.ctx[1]}set el(e){this.$$set({el:e}),be()}get is_static(){return this.$$.ctx[17]}set is_static(e){this.$$set({is_static:e}),be()}get col_count(){return this.$$.ctx[23]}set col_count(e){this.$$set({col_count:e}),be()}}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:$,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:Jt,transition_out:dn}=window.__gradio__svelte__internal;function ki(n){let e,t;return e=new ps({props:{on_click:n[39]}}),{c(){ys(e.$$.fragment)},m(l,i){Ss(e,l,i),t=!0},p(l,i){const s={};i[0]&536&&(s.on_click=l[39]),e.$set(s)},i(l){t||(Jt(e.$$.fragment,l),t=!0)},o(l){dn(e.$$.fragment,l),t=!1},d(l){Cs(e,l)}}}function ba(n){let e,t,l,i,s,o,r=n[19]&&n[10]([n[3],n[4]],n[0],n[19]),u,c,_,a,f,k;function L(g){n[36](g)}function v(g){n[37](g)}let M={display_value:n[26]!==void 0?n[26]:String(n[1]),latex_delimiters:n[14],line_breaks:n[15],editable:n[19],is_static:n[20],edit:n[17]&&n[17][0]===n[3]&&n[17][1]===n[4],datatype:n[16],max_chars:n[18],i18n:n[21],components:n[22],show_selection_buttons:n[0].length===1&&n[0][0][0]===n[3]&&n[0][0][1]===n[4],coords:[n[3],n[4]],on_select_column:n[23],on_select_row:n[24],is_dragging:n[25],wrap_text:n[27]};n[1]!==void 0&&(M.value=n[1]),n[2].input!==void 0&&(M.el=n[2].input),l=new bl({props:M}),il.push(()=>gi(l,"value",L)),il.push(()=>gi(l,"el",v)),l.$on("focus",n[38]),l.$on("blur",function(){fa(n[8])&&n[8].apply(this,arguments)});let d=r&&ki(n);return{c(){e=bi("td"),t=bi("div"),ys(l.$$.fragment),o=ga(),d&&d.c(),Xe(t,"class","cell-wrap svelte-v1pjjd"),Xe(e,"tabindex",u=n[4]<n[5]?-1:0),Xe(e,"data-row",n[3]),Xe(e,"data-col",n[4]),Xe(e,"data-testid",c=`cell-${n[3]}-${n[4]}`),Xe(e,"style",_="width: "+n[6](n[4])+"; left: "+n[33](n[4])+"; "+(n[13]||"")),Xe(e,"class","svelte-v1pjjd"),de(e,"pinned-column",n[4]<n[5]),de(e,"last-pinned",n[4]===n[5]-1),de(e,"flash",n[11]&&n[32]),de(e,"cell-selected",n[32]),de(e,"no-top",n[31]),de(e,"no-bottom",n[30]),de(e,"no-left",n[29]),de(e,"no-right",n[28]),de(e,"menu-active",n[12]&&n[12].row===n[3]&&n[12].
4col===n[4]),de(e,"dragging",n[25])},m(g,b){ca(g,e,b),mi(e,t),Ss(l,t,null),mi(t,o),d&&d.m(t,null),n[40](e),a=!0,f||(k=[wi(e,"mousedown",n[41]),wi(e,"contextmenu",ha(n[42]))],f=!0)},p(g,b){n=g;const y={};b[0]&67108866&&(y.display_value=n[26]!==void 0?n[26]:String(n[1])),b[0]&16384&&(y.latex_delimiters=n[14]),b[0]&32768&&(y.line_breaks=n[15]),b[0]&524288&&(y.editable=n[19]),b[0]&1048576&&(y.is_static=n[20]),b[0]&131096&&(y.edit=n[17]&&n[17][0]===n[3]&&n[17][1]===n[4]),b[0]&65536&&(y.datatype=n[16]),b[0]&262144&&(y.max_chars=n[18]),b[0]&2097152&&(y.i18n=n[21]),b[0]&4194304&&(y.components=n[22]),b[0]&25&&(y.show_selection_buttons=n[0].length===1&&n[0][0][0]===n[3]&&n[0][0][1]===n[4]),b[0]&24&&(y.coords=[n[3],n[4]]),b[0]&8388608&&(y.on_select_column=n[23]),b[0]&16777216&&(y.on_select_row=n[24]),b[0]&33554432&&(y.is_dragging=n[25]),b[0]&134217728&&(y.wrap_text=n[27]),!i&&b[0]&2&&(i=!0,y.value=n[1],di(()=>i=!1)),!s&&b[0]&4&&(s=!0,y.el=n[2].input,di(()=>s=!1)),l.$set(y),b[0]&525337&&(r=n[19]&&n[10]([n[3],n[4]],n[0],n[19])),r?d?(d.p(n,b),b[0]&525337&&Jt(d,1)):(d=ki(n),d.c(),Jt(d,1),d.m(t,null)):d&&(aa(),dn(d,1,1,()=>{d=null}),ra()),(!a||b[0]&48&&u!==(u=n[4]<n[5]?-1:0))&&Xe(e,"tabindex",u),(!a||b[0]&8)&&Xe(e,"data-row",n[3]),(!a||b[0]&16)&&Xe(e,"data-col",n[4]),(!a||b[0]&24&&c!==(c=`cell-${n[3]}-${n[4]}`))&&Xe(e,"data-testid",c),(!a||b[0]&8272&&_!==(_="width: "+n[6](n[4])+"; left: "+n[33](n[4])+"; "+(n[13]||"")))&&Xe(e,"style",_),(!a||b[0]&48)&&de(e,"pinned-column",n[4]<n[5]),(!a||b[0]&48)&&de(e,"last-pinned",n[4]===n[5]-1),(!a||b[0]&2048|b[1]&2)&&de(e,"flash",n[11]&&n[32]),(!a||b[1]&2)&&de(e,"cell-selected",n[32]),(!a||b[1]&1)&&de(e,"no-top",n[31]),(!a||b[0]&1073741824)&&de(e,"no-bottom",n[30]),(!a||b[0]&536870912)&&de(e,"no-left",n[29]),(!a||b[0]&268435456)&&de(e,"no-right",n[28]),(!a||b[0]&4120)&&de(e,"menu-active",n[12]&&n[12].row===n[3]&&n[12].col===n[4]),(!a||b[0]&33554432)&&de(e,"dragging",n[25])},i(g){a||(Jt(l.$$.fragment,g),Jt(d),a=!0)},o(g){dn(l.$$.fragment,g),dn(d),a=!1},d(g){g&&_a(e),Cs(l),d&&d.d(),n[40](null),f=!1,da(k)}}}function wa(n,e,t){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:L}=e,{handle_blur:v}=e,{toggle_cell_menu:M}=e,{is_cell_selected:d}=e,{should_show_cell_menu:g}=e,{selected_cells:b}=e,{copy_flash:y}=e,{active_cell_menu:p}=e,{styling:j}=e,{latex_delimiters:B}=e,{line_breaks:P}=e,{datatype:T}=e,{editing:K}=e,{max_chars:H}=e,{editable:W}=e,{is_static:V=!1}=e,{i18n:re}=e,{components:ue={}}=e,{el:I}=e,{handle_select_column:q}=e,{handle_select_row:D}=e,{is_dragging:fe}=e,{display_value:ce}=e,{wrap:X=!1}=e;function U(S){return S>=f?"auto":S===0?"0":`calc(${Array(S).fill(0).map((vt,G)=>k(G)).join(" + ")})`}function z(S){c=S,t(1,c)}function w(S){n.$$.not_equal(I.input,S)&&(I.input=S,t(2,I))}const E=()=>{const S=_,F=a;b.some(([vt,G])=>vt===S&&G===F)||t(0,b=[[S,F]])},R=S=>M(S,_,a);function Be(S){il[S?"unshift":"push"](()=>{I.cell=S,t(2,I)})}const Ue=S=>L(S,_,a),C=S=>M(S,_,a);return n.$$set=S=>{"value"in S&&t(1,c=S.value),"index"in S&&t(3,_=S.index),"j"in S&&t(4,a=S.j),"actual_pinned_columns"in S&&t(5,f=S.actual_pinned_columns),"get_cell_width"in S&&t(6,k=S.get_cell_width),"handle_cell_click"in S&&t(7,L=S.handle_cell_click),"handle_blur"in S&&t(8,v=S.handle_blur),"toggle_cell_menu"in S&&t(9,M=S.toggle_cell_menu),"is_cell_selected"in S&&t(34,d=S.is_cell_selected),"should_show_cell_menu"in S&&t(10,g=S.should_show_cell_menu),"selected_cells"in S&&t(0,b=S.selected_cells),"copy_flash"in S&&t(11,y=S.copy_flash),"active_cell_menu"in S&&t(12,p=S.active_cell_menu),"styling"in S&&t(13,j=S.styling),"latex_delimiters"in S&&t(14,B=S.latex_delimiters),"line_breaks"in S&&t(15,P=S.line_breaks),"datatype"in S&&t(16,T=S.datatype),"editing"in S&&t(17,K=S.editing),"max_chars"in S&&t(18,H=S.max_chars),"editable"in S&&t(19,W=S.editable),"is_static"in S&&t(20,V=S.is_static),"i18n"in S&&t(21,re=S.i18n),"components"in S&&t(22,ue=S.components),"el"in S&&t(2,I=S.el),"handle_select_column"in S&&t(23,q=S.handle_select_column),"handle_select_row"in S&&t(24,D=S.handle_select_row),"is_dragging"in S&&t(25,fe=S.is_dragging),"display_value"in S&&t(26,ce=S.display_value),"wrap"in S&&t(27,X=S.wrap)},n.$$.update=()=>{n.$$.dirty[0]&25|n.$$.dirty[1]&8&&t(35,l=d([_,a],b||[])),n.$$.dirty[0]&25&&t(32,i=Uo([_,a],b)),n.$$.dirty[1]&16&&t(31,s=l.includes("no-top")),n.$$.dirty[1]&16&&t(30,o=l.includes("no-bottom")),n.$$.dirty[1]&16&&t(29,r=l.includes("no-left")),n.$$.dirty[1]&16&&t(28,u=l.includes("no-right"))},[b,c,I,_,a,f,k,L,v,M,g,y,p,j,B,P,T,K,H,W,V,re,ue,q,D,fe,ce,X,u,r,o,s,i,U,d,l,z,w,E,R,Be,Ue,C]}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:34,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,editable:19,is_static:20,i18n:21,components:22,el:2,handle_select_column:23,handle_select_row:24,is_dragging:25,display_value:26,wrap:27},null,[-1,-1])}get value(){return this.$$.ctx[1]}set value(e){this.$$set({value:e}),$()}get index(){return this.$$.ctx[3]}set index(e){this.$$set({index:e}),$()}get j(){return this.$$.ctx[4]}set j(e){this.$$set({j:e}),$()}get actual_pinned_columns(){return this.$$.ctx[5]}set actual_pinned_columns(e){this.$$set({actual_pinned_columns:e}),$()}get get_cell_width(){return this.$$.ctx[6]}set get_cell_width(e){this.$$set({get_cell_width:e}),$()}get handle_cell_click(){return this.$$.ctx[7]}set handle_cell_click(e){this.$$set({handle_cell_click:e}),$()}get handle_blur(){return this.$$.ctx[8]}set handle_blur(e){this.$$set({handle_blur:e}),$()}get toggle_cell_menu(){return this.$$.ctx[9]}set toggle_cell_menu(e){this.$$set({toggle_cell_menu:e}),$()}get is_cell_selected(){return this.$$.ctx[34]}set is_cell_selected(e){this.$$set({is_cell_selected:e}),$()}get should_show_cell_menu(){return this.$$.ctx[10]}set should_show_cell_menu(e){this.$$set({should_show_cell_menu:e}),$()}get selected_cells(){return this.$$.ctx[0]}set selected_cells(e){this.$$set({selected_cells:e}),$()}get copy_flash(){return this.$$.ctx[11]}set copy_flash(e){this.$$set({copy_flash:e}),$()}get active_cell_menu(){return this.$$.ctx[12]}set active_cell_menu(e){this.$$set({active_cell_menu:e}),$()}get styling(){return this.$$.ctx[13]}set styling(e){this.$$set({styling:e}),$()}get latex_delimiters(){return this.$$.ctx[14]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),$()}get line_breaks(){return this.$$.ctx[15]}set line_breaks(e){this.$$set({line_breaks:e}),$()}get datatype(){return this.$$.ctx[16]}set datatype(e){this.$$set({datatype:e}),$()}
4get editing(){return this.$$.ctx[17]}set editing(e){this.$$set({editing:e}),$()}get max_chars(){return this.$$.ctx[18]}set max_chars(e){this.$$set({max_chars:e}),$()}get editable(){return this.$$.ctx[19]}set editable(e){this.$$set({editable:e}),$()}get is_static(){return this.$$.ctx[20]}set is_static(e){this.$$set({is_static:e}),$()}get i18n(){return this.$$.ctx[21]}set i18n(e){this.$$set({i18n:e}),$()}get components(){return this.$$.ctx[22]}set components(e){this.$$set({components:e}),$()}get el(){return this.$$.ctx[2]}set el(e){this.$$set({el:e}),$()}get handle_select_column(){return this.$$.ctx[23]}set handle_select_column(e){this.$$set({handle_select_column:e}),$()}get handle_select_row(){return this.$$.ctx[24]}set handle_select_row(e){this.$$set({handle_select_row:e}),$()}get is_dragging(){return this.$$.ctx[25]}set is_dragging(e){this.$$set({is_dragging:e}),$()}get display_value(){return this.$$.ctx[26]}set display_value(e){this.$$set({display_value:e}),$()}get wrap(){return this.$$.ctx[27]}set wrap(e){this.$$set({wrap:e}),$()}}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(n){let e,t,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),t||(l=Aa(e,"click",function(){Ma(n[0])&&n[0].apply(this,arguments)}),t=!0)},p(i,[s]){n=i},i:vi,o:vi,d(i){i&&va(e),t=!1,l()}}}function ja(n,e,t){let{on_click:l}=e;return n.$$set=i=>{"on_click"in i&&t(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:Ct,attr:_n,binding_callbacks:Si,check_outros:qs,create_slot:sl,detach:yn,element:jt,empty:Ms,ensure_array_like:qi,flush:it,get_all_dirty_from_scope:ol,get_slot_changes:rl,group_outros:As,init:Ta,insert:Cn,listen:Na,outro_and_destroy_block:Ha,resize_observer_content_box:Oa,safe_not_equal:Pa,set_style:Oe,space:Mi,text:Ra,toggle_class:Ai,transition_in:At,transition_out:Bt,update_keyed_each:Fa,update_slot_base:_l}=window.__gradio__svelte__internal,{onMount:Ia,tick:Ja,createEventDispatcher:Ka}=window.__gradio__svelte__internal,Va=n=>({}),Ei=n=>({});function Li(n,e,t){const l=n.slice();return l[37]=e[t],l}const Ua=n=>({item:n[0]&1024,index:n[0]&1024}),ji=n=>({item:n[37].data,index:n[37].index}),Wa=n=>({}),zi=n=>({});function Bi(n){let e=[],t=new Map,l,i,s=qi(n[10]);const o=r=>r[37].data[0].id;for(let r=0;r<s.length;r+=1){let u=Li(n,s,r),c=o(u);t.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);Cn(r,l,u),i=!0},p(r,u){u[0]&8389632&&(s=qi(r[10]),As(),e=Fa(e,u,o,1,r,s,t,l.parentNode,Ha,Di,l,Li),qs())},i(r){if(!i){for(let u=0;u<s.length;u+=1)At(e[u]);i=!0}},o(r){for(let u=0;u<e.length;u+=1)Bt(e[u]);i=!1},d(r){r&&yn(l);for(let u=0;u<e.length;u+=1)e[u].d(r)}}}function Ya(n){let e;return{c(){e=Ra(`Missing Table Row
5						`)},m(t,l){Cn(t,e,l)},d(t){t&&yn(e)}}}function Di(n,e){let t,l;const i=e[24].tbody,s=sl(i,e,e[23],ji),o=s||Ya();return{key:n,first:null,c(){t=Ms(),o&&o.c(),this.first=t},m(r,u){Cn(r,t,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||(At(o,r),l=!0)},o(r){Bt(o,r),l=!1},d(r){r&&yn(t),o&&o.d(r)}}}function Xa(n){let e,t,l,i,s,o,r,u,c,_,a,f,k,L;const v=n[24].thead,M=sl(v,n,n[23],zi);let d=n[10].length&&n[10][0].data.length&&Bi(n);const g=n[24].tfoot,b=sl(g,n,n[23],Ei);return{c(){e=jt("svelte-virtual-table-viewport"),t=jt("div"),l=jt("table"),i=jt("thead"),M&&M.c(),o=Mi(),r=jt("tbody"),d&&d.c(),u=Mi(),c=jt("tfoot"),b&&b.c(),_n(i,"class","thead svelte-zsmsrz"),Ci(()=>n[25].call(i)),_n(r,"class","tbody svelte-zsmsrz"),_n(c,"class","tfoot svelte-zsmsrz"),Ci(()=>n[27].call(c)),_n(l,"class","table svelte-zsmsrz"),Oe(l,"height",Ga),Oe(l,"--bw-svt-p-top",n[9]+"px"),Oe(l,"--bw-svt-p-bottom",n[5]+"px"),Oe(l,"--bw-svt-head-height",n[7]+"px"),Oe(l,"--bw-svt-foot-height",n[8]+"px"),Oe(l,"--bw-svt-avg-row-height",n[3]+"px"),Oe(l,"--max-height",n[1]+"px"),Ai(l,"disable-scroll",n[2])},m(y,p){Cn(y,e,p),Ct(e,t),Ct(t,l),Ct(l,i),M&&M.m(i,null),s=yi(i,n[25].bind(i)),Ct(l,o),Ct(l,r),d&&d.m(r,null),n[26](r),Ct(l,u),Ct(l,c),b&&b.m(c,null),_=yi(c,n[27].bind(c)),n[28](l),a=Oa.observe(l,n[29].bind(l)),f=!0,k||(L=Na(l,"scroll",n[11]),k=!0)},p(y,p){M&&M.p&&(!f||p[0]&8388608)&&_l(M,v,y,y[23],f?rl(v,y[23],p,Wa):ol(y[23]),zi),y[10].length&&y[10][0].data.length?d?(d.p(y,p),p[0]&1024&&At(d,1)):(d=Bi(y),d.c(),At(d,1),d.m(r,null)):d&&(As(),Bt(d,1,1,()=>{d=null}),qs()),b&&b.p&&(!f||p[0]&8388608)&&_l(b,g,y,y[23],f?rl(g,y[23],p,Va):ol(y[23]),Ei),(!f||p[0]&512)&&Oe(l,"--bw-svt-p-top",y[9]+"px"),(!f||p[0]&32)&&Oe(l,"--bw-svt-p-bottom",y[5]+"px"),(!f||p[0]&128)&&Oe(l,"--bw-svt-head-height",y[7]+"px"),(!f||p[0]&256)&&Oe(l,"--bw-svt-foot-height",y[8]+"px"),(!f||p[0]&8)&&Oe(l,"--bw-svt-avg-row-height",y[3]+"px"),(!f||p[0]&2)&&Oe(l,"--max-height",y[1]+"px"),(!f||p[0]&4)&&Ai(l,"disable-scroll",
5y[2])},i(y){f||(At(M,y),At(d),At(b,y),f=!0)},o(y){Bt(M,y),Bt(d),Bt(b,y),f=!1},d(y){y&&yn(e),M&&M.d(y),s(),d&&d.d(),n[26](null),b&&b.d(y),_(),n[28](null),a(),k=!1,L()}}}let Ga="100%";function Qa(n,e,t){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:L=!1}=e,{viewport:v}=e;Ka();let M=30,d=0,g,b=0,y=0,p=[],j,B,P=0,T=200,K=[],H;const W=typeof window<"u",V=W?window.requestAnimationFrame:z=>z();async function re(){l.length<_&&await q(l.length-1,{behavior:"auto"});const z=Math.max(0,v.scrollTop);t(16,L=z>100),t(15,c=v.offsetWidth-v.clientWidth);for(let S=0;S<B.length;S+=1)p[_+S]=B[S].getBoundingClientRect().height;let w=0,E=b;for(;w<l.length;){const S=p[w]||M;if(E+S>z-r){t(12,_=w),t(9,P=E-b);break}E+=S,w+=1}let R=b;for(;w<l.length;){const S=p[w]||M;if(R+=S,w+=1,R-b>3*r)break}t(13,a=w);const Be=l.length-a,Ue=v.offsetHeight-v.clientHeight;Ue>0&&(R+=Ue);let C=p.filter(S=>typeof S=="number");for(t(3,M=C.reduce((S,F)=>S+F,0)/C.length||30),t(5,d=Be*M),isFinite(d)||t(5,d=2e5),p.length=l.length;w<l.length;)w+=1,p[w]=M;r&&R>r?t(14,u=r):t(14,u=R)}async function ue(z){V(async()=>{if(typeof z!="number")return;const w=typeof z!="number"?!1:I(z);w!==!0&&(w==="back"&&await q(z,{behavior:"instant"}),w==="forwards"&&await q(z,{behavior:"instant"},!0))})}function I(z){const w=B&&B[z-_];if(!w&&z<_)return"back";if(!w&&z>=a-1)return"forwards";const{top:E}=v.getBoundingClientRect(),{top:R,bottom:Be}=w.getBoundingClientRect();return R-E<37?"back":Be-E>T?"forwards":!0}async function q(z,w,E=!1){await Ja();const R=M;let Be=z*R;E&&(Be=Be-T+R+b);const Ue=v.offsetHeight-v.clientHeight;Ue>0&&(Be+=Ue);const C={top:Be,behavior:"smooth",...w};v.scrollTo(C)}Ia(()=>{B=g.children,t(20,j=!0)});function D(){b=this.offsetHeight,t(7,b)}function fe(z){Si[z?"unshift":"push"](()=>{g=z,t(6,g)})}function ce(){y=this.offsetHeight,t(8,y)}function X(z){Si[z?"unshift":"push"](()=>{v=z,t(0,v)})}function U(){H=Ba.entries.get(this)?.contentRect,t(4,H)}return n.$$set=z=>{"items"in z&&t(17,o=z.items),"max_height"in z&&t(1,r=z.max_height),"actual_height"in z&&t(14,u=z.actual_height),"table_scrollbar_width"in z&&t(15,c=z.table_scrollbar_width),"start"in z&&t(12,_=z.start),"end"in z&&t(13,a=z.end),"selected"in z&&t(18,f=z.selected),"disable_scroll"in z&&t(2,k=z.disable_scroll),"show_scroll_button"in z&&t(16,L=z.show_scroll_button),"viewport"in z&&t(0,v=z.viewport),"$$scope"in z&&t(23,s=z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&16&&t(21,T=H?.height||200),n.$$.dirty[0]&131072&&t(22,l=o),n.$$.dirty[0]&7340033&&j&&T&&v.offsetParent&&V(re),n.$$.dirty[0]&262144&&ue(f),n.$$.dirty[0]&4206602&&t(10,K=W?l.slice(_,a).map((z,w)=>({index:w+_,data:z})):l.slice(0,r/l.length*M+1).map((z,w)=>({index:w+_,data:z})))}
5,[v,r,k,M,H,d,g,b,y,P,K,re,_,a,u,c,L,o,f,q,j,T,l,s,i,D,fe,ce,X,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:_e,attr:m,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(n){let e,t,l,i,s,o;return{c(){e=Y("svg"),t=Y("path"),l=Y("path"),i=Y("path"),s=Y("path"),o=Y("path"),m(t,"d","M5 5H19"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(t,"stroke-linecap","round"),m(l,"d","M5 9H15"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"stroke-linecap","round"),m(i,"d","M5 13H11"),m(i,"stroke","currentColor"),m(i,"stroke-width","2"),m(i,"stroke-linecap","round"),m(s,"d","M5 17H7"),m(s,"stroke","currentColor"),m(s,"stroke-width","2"),m(s,"stroke-linecap","round"),m(o,"d","M17 17L21 21M21 17L17 21"),m(o,"stroke","currentColor"),m(o,"stroke-width","2"),m(o,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(r,u){ot(r,e,u),_e(e,t),_e(e,l),_e(e,i),_e(e,s),_e(e,o)},d(r){r&&st(e)}}}function iu(n){let e,t,l,i;return{c(){e=Y("svg"),t=Y("path"),l=Y("path"),i=Y("path"),m(t,"d","M8 12L12 16L16 12"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(t,"fill","none"),m(t,"stroke-linecap","round"),m(t,"stroke-linejoin","round"),m(l,"d","M12 16V9"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"stroke-linecap","round"),m(i,"d","M5 5H19"),m(i,"stroke","currentColor"),m(i,"stroke-width","2"),m(i,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(s,o){ot(s,e,o),_e(e,t),_e(e,l),_e(e,i)},d(s){s&&st(e)}}}function su(n){let e,t,l,i;return{c(){e=Y("svg"),t=Y("path"),l=Y("path"),i=Y("path"),m(t,"d","M8 16L12 12L16 16"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(t,"fill","none"),m(t,"stroke-linecap","round"),m(t,"stroke-linejoin","round"),m(l,"d","M12 12V19"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"stroke-linecap","round"),m(i,"d","M5 7H19"),m(i,"stroke","currentColor"),m(i,"stroke-width","2"),m(i,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(s,o){ot(s,e,o),_e(e,t),_e(e,l),_e(e,i)},d(s){s&&st(e)}}}function ou(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","10"),m(t,"y","5"),m(t,"width","4"),m(t,"height","14"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(l,"d","M7 8L17 16M17 8L7 16"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function ru(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","5"),m(t,"y","10"),m(t,"width","14"),m(t,"height","4"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(l,"d","M8 7L16 17M16 7L8 17"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function _u(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","6"),m(t,"y","4"),m(t,"width","12"),m(t,"height","4"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(l,"d","M12 12V19M8 16L12 19L16 16"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"fill","none"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function au(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","6"),m(t,"y","16"),m(t,"width","12"),m(t,"height","4"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(l,"d","M12 12V5M8 8L12 5L16 8"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"fill","none"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function uu(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","16"),m(t,"y","6"),m(t,"width","4"),m(t,"height","12"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(t,"fill","none"),m(l,"d","M12 12H5M8 8L5 12L8 16"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"fill","none"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function cu(n){let e,t,l;return{c(){e=Y("svg"),t=Y("rect"),l=Y("path"),m(t,"x","4"),m(t,"y","6"),m(t,"width","4"),m(t,"height","12"),m(t,"stroke","currentColor"),m(t,"stroke-width","2"),m(t,"fill","none"),m(l,"d","M12 12H19M16 8L19 
512L16 16"),m(l,"stroke","currentColor"),m(l,"stroke-width","2"),m(l,"fill","none"),m(l,"stroke-linecap","round"),m(e,"viewBox","0 0 24 24"),m(e,"width","16"),m(e,"height","16")},m(i,s){ot(i,e,s),_e(e,t),_e(e,l)},d(i){i&&st(e)}}}function fu(n){let e;function t(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=t(n),i=l&&l(n);return{c(){i&&i.c(),e=xa()},m(s,o){i&&i.m(s,o),ot(s,e,o)},p(s,[o]){l!==(l=t(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(n,e,t){let{icon:l}=e;return n.$$set=i=>{"icon"in i&&t(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:oe,attr:te,binding_callbacks:mu,check_outros:Vt,create_component:dt,destroy_component:mt,detach:me,element:$e,empty:Es,flush:we,group_outros:Ut,init:gu,insert:ge,is_function:yl,listen:gt,mount_component:bt,run_all:Cl,safe_not_equal:bu,set_data:tt,space:pe,text:nt,toggle_class:an,transition_in:se,transition_out:ye}=window.__gradio__svelte__internal,{onMount:wu}=window.__gradio__svelte__internal;function Ni(n){let e,t,l,i=n[12]("dataframe.sort_ascending")+"",s,o,r,u,c,_,a=n[12]("dataframe.sort_descending")+"",f,k,L,v,M,d,g=n[12]("dataframe.clear_sort")+"",b,y,p,j;t=new ht({props:{icon:"sort-asc"}});let B=n[10]==="asc"&&n[11]!==null&&Hi(n);c=new ht({props:{icon:"sort-desc"}});let P=n[10]==="desc"&&n[11]!==null&&Oi(n);return M=new ht({props:{icon:"clear-sort"}}),{c(){e=$e("button"),dt(t.$$.fragment),l=pe(),s=nt(i),o=pe(),B&&B.c(),r=pe(),u=$e("button"),dt(c.$$.fragment),_=pe(),f=nt(a),k=pe(),P&&P.c(),L=pe(),v=$e("button"),dt(M.$$.fragment),d=pe(),b=nt(g),te(e,"role","menuitem"),te(e,"class","svelte-42thj4"),an(e,"active",n[10]==="asc"),te(u,"role","menuitem"),te(u,"class","svelte-42thj4"),an(u,"active",n[10]==="desc"),te(v,"role","menuitem"),te(v,"class","svelte-42thj4")},m(T,K){ge(T,e,K),bt(t,e,null),oe(e,l),oe(e,s),oe(e,o),B&&B.m(e,null),ge(T,r,K),ge(T,u,K),bt(c,u,null),oe(u,_),oe(u,f),oe(u,k),P&&P.m(u,null),ge(T,L,K),ge(T,v,K),bt(M,v,null),oe(v,d),oe(v,b),y=!0,p||(j=[gt(e,"click",n[23]),gt(u,"click",n[24]),gt(v,"click",function(){yl(n[9])&&n[9].apply(this,arguments)})],p=!0)},p(T,K){n=T,(!y||K&4096)&&i!==(i=n[12]("dataframe.sort_ascending")+"")&&tt(s,i),n[10]==="asc"&&n[11]!==null?B?B.p(n,K):(B=Hi(n),B.c(),B.m(e,null)):B&&(B.d(1),B=null),(!y||K&1024)&&an(e,"active",n[10]==="asc"),(!y||K&4096)&&a!==(a=n[12]("dataframe.sort_descending")+"")&&tt(f,a),n[10]==="desc"&&n[11]!==null?P?P.p(n,K):(P=Oi(n),P.c(),P.m(u,null)):P&&(P.d(1),P=null),(!y||K&1024)&&an(u,"active",n[10]==="desc"),(!y||K&4096)&&g!==(g=n[12]("dataframe.clear_sort")+"")&&tt(b,g)},i(T){y||(se(t.$$.fragment,T),se(c.$$.fragment,T),se(M.$$.fragment,T),y=!0)},o(T){ye(t.$$.fragment,T),ye(c.$$.fragment,T),ye(M.$$.fragment,T),y=!1},d(T){T&&(me(e),me(r),me(u),me(L),me(v)),mt(t),B&&B.d(),mt(c),P&&P.d(),mt(M),p=!1,Cl(j)}}}function Hi(n){let e,t;return{c(){e=$e("span"),t=nt(n[11]),te(e,"class","priority svelte-42thj4")},m(l,i){ge(l,e,i),oe(e,t)},p(l,i){i&2048&&tt(t,l[11])},d(l){l&&me(e)}}}function Oi(n){let e,t;return{c(){e=$e("span"),t=nt(n[11]),te(e,"class","priority svelte-42thj4")},m(l,i){ge(l,e,i),oe(e,t)},p(l,i){i&2048&&tt(t,l[11])},d(l){l&&me(e)}}}function Pi(n){let e,t,l,i=n[12]("dataframe.add_row_above")+"",s,o,r,u,c,_=n[12]("dataframe.add_row_below")+"",a,f,k,L,v,M;t=new ht({props:{icon:"add-row-above"}}),u=new ht({props:{icon:"add-row-below"}});let d=n[6]&&Ri(n);return{c(){e=$e("button"),dt(t.$$.fragment),l=pe(),s=nt(i),o=pe(),r=$e("button"),dt(u.$$.fragment),c=pe(),a=nt(_),f=pe(),d&&d.c(),k=Es(),te(e,"role","menuitem"),te(e,"aria-label","Add row above"),te(e,"class","svelte-42thj4"),te(r,"role","menuitem"),te(r,"aria-label","Add row below"),te(r,"class","svelte-42thj4")},m(g,b){ge(g,e,b),bt(t,e,null),oe(e,l),oe(e,s),ge(g,o,b),ge(g,r,b),bt(u,r,null),oe(r,c),oe(r,a),ge(g,f,b),d&&d.m(g,b),ge(g,k,b),L=!0,v||(M=[gt(e,"click",n[25]),gt(r,"click",n[26])],v=!0)},p(g,b){(!L||b&4096)&&i!==(i=g[12]("dataframe.add_row_above")+"")&&tt(s,i),(!L||b&4096)&&_!==(_=g[12]("dataframe.add_row_below")+"")&&tt(a,_),g[6]?d?(d.p(g,b),b&64&&se(d,1)):(d=Ri(g),d.c(),se(d,1),d.m(k.parentNode,k)
5):d&&(Ut(),ye(d,1,1,()=>{d=null}),Vt())},i(g){L||(se(t.$$.fragment,g),se(u.$$.fragment,g),se(d),L=!0)},o(g){ye(t.$$.fragment,g),ye(u.$$.fragment,g),ye(d),L=!1},d(g){g&&(me(e),me(o),me(r),me(f),me(k)),mt(t),mt(u),d&&d.d(g),v=!1,Cl(M)}}}function Ri(n){let e,t,l,i=n[12]("dataframe.delete_row")+"",s,o,r,u;return t=new ht({props:{icon:"delete-row"}}),{c(){e=$e("button"),dt(t.$$.fragment),l=pe(),s=nt(i),te(e,"role","menuitem"),te(e,"class","delete svelte-42thj4"),te(e,"aria-label","Delete row")},m(c,_){ge(c,e,_),bt(t,e,null),oe(e,l),oe(e,s),o=!0,r||(u=gt(e,"click",function(){yl(n[4])&&n[4].apply(this,arguments)}),r=!0)},p(c,_){n=c,(!o||_&4096)&&i!==(i=n[12]("dataframe.delete_row")+"")&&tt(s,i)},i(c){o||(se(t.$$.fragment,c),o=!0)},o(c){ye(t.$$.fragment,c),o=!1},d(c){c&&me(e),mt(t),r=!1,u()}}}function Fi(n){let e,t,l,i=n[12]("dataframe.add_column_left")+"",s,o,r,u,c,_=n[12]("dataframe.add_column_right")+"",a,f,k,L,v,M;t=new ht({props:{icon:"add-column-left"}}),u=new ht({props:{icon:"add-column-right"}});let d=n[7]&&Ii(n);return{c(){e=$e("button"),dt(t.$$.fragment),l=pe(),s=nt(i),o=pe(),r=$e("button"),dt(u.$$.fragment),c=pe(),a=nt(_),f=pe(),d&&d.c(),k=Es(),te(e,"role","menuitem"),te(e,"aria-label","Add column to the left"),te(e,"class","svelte-42thj4"),te(r,"role","menuitem"),te(r,"aria-label","Add column to the right"),te(r,"class","svelte-42thj4")},m(g,b){ge(g,e,b),bt(t,e,null),oe(e,l),oe(e,s),ge(g,o,b),ge(g,r,b),bt(u,r,null),oe(r,c),oe(r,a),ge(g,f,b),d&&d.m(g,b),ge(g,k,b),L=!0,v||(M=[gt(e,"click",n[27]),gt(r,"click",n[28])],v=!0)},p(g,b){(!L||b&4096)&&i!==(i=g[12]("dataframe.add_column_left")+"")&&tt(s,i),(!L||b&4096)&&_!==(_=g[12]("dataframe.add_column_right")+"")&&tt(a,_),g[7]?d?(d.p(g,b),b&128&&se(d,1)):(d=Ii(g),d.c(),se(d,1),d.m(k.parentNode,k)):d&&(Ut(),ye(d,1,1,()=>{d=null}),Vt())},i(g){L||(se(t.$$.fragment,g),se(u.$$.fragment,g),se(d),L=!0)},o(g){ye(t.$$.fragment,g),ye(u.$$.fragment,g),ye(d),L=!1},d(g){g&&(me(e),me(o),me(r),me(f),me(k)),mt(t),mt(u),d&&d.d(g),v=!1,Cl(M)}}}function Ii(n){let e,t,l,i=n[12]("dataframe.delete_column")+"",s,o,r,u;return t=new ht({props:{icon:"delete-column"}}),{c(){e=$e("button"),dt(t.$$.fragment),l=pe(),s=nt(i),te(e,"role","menuitem"),te(e,"class","delete svelte-42thj4"),te(e,"aria-label","Delete column")},m(c,_){ge(c,e,_),bt(t,e,null),oe(e,l),oe(e,s),o=!0,r||(u=gt(e,"click",function(){yl(n[5])&&n[5].apply(this,arguments)}),r=!0)},p(c,_){n=c,(!o||_&4096)&&i!==(i=n[12]("dataframe.delete_column")+"")&&tt(s,i)},i(c){o||(se(t.$$.fragment,c),o=!0)},o(c){ye(t.$$.fragment,c),o=!1},d(c){c&&me(e),mt(t),r=!1,u()}}}function ku(n){let e,t,l,i,s=n[16]&&Ni(n),o=!n[16]&&n[15]&&Pi(n),r=n[14]&&Fi(n);return{c(){e=$e("div"),s&&s.c(),t=pe(),o&&o.c(),l=pe(),r&&r.c(),te(e,"class","cell-menu svelte-42thj4"),te(e,"role","menu")},m(u,c){ge(u,e,c),s&&s.m(e,null),oe(e,t),o&&o.m(e,null),oe(e,l),r&&r.m(e,null),n[29](e),i=!0},p(u,[c]){u[16]?s?(s.p(u,c),c&65536&&se(s,1)):(s=Ni(u),s.c(),se(s,1),s.m(e,t)):s&&(Ut(),ye(s,1,1,()=>{s=null}),Vt()),!u[16]&&u[15]?o?(o.p(u,c),c&98304&&se(o,1)):(o=Pi(u),o.c(),se(o,1),o.m(e,l)):o&&(Ut(),ye(o,1,1,()=>{o=null}),Vt()),u[14]?r?(r.p(u,c),c&16384&&se(r,1)):(r=Fi(u),r.c(),se(r,1),r.m(e,null)):r&&(Ut(),ye(r,1,1,()=>{r=null}),Vt())},i(u){i||(se(s),se(o),se(r),i=!0)},o(u){ye(s),ye(o),ye(r),i=!1},d(u){u&&me(e),s&&s.d(),o&&o.d(),r&&r.d(),n[29](null)}}}function pu(n,e,t){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:L}=e,{on_delete_row:v}=e,{on_delete_col:M}=e,{can_delete_rows:d}=e,{can_delete_cols:g}=e,{on_sort:b=()=>{}}=e,{on_clear_sort:y=()=>{}}=e,{sort_direction:p=null}=e,{sort_priority:j=null}=e,{editable:B=!0}=e,{i18n:P}=e,T;wu(()=>{K()});function K(){if(!T)return;const D=window.innerWidth,fe=window.innerHeight,ce=T.getBoundingClientRect();let X=o-30,U=r-20;X+ce.width>D&&(X=o-ce.width+10),U+ce.height>fe&&(U=r-ce.height+10),t(13,T.style.left=`${X}px`,T),t(13,T.style.top=`${U}px`,T)}const H=()=>b("asc"),W=()=>b("desc"),V=()=>u(),re=()=>c(),ue=()=>_(),I=()=>a();function q(D){mu[D?"unshift":"push"](()=>{T=D,t(13,T)})}return n.$$set=D=>{"x"in D&&t(17,o=D.x),"y"in D&&t(18,r=D.y),"on_add_row_above"in D&&t(0,u=D.on_add_row_above),"on_add_row_below"in D&&t(1,c=D.on_add_row_below),"on_add_column_left"in D&&t(2,_=D.on_add_column_left),"on_add_column_right"in D&&t(3,a=D.on_add_column_right),"row"in D&&t(19,f=D.row),"col_count"in D&&t(20,k=D.col_count),"row_count"in D&&t(21,L=D.row_count),"on_delete_row"in D&&t(4,v=D.on_delete_row),"on_delete_col"in D&&t(5,M=D.on_delete_col),"can_delete_rows"in D&&t(6,d=D.can_delete_rows),"can_delete_cols"in D&&t(7,g=D.can_delete_cols),"on_sort"in D&&t(8,b=D.on_sort),"on_clear_sort"in D&&t(9,y=D.on_clear_sort),"sort_direction"in D&&t(10,p=D.sort_direction),"sort_priority"in D&&t(11,j=D.sort_priority),"editable"in D&&t(22,B=D.editable),"i18n"in D&&t(12,P=D.i18n)},n.$$.update=()=>{n.$$.dirty&524288&&t(16,l=f===-1),n.$$.dirty&6291456&&t(15,i=B&&L[1]==="dynamic"),n.$$.dirty&5242880&&t(14,s=B&&k[1]==="dynamic")},[u,c,_,a,v,M,d,g,b,y,p,j,P,T,s,i,l,o,r,f,k,L,B,H,W,V,re,ue,I,q]}
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}),we()}get y(){return this.$$.ctx[18]}set y(e){this.$$set({y:e}),we()}get on_add_row_above(){return this.$$.ctx[0]}set on_add_row_above(e){this.$$set({on_add_row_above:e}),we()}get on_add_row_below(){return this.$$.ctx[1]}set on_add_row_below(e){this.$$set({on_add_row_below:e}),we()}get on_add_column_left(){return this.$$.ctx[2]}set on_add_column_left(e){this.$$set({on_add_column_left:e}),we()}get on_add_column_right(){return this.$$.ctx[3]}set on_add_column_right(e){this.$$set({on_add_column_right:e}),we()}get row(){return this.$$.ctx[19]}set row(e){this.$$set({row:e}),we()}get col_count(){return this.$$.ctx[20]}set col_count(e){this.$$set({col_count:e}),we()}get row_count(){return this.$$.ctx[21]}set row_count(e){this.$$set({row_count:e}),we()}get on_delete_row(){return this.$$.ctx[4]}set on_delete_row(e){this.$$set({on_delete_row:e}),we()}get on_delete_col(){return this.$$.ctx[5]}set on_delete_col(e){this.$$set({on_delete_col:e}),we()}get can_delete_rows(){return this.$$.ctx[6]}set can_delete_rows(e){this.$$set({can_delete_rows:e}),we()}get can_delete_cols(){return this.$$.ctx[7]}set can_delete_cols(e){this.$$set({can_delete_cols:e}),we()}get on_sort(){return this.$$.ctx[8]}set on_sort(e){this.$$set({on_sort:e}),we()}get on_clear_sort(){return this.$$.ctx[9]}set on_clear_sort(e){this.$$set({on_clear_sort:e}),we()}get sort_direction(){return this.$$.ctx[10]}set sort_direction(e){this.$$set({sort_direction:e}),we()}get sort_priority(){return this.$$.ctx[11]}set sort_priority(e){this.$$set({sort_priority:e}),we()}get editable(){return this.$$.ctx[22]}set editable(e){this.$$set({editable:e}),we()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),we()}}const{SvelteComponent:yu,append:Wt,attr:ve,bubble:Cu,check_outros:Yt,create_component:Sn,destroy_component:qn,detach:Mn,element:Ht,flush:St,group_outros:Xt,init:Su,insert:An,is_function:qu,listen:Sl,mount_component:En,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(n){let e,t,l,i,s,o,r,u,c,_=n[0]&&n[3]==="filter"&&Vi(n);return{c(){e=Ht("div"),t=Ht("input"),o=al(),_&&_.c(),ve(t,"type","text"),t.value=l=n[0]||"",ve(t,"placeholder",i=n[3]==="filter"?"Filter...":"Search..."),ve(t,"class","search-input svelte-b1nr0g"),ve(t,"title",s=`Enter text to ${n[3]} the table`),Ji(t,"filter-mode",n[3]==="filter"),ve(e,"class","search-container svelte-b1nr0g")},m(a,f){An(a,e,f),Wt(e,t),Wt(e,o),_&&_.m(e,null),r=!0,u||(c=Sl(t,"input",n[7]),u=!0)},p(a,f){(!r||f&1&&l!==(l=a[0]||"")&&t.value!==l)&&(t.value=l),(!r||f&8&&i!==(i=a[3]==="filter"?"Filter...":"Search..."))&&ve(t,"placeholder",i),(!r||f&8&&s!==(s=`Enter text to ${a[3]} the table`))&&ve(t,"title",s),(!r||f&8)&&Ji(t,"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)):_&&(Xt(),Ne(_,1,1,()=>{_=null}),Yt())},i(a){r||(Se(_),r=!0)},o(a){Ne(_),r=!1},d(a){a&&Mn(e),_&&_.d(),u=!1,c()}}}function Vi(n){let e,t,l,i,s;return t=new ds({}),{c(){e=Ht("button"),Sn(t.$$.fragment),ve(e,"class","toolbar-button check-button svelte-b1nr0g"),ve(e,"aria-label","Apply filter and update dataframe values"),ve(e,"title","Apply filter and update dataframe values")},m(o,r){An(o,e,r),En(t,e,null),l=!0,i||(s=Sl(e,"click",function(){qu(n[5])&&n[5].apply(this,arguments)}),i=!0)},p(o,r){n=o},i(o){l||(Se(t.$$.fragment,o),l=!0)},o(o){Ne(t.$$.fragment,o),l=!1},d(o){o&&Mn(e),qn(t),i=!1,s()}}}function Ui(n){let e,t,l,i,s,o,r,u;const c=[ju,Lu],_=[];function a(f,k){return f[6]?0:1}return t=a(n),l=_[t]=c[t](n),{c(){e=Ht("button"),l.c(),ve(e,"class","toolbar-button svelte-b1nr0g"),ve(e,"aria-label",i=n[6]?"Copied to clipboard":"Copy table data"),ve(e,"title",s=n[6]?"Copied to clipboard":"Copy table data")},m(f,k){An(f,e,k),_[t].m(e,null),o=!0,r||(u=Sl(e,"click",n[8]),r=!0)},p(f,k){let L=t;t=a(f),t!==L&&(Xt(),Ne(_[L],1,1,()=>{_[L]=null}),Yt(),l=_[t],l||(l=_[t]=c[t](f),l.c()),Se(l,1),l.m(e,null)),(!o||k&64&&i!==(i=f[6]?"Copied to clipboard":"Copy table data"))&&ve(e,"aria-label",i),(!o||k&64&&s!==(s=f[6]?"Copied to clipboard":"Copy table data"))&&ve(e,"title",s)},i(f){o||(Se(l),o=!0)},o(f){Ne(l),o=!1},d(f){f&&Mn(e),_[t].d(),r=!1,u()}}}function Lu(n){let e,t;return e=new No({}),{c(){Sn(e.$$.fragment)},m(l,i){En(e,l,i),t=!0},i(l){t||(Se(e.$$.fragment,l),t=!0)},o(l){Ne(e.$$.fragment,l),t=!1},d(l){qn(e,l)}}}function ju(n){let e,t;return e=new ds({}),{c(){Sn(e.$$.fragment)},m(l,i){En(e,l,i),t=!0},i(l){t||(Se(e.$$.fragment,l),t=!0)},o(l){Ne(e.$$.fragment,l),t=!1},d(l){qn(e,l)}}}function Wi(n){let e,t;return e=new Ho({props:{fullscreen:n[4]}}),e.$on("fullscreen",n[10]),{c(){Sn(e.$$.fragment)},m(l,i){En(e,l,i),t=!0},p(l,i){const s={};i&16&&(s.fullscreen=l[4]),e.$set(s)},i(l){t||(Se(e.$$.fragment,l),t=!0)},o(l){Ne(e.$$.fragment,l),t=!1},d(l){qn(e,l)}}}function zu(n){let e,t,l,i,s,o=n[3]!=="none"&&Ki(n),r=n[2]&&Ui(n),u=n[1]&&Wi(n);return{c(){e=Ht("div"),t=Ht("div"),o&&o.c(),l=al(),r&&r.c(),i=al(),u&&u.c(),ve(t,"class","toolbar-buttons svelte-b1nr0g"),ve(e,"class","toolbar svelte-b1nr0g"),ve(e,"role","toolbar"),ve(e,"aria-label","Table actions")},m(c,_){An(c,e,_),Wt(e,t),o&&o.m(t,null),Wt(t,l),r&&r.m(t,null),Wt(t,i),u&&u.m(t,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(t,l)):o&&(Xt(),Ne(o,1,1,()=>{o=null}),Yt()),c[2]?r?(r.p(c,_),_&4&&Se(r,1)):(r=Ui(c),r.c(),Se(r,1),r.m(t,i)):r&&(Xt(),Ne(r,1,1,()=>{r=null}),Yt()),c[1]?u?(u.p(c,_),_&2&&Se(u,1)):(u=Wi(c),u.c(),Se(u,1),u.m(t,null)):u&&(Xt(),Ne(u,1,1,()=>{u=null}),Yt())},i(c){s||(Se(o),Se(r),Se(u),s=!0)},o(c){Ne(o),Ne(r),Ne(u),s=!1},d(c){c&&Mn(e),o&&o.d(),r&&r.d(),u&&u.d()}}}function Bu(n,e,t){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 L(g){k=g.target.value;const y=k||null;f!==y&&(t(0,f=y),c("search",f))}function v(){t(6,_=!0),a&&clearTimeout(a),a=setTimeout(()=>{t(6,_=!1)},2e3)}async function M(){await r(),v()}Au(()=>{a&&clearTimeout(a)});function d(g){Cu.call(this,n,g)}return n.$$set=g=>{"show_fullscreen_button"in g&&t(1,l=g.show_fullscreen_button),"show_copy_button"in g&&t(2,i=g.show_copy_button),"show_search"in g&&t(3,s=g.show_search),"fullscreen"in g&&t(4,o=g.fullscreen),"on_copy"in g&&t(9,r=g.on_copy),"on_commit_filter"in g&&t(5,u=g.on_commit_filter),"current_search_query"in g&&t(0,f=g.current_search_query)},[f,l,i,s,o,u,_,L,M,r,d]}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}),St()}get show_copy_button(){return this.$$.ctx[2]}set show_copy_button(e){this.$$set({show_copy_button:e}),St()}get show_search(){return this.$$.ctx[3]}set show_search(e){this.$$set({show_search:e}),St()}get fullscreen(){return this.$$.ctx[4]}set fullscreen(e){this.$$set({fullscreen:e}),St()}get on_copy(){return this.$$.ctx[9]}set on_copy(e){this.$$set({on_copy:e}),St()}get on_commit_filter(){return this.$$.ctx[5]}set on_commit_filter(e){this.$$set({on_commit_filter:e}),St()}get current_search_query(){return this.$$.ctx[0]}set current_search_query(e){this.$$set({current_search_query:e}),St()}}function un(n,e,t,l){let i=n||[];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 t[r]={cell:null,input:null},{id:r,value:JSON.stringify(o+1)}}):i.map((s,o)=>{const r=l();return t[r]={cell:null,input:null},{id:r,value:s??""}})}function Tu(n,e,t,l,i=null){return!n||n.length===0?[]:n.map((o,r)=>o.map((u,c)=>{const _=l();e[_]={cell:null,input:null},t[_]=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(n,e,t,l){if(!e.data||!e.data[t]||!e.data[t][l])return;const i=e.data[t][l].value;e.data[t][l].value=n,i!==n&&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([t,l])}async function Hu(n,e,t){if(!e.data||!e.headers||!e.els)return;const l=n.target;!l||l.value===void 0||await Ls(l.type==="checkbox"?String(l.checked):l.value,e,t[0],t[1])}function Ou(n,e){const t=Me(e.state),l=t.ui_state.selected_header,i=t.ui_state.header_edit,s=e.headers||[];if(l===!1||i!==!1)return!1;switch(n.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 n.preventDefault(),e.actions.set_selected_header(!1),!0;case"Enter":return n.preventDefault(),t.config.editable&&e.actions.set_header_edit(l),!0}return!1}function js(n,e){if(!e.data||!e.headers||!e.els||!e.dispatch)return!1;const t=Me(e.state);if(!t.config.editable||n.key!=="Delete"&&n.key!=="Backspace")return!1;const l=t.ui_state.editing,i=t.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||n.key==="Delete"&&r?.selectionStart!==r?.value.length||n.key==="Backspace"&&r?.selectionStart!==0)return!1}if(n.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(n,e,t,l){const i=Me(e.state),s=i.ui_state.editing,o=i.ui_state.selected_cells;if(s||!e.data)return!1;n.preventDefault();const r=e.actions.move_cursor(n,[t,l],e.data);return r?(n.shiftKey?(e.actions.set_selected_cells(e.actions.get_range_selection(o.length>0?o[0]:[t,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&&n.key==="ArrowUp"&&t===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(n,e,t,l){if(!e.data||!e.els)return!1;const i=Me(e.state);if(!i.config.editable)return!1;n.preventDefault();const s=i.ui_state.editing;if(s&&Kt(s,[t,l])){const o=e.data[t][l].id,r=e.els[o]?.input;r&&await Ls(r.value,e,t,l),e.actions.set_editing(!1)}else e.actions.set_editing([t,l]);return!0}function Fu(n,e,t,l){if(!e.data)return!1;n.preventDefault(),e.actions.set_editing(!1);const i=e.actions.get_next_cell_coordinates([t,l],e.data,n.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(n,e,t,l){const i=Me(e.state);if(!i.config.editable)return!1;const s=i.ui_state.editing;return(!s||s&&Kt(s,[t,l]))&&n.key.length===1?(e.actions.set_editing([t,l]),!0):!1}async function Ju(n,e){if(!e.data)return!1;const t=Me(e.state),l=t.ui_state.selected,i=t.ui_state.selected_cells;if(!l)return!1;if(n.key==="c"&&(n.metaKey||n.ctrlKey))return n.preventDefault(),i.length>0&&await gs(e.data,i),e.actions.set_copy_flash(!0),!0;const[s,o]=l;switch(n.key){case"ArrowRight":case"ArrowLeft":case"ArrowDown":case"ArrowUp":return Pu(n,e,s,o);case"Escape":return t.config.editable?(n.preventDefault(),e.actions.set_editing(!1),Nu().then(()=>{e.parent_element&&e.parent_element.focus()}),!0):!1;case"Enter":return await Ru(n,e,s,o);case"Tab":return Fu(n,e,s,o);case"Delete":case"Backspace":return js(n,e);default:return Iu(n,e,s,o)}}async function Ku(n,e){Ou(n,e)||js(n,e)||await Ju(n,e)}function Vu(n,e,t,l,i,s,o){const r=(_,a,f)=>{_.target instanceof HTMLAnchorElement||s&&f===-1||(_.preventDefault(),_.stopPropagation(),n.mouse_down_pos={x:_.clientX,y:_.clientY},n.drag_start=[a,f],!_.shiftKey&&!_.metaKey&&!_.ctrlKey&&(t([[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 L=ml(n.drag_start,[f,k]);t(L),l([f,k])},c=_=>{!n.is_dragging&&n.drag_start?i(_,n.drag_start[0],n.drag_start[1]):n.is_dragging&&o&&o.focus(),n.is_dragging=!1,e(!1),n.drag_start=null,n.mouse_down_pos=null};return{handle_mouse_down:r,handle_mouse_move(_){if(!n.drag_start||!n.mouse_down_pos)return;if(!(_.buttons&1)){c(_);return}
5const a=Math.abs(_.clientX-n.mouse_down_pos.x),f=Math.abs(_.clientY-n.mouse_down_pos.y);!n.is_dragging&&(a>3||f>3)&&(n.is_dragging=!0,e(!0)),n.is_dragging&&u(_)},handle_mouse_up:c}}const{SvelteComponent:Uu,add_flush_callback:Ge,append:ae,attr:ie,bind:Qe,binding_callbacks:De,bubble:Wu,check_outros:xe,component_subscribe:Yu,create_component:Je,destroy_component:Ke,detach:Ae,element:qe,empty:$t,ensure_array_like:pt,flush:x,globals:Xu,group_outros:et,init:Gu,insert:Ee,is_function:tl,listen:zt,mount_component:Ve,noop:zs,outro_and_destroy_block:wn,run_all:Qu,safe_not_equal:Zu,set_data:ql,set_style:Yi,space:Re,text:Ml,toggle_class:kt,transition_in:J,transition_out:Q,update_keyed_each:kn}=window.__gradio__svelte__internal,{Map:pn,window:$u}=Xu,{afterUpdate:xu,createEventDispatcher:ec,tick:tc,onMount:Xi}=window.__gradio__svelte__internal;function Gi(n,e,t){const l=n.slice();return l[140]=e[t].value,l[141]=e[t].id,l[144]=e,l[145]=t,l}function Qi(n,e,t){const l=n.slice();return l[140]=e[t].value,l[141]=e[t].id,l[142]=e,l[143]=t,l}function Zi(n,e,t){const l=n.slice();return l[140]=e[t].value,l[141]=e[t].id,l[146]=e,l[143]=t,l}function $i(n,e,t){const l=n.slice();return l[140]=e[t].value,l[141]=e[t].id,l[147]=e,l[145]=t,l}function xi(n){let e,t,l,i,s=n[3]&&n[3].length!==0&&n[4]&&es(n);return l=new Du({props:{show_fullscreen_button:n[18],fullscreen:n[23],on_copy:n[87],show_copy_button:n[19],show_search:n[21],on_commit_filter:n[66],current_search_query:n[33].current_search_query}}),l.$on("search",n[88]),l.$on("fullscreen",n[89]),{c(){e=qe("div"),s&&s.c(),t=Re(),Je(l.$$.fragment),ie(e,"class","header-row svelte-1vwr9xf")},m(o,r){Ee(o,e,r),s&&s.m(e,null),ae(e,t),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,t)):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||(J(l.$$.fragment,o),i=!0)},o(o){Q(l.$$.fragment,o),i=!1},d(o){o&&Ae(e),s&&s.d(),Ke(l)}}}function es(n){let e,t,l;return{c(){e=qe("div"),t=qe("p"),l=Ml(n[3]),ie(t,"class","svelte-1vwr9xf"),ie(e,"class","label svelte-1vwr9xf")},m(i,s){Ee(i,e,s),ae(e,t),ae(t,l)},p(i,s){s[0]&8&&ql(l,i[3])},d(i){i&&Ae(e)}}}function ts(n){let e,t;return{c(){e=qe("caption"),t=Ml(n[3]),ie(e,"class","sr-only svelte-1vwr9xf")},m(l,i){Ee(l,e,i),ae(e,t)},p(l,i){i[0]&8&&ql(t,l[3])},d(l){l&&Ae(e)}}}function ns(n){let e,t;return e=new vn({props:{is_header:!0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},i(l){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}}}function ls(n,e){let t,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],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:n,first:null,c(){t=$t(),Je(l.$$.fragment),this.first=t},m(_,a){Ee(_,t,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]&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||(J(l.$$.fragment,_),o=!0)},o(_){Q(l.$$.fragment,_),o=!1},d(_){_&&Ae(t),Ke(l,_)}}}function is(n){let e,t;return e=new vn({props:{index:0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},i(l){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}
5}}function ss(n,e){let t,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,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](t,o),c=()=>e[92](null,o);return{key:n,first:null,c(){t=qe("td"),l=qe("div"),Je(i.$$.fragment),s=Re(),ie(l,"class","cell-wrap svelte-1vwr9xf"),ie(t,"tabindex","-1"),ie(t,"class","svelte-1vwr9xf"),this.first=t},m(_,a){Ee(_,t,a),ae(t,l),Ve(i,l,null),ae(t,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]&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||(J(i.$$.fragment,_),r=!0)},o(_){Q(i.$$.fragment,_),r=!1},d(_){_&&Ae(t),Ke(i),c()}}}function os(n){let e,t;return{c(){e=qe("caption"),t=Ml(n[3]),ie(e,"class","sr-only svelte-1vwr9xf")},m(l,i){Ee(l,e,i),ae(e,t)},p(l,i){i[0]&8&&ql(t,l[3])},d(l){l&&Ae(e)}}}function nc(n){let e,t=n[3]&&n[3].length!==0&&os(n);return{c(){t&&t.c(),e=$t()},m(l,i){t&&t.m(l,i),Ee(l,e,i)},p(l,i){l[3]&&l[3].length!==0?t?t.p(l,i):(t=os(l),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(l){l&&Ae(e),t&&t.d(l)}}}function rs(n){let e,t;return e=new vn({props:{is_header:!0}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},i(l){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}}}function _s(n,e){let t,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],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:n,first:null,c(){t=$t(),Je(l.$$.fragment),this.first=t},m(_,a){Ee(_,t,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]&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||(J(l.$$.fragment,_),o=!0)},o(_){Q(l.$$.fragment,_),o=!1},d(_){_&&Ae(t),Ke(l,_)}}}function lc(n){let e,t,l=[],i=new pn,s,o=n[15]&&rs(),r=pt(n[25]);const u=c=>c[141];for(let c=0;c<r.length;c+=1){let _=Gi(n,r,c),a=u(_);i.set(a,l[c]=_s(a,_))}return{c(){e=qe("tr"),o&&o.c(),t=Re();for(let c=0;c<l.length;c+=1)l[c].c();ie(e,"slot","thead"),ie(e,"class","svelte-1vwr9xf")},m(c,_){Ee(c,e,_),o&&o.m(e,null),ae(e,t);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&&J(o,1):(o=rs(),o.c(),J(o,1),o.m(e,t)):o&&(et(),Q(o,1,1,()=>{o=null}),xe()),_[0]&55595681|_[1]&409993220|_[2]&2&&(r=pt(c[25]),et(),l=kn(l,_,u,1,c,r,i,e,wn,_s,null,Gi),xe())},i(c){if(!s){J(o);for(let _=0;_<r.length;_+=1)J(l[_]);s=!0}},o(c){Q(o);for(let _=0;_<l.length;_+=1)Q(l[_]);s=!1},d(c){c&&Ae(e),o&&o.d();for(let _=0;_<l.length;_+=1)l[_].d()}}}function as(n){let e,t;return e=new vn({props:{index:n[138]}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p(l,i){const s={};i[4]&16384&&(s.index=l[138]),e.$set(s)},i(l){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}
5}}function us(n,e){let t,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],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:n,first:null,c(){t=$t(),Je(l.$$.fragment),this.first=t},m(_,a){Ee(_,t,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]&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||(J(l.$$.fragment,_),o=!0)},o(_){Q(l.$$.fragment,_),o=!1},d(_){_&&Ae(t),Ke(l,_)}}}function ic(n){let e,t,l=[],i=new pn,s,o=n[15]&&as(n),r=pt(n[139]);const u=c=>c[141];for(let c=0;c<r.length;c+=1){let _=Qi(n,r,c),a=u(_);i.set(a,l[c]=us(a,_))}return{c(){e=qe("tr"),o&&o.c(),t=Re();for(let c=0;c<l.length;c+=1)l[c].c();ie(e,"slot","tbody"),ie(e,"class","svelte-1vwr9xf"),kt(e,"row-odd",n[138]%2===0)},m(c,_){Ee(c,e,_),o&&o.m(e,null),ae(e,t);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&&J(o,1)):(o=as(c),o.c(),J(o,1),o.m(e,t)):o&&(et(),Q(o,1,1,()=>{o=null}),xe()),_[0]&156260228|_[1]&21186583|_[2]&257|_[4]&49152&&(r=pt(c[139]),et(),l=kn(l,_,u,1,c,r,i,e,wn,us,null,Qi),xe()),(!s||_[4]&16384)&&kt(e,"row-odd",c[138]%2===0)},i(c){if(!s){J(o);for(let _=0;_<r.length;_+=1)J(l[_]);s=!0}},o(c){Q(o);for(let _=0;_<l.length;_+=1)Q(l[_]);s=!1},d(c){c&&Ae(e),o&&o.d();for(let _=0;_<l.length;_+=1)l[_].d()}}}function sc(n){let e,t,l,i,s,o,r,u;function c(v){n[99](v)}function _(v){n[100](v)}function a(v){n[101](v)}function f(v){n[102](v)}function k(v){n[103](v)}let L={max_height:n[13],selected:n[49],disable_scroll:n[47]!==null||n[46]!==null,$$slots:{tbody:[ic,({index:v,item:M})=>({138:v,139:M}),({index:v,item:M})=>[0,0,0,0,(v?16384:0)|(M?32768:0)]],thead:[lc],default:[nc]},$$scope:{ctx:n}};return n[35]!==void 0&&(L.items=n[35]),n[37]!==void 0&&(L.actual_height=n[37]),n[38]!==void 0&&(L.table_scrollbar_width=n[38]),n[40]!==void 0&&(L.viewport=n[40]),n[41]!==void 0&&(L.show_scroll_button=n[41]),t=new Za({props:L}),De.push(()=>Qe(t,"items",c)),De.push(()=>Qe(t,"actual_height",_)),De.push(()=>Qe(t,"table_scrollbar_width",a)),De.push(()=>Qe(t,"viewport",f)),De.push(()=>Qe(t,"show_scroll_button",k)),t.$on("scroll_top",rc),{c(){e=qe("div"),Je(t.$$.fragment),ie(e,"class","table-wrap svelte-1vwr9xf")},m(v,M){Ee(v,e,M),Ve(t,e,null),u=!0},p(v,M){const d={};M[0]&8192&&(d.max_height=v[13]),M[1]&262144&&(d.selected=v[49]),M[1]&98304&&(d.disable_scroll=v[47]!==null||v[46]!==null),M[0]&189847469|M[1]&7555095|M[4]&16826368&&(d.$$scope={dirty:M,ctx:v}),!l&&M[1]&16&&(l=!0,d.items=v[35],Ge(()=>l=!1)),!i&&M[1]&64&&(i=!0,d.actual_height=v[37],Ge(()=>i=!1)),!s&&M[1]&128&&(s=!0,d.table_scrollbar_width=v[38],Ge(()=>s=!1)),!o&&M[1]&512&&(o=!0,d.viewport=v[40],Ge(()=>o=!1)),!r&&M[1]&1024&&(r=!0,d.show_scroll_button=v[41],Ge(()=>r=!1)),t.$set(d)},i(v){u||(J(t.$$.fragment,v),u=!0)},o(v){Q(t.$$.fragment,v),u=!1},d(v){v&&Ae(e),Ke(t)}}}function cs(n){let e,t,l;return{c(){e=qe("button"),e.textContent="↑",ie(e,"class","scroll-top-button svelte-1vwr9xf")},m(i,s){Ee(i,e,s),t||(l=zt(e,"click",n[67]),t=!0)}
5,p:zs,d(i){i&&Ae(e),t=!1,l()}}}function fs(n){let e,t;return e=new za({props:{on_click:n[108]}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!0},p:zs,i(l){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}}}function hs(n){let e,t;return e=new vu({props:{x:n[47]?.x??n[46]?.x??0,y:n[47]?.y??n[46]?.y??0,row:n[46]?-1:n[47]?.row??0,col_count:n[5],row_count:n[6],on_add_row_above:n[109],on_add_row_below:n[110],on_add_column_left:n[111],on_add_column_right:n[112],on_delete_row:n[113],on_delete_col:n[114],editable:n[9],can_delete_rows:!n[46]&&n[26].length>1&&n[9],can_delete_cols:n[26].length>0&&n[26][0]?.length>1&&n[9],i18n:n[12],on_sort:n[46]?n[115]:void 0,on_clear_sort:n[46]?n[116]:void 0,sort_direction:n[46]?n[33].sort_state.sort_columns.find(n[117])?.direction??null:null,sort_priority:n[46]&&n[33].sort_state.sort_columns.findIndex(n[118])+1||null}}),{c(){Je(e.$$.fragment)},m(l,i){Ve(e,l,i),t=!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){t||(J(e.$$.fragment,l),t=!0)},o(l){Q(e.$$.fragment,l),t=!1},d(l){Ke(e,l)}}}function oc(n){let e,t,l,i,s,o,r,u,c=[],_=new pn,a,f,k,L,v=[],M=new pn,d,g,b,y,p,j,B,P,T,K,H=(n[3]&&n[3].length!==0&&n[4]||n[18]||n[19]||n[21]!=="none")&&xi(n),W=n[3]&&n[3].length!==0&&ts(n),V=n[15]&&ns(),re=pt(n[25]);const ue=w=>w[141];for(let w=0;w<re.length;w+=1){let E=$i(n,re,w),R=ue(E);_.set(R,c[w]=ls(R,E))}let I=n[15]&&is(),q=pt(n[50]);const D=w=>w[141];for(let w=0;w<q.length;w+=1){let E=Zi(n,q,w),R=D(E);M.set(R,v[w]=ss(R,E))}function fe(w){n[104](w)}let ce={upload:n[16],stream_handler:n[17],flex:!1,center:!1,boundedheight:!1,disable_click:!0,root:n[11],aria_label:n[12]("dataframe.drop_to_upload"),$$slots:{default:[sc]},$$scope:{ctx:n}};n[36]!==void 0&&(ce.dragging=n[36]),g=new Bo({props:ce}),De.push(()=>Qe(g,"dragging",fe)),g.$on("load",n[105]);let X=n[41]&&cs(n),U=n[26].length===0&&n[9]&&n[6][1]==="dynamic"&&fs(n),z=(n[47]||n[46])&&hs(n);return{c(){e=qe("div"),H&&H.c(),t=Re(),l=qe("div"),i=qe("table"),W&&W.c(),s=Re(),o=qe("thead"),r=qe("tr"),V&&V.c(),u=Re();for(let w=0;w<c.length;w+=1)c[w].c();a=Re(),f=qe("tbody"),k=qe("tr"),I&&I.c(),L=Re();for(let w=0;w<v.length;w+=1)v[w].c();d=Re(),Je(g.$$.fragment),y=Re(),X&&X.c(),p=Re(),U&&U.c(),j=Re(),z&&z.c(),B=$t(),ie(r,"class","svelte-1vwr9xf"),ie(o,"class","svelte-1vwr9xf"),ie(k,"class","svelte-1vwr9xf"),ie(f,"class","svelte-1vwr9xf"),ie(i,"aria-hidden","true"),ie(i,"class","svelte-1vwr9xf"),ie(l,"class","table-wrap svelte-1vwr9xf"),Yi(l,"height",n[37]+"px"),ie(l,"role","grid"),ie(l,"tabindex","0"),kt(l,"dragging",n[42]),kt(l,"no-wrap",!n[10]),kt(l,"menu-open",n[47]||n[46]),ie(e,"class","table-container svelte-1vwr9xf")},m(w,E){Ee(w,e,E),H&&H.m(e,null),ae(e,t),ae(e,l),ae(l,i),W&&W.m(i,null),ae(i,s),ae(i,o),ae(o,r),V&&V.m(r,null),ae(r,u);for(let R=0;R<c.length;R+=1)c[R]&&c[R].m(r,null);ae(i,a),ae(i,f),ae(f,k),I&&I.m(k,null),ae(k,L);for(let R=0;R<v.length;R+=1)v[R]&&v[R].m(k,null);n[93](i),ae(l,d),Ve(g,l,null),ae(l,y),X&&X.m(l,null),n[106](l),Ee(w,p,E),U&&U.m(w,E),Ee(w,j,E),z&&z.m(w,E),Ee(w,B,E),P=!0,T||(K=[zt($u,"resize",n[86]),zt(l,"keydown",n[107]),zt(l,"mousemove",function(){tl(n[44])&&n[44].apply(this,arguments)}),zt(l,"mouseup",function(){tl(n[43])&&n[43].apply(this,arguments)}),zt(l,"mouseleave",function(){tl(n[43])&&n[43].apply(this,arguments)})],T=!0)},p(w,E){n=w,n[3]&&n[3].length!==0&&n[4]||n[18]||n[19]||n[21]!=="none"?H?(H.p(n,E),E[0]&2883608&&J(H,1
5)):(H=xi(n),H.c(),J(H,1),H.m(e,t)):H&&(et(),Q(H,1,1,()=>{H=null}),xe()),n[3]&&n[3].length!==0?W?W.p(n,E):(W=ts(n),W.c(),W.m(i,s)):W&&(W.d(1),W=null),n[15]?V?E[0]&32768&&J(V,1):(V=ns(),V.c(),J(V,1),V.m(r,u)):V&&(et(),Q(V,1,1,()=>{V=null}),xe()),E[0]&55595681|E[1]&409993220|E[2]&2&&(re=pt(n[25]),et(),c=kn(c,E,ue,1,n,re,_,r,wn,ls,null,$i),xe()),n[15]?I?E[0]&32768&&J(I,1):(I=is(),I.c(),J(I,1),I.m(k,L)):I&&(et(),Q(I,1,1,()=>{I=null}),xe()),E[0]&268456580|E[1]&17303809|E[2]&1&&(q=pt(n[50]),et(),v=kn(v,E,D,1,n,q,M,k,wn,ss,null,Zi),xe());const R={};E[0]&65536&&(R.upload=n[16]),E[0]&131072&&(R.stream_handler=n[17]),E[0]&2048&&(R.root=n[11]),E[0]&4096&&(R.aria_label=n[12]("dataframe.drop_to_upload")),E[0]&189855661|E[1]&7851735|E[4]&16777216&&(R.$$scope={dirty:E,ctx:n}),!b&&E[1]&32&&(b=!0,R.dragging=n[36],Ge(()=>b=!1)),g.$set(R),n[41]?X?X.p(n,E):(X=cs(n),X.c(),X.m(l,null)):X&&(X.d(1),X=null),(!P||E[1]&64)&&Yi(l,"height",n[37]+"px"),(!P||E[1]&2048)&&kt(l,"dragging",n[42]),(!P||E[0]&1024)&&kt(l,"no-wrap",!n[10]),(!P||E[1]&98304)&&kt(l,"menu-open",n[47]||n[46]),n[26].length===0&&n[9]&&n[6][1]==="dynamic"?U?(U.p(n,E),E[0]&67109440&&J(U,1)):(U=fs(n),U.c(),J(U,1),U.m(j.parentNode,j)):U&&(et(),Q(U,1,1,()=>{U=null}),xe()),n[47]||n[46]?z?(z.p(n,E),E[1]&98304&&J(z,1)):(z=hs(n),z.c(),J(z,1),z.m(B.parentNode,B)):z&&(et(),Q(z,1,1,()=>{z=null}),xe())}
5,i(w){if(!P){J(H),J(V);for(let E=0;E<re.length;E+=1)J(c[E]);J(I);for(let E=0;E<q.length;E+=1)J(v[E]);J(g.$$.fragment,w),J(U),J(z),P=!0}},o(w){Q(H),Q(V);for(let E=0;E<c.length;E+=1)Q(c[E]);Q(I);for(let E=0;E<v.length;E+=1)Q(v[E]);Q(g.$$.fragment,w),Q(U),Q(z),P=!1},d(w){w&&(Ae(e),Ae(p),Ae(j),Ae(B)),H&&H.d(),W&&W.d(),V&&V.d();for(let E=0;E<c.length;E+=1)c[E].d();I&&I.d();for(let E=0;E<v.length;E+=1)v[E].d();n[93](null),Ke(g),X&&X.d(),n[106](null),U&&U.d(w),z&&z.d(w),T=!1,Qu(K)}}}function qt(){return Math.random().toString(36).substring(2,15)}function Al(n){return`var(--cell-width-${n})`}const rc=n=>{};function _c(n,e,t){let l,i,s,o,r,u,c,_,a,f,k,L,v,M,d,{datatype:g}=e,{label:b=null}=e,{show_label:y=!0}=e,{headers:p=[]}=e,{values:j=[]}=e,{col_count:B}=e,{row_count:P}=e,{latex_delimiters:T}=e,{components:K={}}=e,{editable:H=!0}=e,{wrap:W=!1}=e,{root:V}=e,{i18n:re}=e,{max_height:ue=500}=e,{line_breaks:I=!0}=e,{column_widths:q=[]}=e,{show_row_numbers:D=!1}=e,{upload:fe}=e,{stream_handler:ce}=e,{show_fullscreen_button:X=!1}=e,{show_copy_button:U=!1}=e,{value_is_output:z=!1}=e,{max_chars:w=void 0}=e,{show_search:E="none"}=e,{pinned_columns:R=0}=e,{static_columns:Be=[]}=e,{fullscreen:Ue=!1}=e;const C=lr({show_fullscreen_button:X,show_copy_button:U,show_search:E,show_row_numbers:D,editable:H,pinned_columns:R,show_label:y,line_breaks:I,wrap:W,max_height:ue,column_widths:q,max_chars:w}),{state:S,actions:F}=C;Yu(n,S,h=>t(33,d=h)),Xi(()=>{t(34,C.parent_element=ne,C),t(34,C.get_data_at=Ns,C),t(34,C.get_column=Hs,C),t(34,C.get_row=Os,C),t(34,C.dispatch=vt,C),Pl();const h=new IntersectionObserver(N=>{N.forEach(ee=>{ee.isIntersecting&&!Bl&&t(82,yt=!1),Bl=ee.isIntersecting})});h.observe(ne),document.addEventListener("click",zl),window.addEventListener("resize",Hl);const A=N=>{(Rt||Vn)&&M(N)};return document.addEventListener("mouseup",A),()=>{h.disconnect(),document.removeEventListener("click",zl),window.removeEventListener("resize",Hl),document.removeEventListener("mouseup",A)}});const vt=ec();let G={},Ln={},Ce=un(p,B,G,qt),Ot=p,O=[[]],He,We=[[]],jn=!1,El,Lt=[];Xi(()=>{El=getComputedStyle(document.documentElement).getPropertyValue("--color-accent").trim()+"40",document.documentElement.style.setProperty("--color-accent-copied",El)});const Ns=(h,A)=>O?.[h]?.[A]?.value,Hs=h=>O?.map(A=>A[h]?.value)??[],Os=h=>O?.[h]?.map(A=>A.value)??[];let{display_value:rt=null}=e,{styling:_t=null}=e,zn=Ce.map(h=>h.value),Bn=O.map(h=>h.map(A=>String(A.value)));function Ll(h,A){F.handle_sort(h,A),Rn(O,rt,_t)}function jl(){F.reset_sort_state()}async function Ps(h,A=!1){!H||o===h||B[1]!=="dynamic"||F.set_header_edit(h)}function Rs(h,A){h.target instanceof HTMLAnchorElement||(h.preventDefault(),h.stopPropagation(),H&&(F.set_editing(!1),F.handle_header_click(A,H),ne.focus()))}function Fs(h){H&&(F.end_header_edit(h.detail.key),ne.focus())}async function Dn(h){if(ne.focus(),P[1]!=="dynamic")return;const A=Array(O[0]?.length||p.length).fill(0).map((N,ee)=>{const le=qt();return t(24,G[le]={cell:null,input:null},G),{id:le,value:""}});O.length===0?t(26,O=[A]):h!==void 0&&h>=0&&h<=O.length?O.splice(h,0,A):O.push(A),t(85,i=[h!==void 0?h:O.length-1,0])}async function Is(h){if(ne.focus(),B[1]!=="dynamic")return;const A=F.add_col(O,p,qt,h);A.data.forEach(N=>{N.forEach(ee=>{G[ee.id]||t(24,G[ee.id]={cell:null,input:null},G)})}),t(26,O=A.data),t(0,p=A.headers),await tc(),requestAnimationFrame(()=>{Ps(h!==void 0?h:O[0].length-1,!0);const N=ne.querySelectorAll("tbody")[1].offsetWidth;ne.querySelectorAll("table")[1].scrollTo({left:N})})}function zl(h){xo(h,ne)&&(F.clear_ui_state(),t(52,o=!1),t(51,r=!1))}let Tn,yt=!1,lt=[],ne,xt,Nn=0,Hn=0;function Pt(){const h=O[0]?.length||0;if(Nn===O.length&&Hn===h&&d.sort_state.sort_columns.length>0)return;Nn=O.length,Hn=h;const A=lt.map(N=>N?.clientWidth||0);if(A.length!==0){D&&ne.style.setProperty("--cell-width-row-number",`${A[0]}px`);for(let N=0;N<50;N++)if(!q[N])ne.style.removeProperty(`--cell-width-${N}`);else if(q[N].endsWith("%")){const ee=parseFloat(q[N]),le=Math.floor(ee/100*ne.clientWidth);ne.style.setProperty(`--cell-width-${N}`,`${le}px`)}else ne.style.setProperty(`--cell-width-${N}`,q[N]);A.forEach((N,ee)=>{if(!q[ee]){const le=`${Math.max(N,45)}px`;ne.style.setProperty(`--cell-width-${ee}`,le)}})}}let On=j.slice(0,ue/j.length*37).length*37+37,Pn=0;function Rn(h,A,N){const ee=Fo(h,A,N,d.sort_state.sort_columns,i,$o);
5t(26,O=ee.data),t(85,i=ee.selected)}let Bl=!1;const Js=h=>{F.set_copy_flash(h)};let Fn=[];function Ks(h){const{blur_event:A,coords:N}=h.detail;Hu(A,C,N)}function Vs(h,A){if(h.stopPropagation(),c&&c.col===A)F.set_active_header_menu(null);else{const N=h.target.closest("th");if(N){const ee=N.getBoundingClientRect();F.set_active_header_menu({col:A,x:ee.right,y:ee.bottom})}}}xu(()=>{t(71,z=!1)});function Dl(h){if(B[1]!=="dynamic"||O[0].length<=1)return;const A=F.delete_col_at(O,p,h);t(26,O=A.data),t(0,p=A.headers),t(25,Ce=un(p,B,G,qt)),F.set_active_cell_menu(null),F.set_active_header_menu(null),F.set_selected(!1),F.set_selected_cells([]),F.set_editing(!1)}function Tl(h){t(26,O=F.delete_row_at(O,h)),F.set_active_cell_menu(null),F.set_active_header_menu(null)}let Nl;function Us(){if(d.current_search_query&&E==="filter"){const h=[],A=[],N=[];We.forEach(le=>{const nn=[],Rl=[],Fl=[];le.forEach(It=>{nn.push(It.value),Rl.push(It.display_value!==void 0?It.display_value:String(It.value)),Fl.push(It.styling||"")}),h.push(nn),A.push(Rl),N.push(Fl)});const ee={data:h,headers:Ce.map(le=>le.value),metadata:{display_value:A,styling:N}};vt("change",ee),z||vt("input"),F.handle_search(null)}}let en,In=!1;function Ws(){en.scrollTo({top:0})}function Hl(){F.set_active_cell_menu(null),F.set_active_header_menu(null),t(31,l=[]),t(85,i=!1),t(48,s=!1),t(82,yt=!1),Pt()}function Jn(h,A){const N=A==="above"?h:h+1;Dn(N),t(47,u=null),t(46,c=null)}function Kn(h,A){const N=A==="left"?h:h+1;Is(N),t(47,u=null),t(46,c=null)}function Ys(){F.reset_sort_state()}let Rt=!1,Vn=null,Ol=null;const tn={is_dragging:Rt,drag_start:Vn,mouse_down_pos:Ol};let Ft;function Pl(){t(84,Ft=Vu(tn,h=>t(42,Rt=h),h=>F.set_selected_cells(h),h=>F.set_selected(h),(h,A,N)=>F.handle_cell_click(h,A,N),D,ne))}function Xs(h,A){return d.current_search_query!==void 0&&We?.[h]?.[A]?We[h][A].display_value!==void 0?We[h][A].display_value:String(We[h][A].value):O?.[h]?.[A]?O[h][A].display_value!==void 0?O[h][A].display_value:String(O[h][A].value):""}const Gs=()=>Pt(),Qs=async()=>await gs(O,null),Zs=h=>F.handle_search(h.detail);function $s(h){Wu.call(this,n,h)}function xs(h,A){n.$$.not_equal(Ce[A].value,h)&&(Ce[A].value=h,t(25,Ce),t(0,p),t(77,Ot),t(5,B),t(24,G))}function eo(h,A){n.$$.not_equal(G[A].input,h)&&(G[A].input=h,t(24,G))}function to(h,A){De[h?"unshift":"push"](()=>{lt[A]=h,t(28,lt)})}function no(h){De[h?"unshift":"push"](()=>{xt=h,t(30,xt)})}const lo=(h,A,N)=>L(h,A,N);function io(h,A,N){n.$$.not_equal(We[A][N].value,h)&&(We[A][N].value=h,t(35,We),t(33,d),t(26,O),t(27,Lt),t(75,_t),t(1,j),t(78,He),t(29,ne),t(24,G),t(126,Ln),t(74,rt),t(28,lt))}function so(h,A){n.$$.not_equal(G[A],h)&&(G[A]=h,t(24,G))}function oo(h,A){n.$$.not_equal(Ce[A].value,h)&&(Ce[A].value=h,t(25,Ce),t(0,p),t(77,Ot),t(5,B),t(24,G))}function ro(h,A){n.$$.not_equal(G[A].input,h)&&(G[A].input=h,t(24,G))}function _o(h){We=h,t(35,We),t(33,d),t(26,O),t(27,Lt),t(75,_t),t(1,j),t(78,He),t(29,ne),t(24,G),t(126,Ln),t(74,rt),t(28,lt)}function ao(h){On=h,t(37,On)}function uo(h){Pn=h,t(38,Pn)}function co(h){en=h,t(40,en)}function fo(h){In=h,t(41,In)}function ho(h){jn=h,t(36,jn)}const mo=({detail:h})=>Vo(h.data,A=>(t(25,Ce=un(A.map(N=>N??""),B,G,qt)),Ce),A=>{t(1,j=A)});function go(h){De[h?"unshift":"push"](()=>{ne=h,t(29,ne)})}const bo=h=>Ku(h,C),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),F.set_active_header_menu(null))},Mo=()=>{jl(),F.set_active_header_menu(null)},Ao=h=>h.col===(c?.col??-1),Eo=h=>h.col===(c?.col??-1);return n.$$set=h=>{"datatype"in h&&t(2,g=h.datatype),"label"in h&&t(3,b=h.label),"show_label"in h&&t(4,y=h.show_label),"headers"in h&&t(0,p=h.headers),"values"in h&&t(1,j=h.values),"col_count"in h&&t(5,B=h.col_count),"row_count"in h&&t(6,P=h.row_count),"latex_delimiters"in h&&t(7,T=h.latex_delimiters),"components"in h&&t(8,K=h.components),"editable"in h&&t(9,H=h.editable),"wrap"in h&&t(10,W=h.wrap),"root"in h&&t(11,V=h.root),"i18n"in h&&t(12,re=h.i18n),"max_height"in h&&t(13,ue=h.max_height),"line_breaks"in h&&t(14,I=h.line_breaks),"column_widths"in h&&t(72,q=h.column_widths),"show_row_numbers"in h&&t(15,D=h.show_row_numbers),"upload"in h&&t(16,fe=h.upload),"stream_handler"in h&&t(17,ce=h.stream_handler),"show_fullscreen_button"in h&&t(18,X=h.show_fullscreen_button),"show_copy_button"in h&&t(19,U=h.show_copy_button),"value_is_output"in h&&t(71,z=h.value_is_output),"max_chars"in h&&t(20,w=h.max_chars),"show_search"in h&&t(21,E=h.show_search),"pinned_columns"in h&&t(73,R=h.pinned_columns),"static_columns"in h&&t(22,Be
5=h.static_columns),"fullscreen"in h&&t(23,Ue=h.fullscreen),"display_value"in h&&t(74,rt=h.display_value),"styling"in h&&t(75,_t=h.styling)},n.$$.update=()=>{if(n.$$.dirty[1]&4&&t(31,l=d.ui_state.selected_cells),n.$$.dirty[1]&4&&t(85,i=d.ui_state.selected),n.$$.dirty[1]&4&&t(48,s=d.ui_state.editing),n.$$.dirty[1]&4&&t(52,o=d.ui_state.header_edit),n.$$.dirty[1]&4&&t(51,r=d.ui_state.selected_header),n.$$.dirty[1]&4&&t(47,u=d.ui_state.active_cell_menu),n.$$.dirty[1]&4&&t(46,c=d.ui_state.active_header_menu),n.$$.dirty[1]&4&&t(32,_=d.ui_state.copy_flash),n.$$.dirty[0]&889192450|n.$$.dirty[1]&4|n.$$.dirty[2]&77824&&!Kt(j,He)){if(ne){const N=j.length===0||j.length===1&&j[0].length===0,ee=He!==void 0&&(j.length!==He.length||j[0]&&He[0]&&j[0].length!==He[0].length);if(N||ee){for(let le=0;le<50;le++)ne.style.removeProperty(`--cell-width-${le}`);Nn=0,Hn=0,t(82,yt=!1)}}const h=j.length===0||j.length===1&&j[0].length===0,A=He!==void 0&&(j.length!==He.length||j[0]&&He[0]&&j[0].length!==He[0].length);t(26,O=Tu(j,G,Ln,qt,rt)),t(78,He=JSON.parse(JSON.stringify(j))),h||A?F.reset_sort_state():d.sort_state.sort_columns.length>0?Rn(O,rt,_t):(F.handle_sort(-1,"asc"),F.reset_sort_state()),d.current_search_query&&F.handle_search(null),ne&&lt.length>0&&(h||A)&&t(82,yt=!1)}if(n.$$.dirty[0]&67108864|n.$$.dirty[2]&2048&&t(53,a=R&&O?.[0]?.length?Math.min(R,O[0].length):0),n.$$.dirty[0]&16777249|n.$$.dirty[2]&32768&&(Kt(p,Ot)||(t(25,Ce=un(p,B,G,qt)),t(77,Ot=JSON.parse(JSON.stringify(p))))),n.$$.dirty[0]&117440512|n.$$.dirty[2]&12288&&(O||Ce||G)&&(t(34,C.data=O,C),t(34,C.headers=Ce,C),t(34,C.els=G,C),t(34,C.display_value=rt,C),t(34,C.styling=_t,C)),n.$$.dirty[0]&201326592|n.$$.dirty[1]&4|n.$$.dirty[2]&8192)if(d.current_search_query!==void 0){const h=new Map;t(27,Lt=[]),O.forEach((N,ee)=>{N.some(le=>String(le?.value).toLowerCase().includes(d.current_search_query?.toLowerCase()||""))&&Lt.push(ee),N.forEach((le,nn)=>{h.set(le.id,{value:le.value,display_value:le.display_value!==void 0?le.display_value:String(le.value),styling:_t?.[ee]?.[nn]||""})})});const A=F.filter_data(O);t(35,We=A.map(N=>N.map(ee=>{const le=h.get(ee.id);return{...ee,display_value:le?.display_value!==void 0?le.display_value:String(ee.value),styling:le?.styling||""}})))}else t(27,Lt=[]);if(n.$$.dirty[0]&100663296|n.$$.dirty[2]&393728&&(O||Ce)&&(F.trigger_change(O,Ce,Bn,zn,z,vt),t(80,Bn=O.map(h=>h.map(A=>String(A.value)))),t(79,zn=Ce.map(h=>h.value))),n.$$.dirty[0]&67108864|n.$$.dirty[1]&4|n.$$.dirty[2]&12288&&d.sort_state.sort_columns.length>0&&(Rn(O,rt,_t),F.update_row_order(O)),n.$$.dirty[0]&67108864&&t(50,f=Io(O)),n.$$.dirty[0]&268435456|n.$$.dirty[2]&524288&&lt[0]&&lt[0]?.clientWidth&&(clearTimeout(Tn),t(81,Tn=setTimeout(()=>Pt(),100))),n.$$.dirty[0]&268435456|n.$$.dirty[2]&1048576&&lt[0]&&!yt&&(Pt(),t(82,yt=!0)),n.$$.dirty[2]&8388608&&t(49,k=!!i&&i[0]),n.$$.dirty[1]&3|n.$$.dirty[2]&2097152&&(_&&!Kt(l,Fn)&&Js(!1),t(83,Fn=l)),n.$$.dirty[2]&8388608&&i!==!1&&t(39,Nl=i),n.$$.dirty[0]&1694498816|n.$$.dirty[2]&8388608&&i!==!1){const h=er(i,O,G,ne,xt);document.documentElement.style.setProperty("--selected-col-pos",h.col_pos),document.documentElement.style.setProperty("--selected-row-pos",h.row_pos||"0px")}n.$$.dirty[0]&536870912&&ne&&Pl(),n.$$.dirty[2]&4194304&&t(45,L=Ft?.handle_mouse_down||(()=>{})),n.$$.dirty[2]&4194304&&t(44,v=Ft?.handle_mouse_move||(()=>{})),n.$$.dirty[2]&4194304&&t(43,M=Ft?.handle_mouse_up||(()=>{}))},t(42,Rt=tn.is_dragging),Vn=tn.drag_start,Ol=tn.mouse_down_pos,[p,j,g,b,y,B,P,T,K,H,W,V,re,ue,I,D,fe,ce,X,U,w,E,Be,Ue,G,Ce,O,Lt,lt,ne,xt,l,_,d,C,We,jn,On,Pn,Nl,en,In,Rt,M,v,L,c,u,s,k,f,r,o,a,S,F,Ll,jl,Rs,Fs,Dn,Pt,Ks,Vs,Dl,Tl,Us,Ws,Jn,Kn,Xs,z,q,R,rt,_t,Ys,Ot,He,zn,Bn,Tn,yt,Fn,Ft,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}),x()}get label(){return this.$$.ctx[3]}set label(e){this.$$set({label:e}),x()}get show_label(){return this.$$.ctx[4]}set show_label(e){this.$$set({show_label:e}),x()}get headers(){return this.$$.ctx[0]}set headers(e){this.$$set({headers:e}),x()}get values(){return this.$$.ctx[1]}set values(e){this.$$set({values:e}),x()}get col_count(){return this.$$.ctx[5]}set col_count(e){this.$$set({col_count:e}),x()}get row_count(){return this.$$.ctx[6]}set row_count(e){this.$$set({row_count:e}),x()}get latex_delimiters(){return this.$$.ctx[7]}set latex_delimiters(e){this.$$set({latex_delimiters:e}),x()}get components(){return this.$$.ctx[8]}set components(e){this.$$set({components:e}),x()}get editable(){return this.$$.ctx[9]}set editable(e){this.$$set({editable:e}),x()}get wrap(){return this.$$.ctx[10]}set wrap(e){this.$$set({wrap:e}),x()}get root(){return this.$$.ctx[11]}set root(e){this.$$set({root:e}),x()}get i18n(){return this.$$.ctx[12]}set i18n(e){this.$$set({i18n:e}),x()}get max_height(){return this.$$.ctx[13]}set max_height(e){this.$$set({max_height:e}),x()}get line_breaks(){return this.$$.ctx[14]}set line_breaks(e){this.$$set({line_breaks:e}),x()}get column_widths(){return this.$$.ctx[72]}set column_widths(e){this.$$set({column_widths:e}),x()}get show_row_numbers(){return this.$$.ctx[15]}set show_row_numbers(e){this.$$set({show_row_numbers:e}),x()}get upload(){return this.$$.ctx[16]}set upload(e){this.$$set({upload:e}),x()}get stream_handler(){return this.$$.ctx[17]}set stream_handler(e){this.$$set({stream_handler:e}),x()}get show_fullscreen_button(){return this.$$.ctx[18]}set show_fullscreen_button(e){this.$$set({show_fullscreen_button:e}),x()}get show_copy_button(){return this.$$.ctx[19]}set show_copy_button(e){this.$$set({show_copy_button:e}),x()}get value_is_output(){return this.$$.ctx[71]}set value_is_output(e){this.$$set({value_is_output:e}),x()}get max_chars(){return this.$$.ctx[20]}set max_chars(e){this.$$set({max_chars:e}),x()}get show_search(){return this.$$.ctx[21]}set show_search(e){this.$$set({show_search:e}),x()}get pinned_columns(){return this.$$.ctx[73]}set pinned_columns(e){this.$$set({pinned_columns:e}),x()}get static_columns(){return this.$$.ctx[22]}set static_columns(e){this.$$set({static_columns:e}),x()}get fullscreen(){return this.$$.ctx[23]}set fullscreen(e){this.$$set({fullscreen:e}),x()}get display_value(){return this.$$.ctx[74]}set display_value(e){this.$$set({display_value:e}),x()}get styling(){return this.$$.ctx[75]}set styling(e){this.$$set({styling:e}),x()}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(n){let e,t,l,i,s;const o=[{autoscroll:n[17].autoscroll},{i18n:n[17].i18n},n[20]];let r={};for(let _=0;_<o.length;_+=1)r=fc(r,o[_]);e=new Oo({props:r}),e.$on("clear_status",n[33]);function u(_){n[36](_)}let c={root:n[14],label:n[8],show_label:n[9],row_count:n[7],col_count:n[6],values:n[0].data,display_value:n[30],styling:n[29],headers:n[31],fullscreen:n[2],wrap:n[10],datatype:n[11],latex_delimiters:n[18],editable:n[21],max_height:n[19],i18n:n[17].i18n,line_breaks:n[15],column_widths:n[16],upload:n[34],stream_handler:n[35],show_fullscreen_button:n[22],max_chars:n[23],show_copy_button:n[24],show_row_numbers:n[25],show_search:n[26],pinned_columns:n[27],components:{image:Po},static_columns:n[28]};return n[1]!==void 0&&(c.value_is_output=n[1]),l=new uc({props:c}),Ts.push(()=>Ds(l,"value_is_output",u)),l.$on("change",n[37]),l.$on("input",n[38]),l.$on("select",n[39]),l.$on("fullscreen",n[40]),{c(){ul(e.$$.fragment),t=kc(),ul(l.$$.fragment)}
5,m(_,a){fl(e,_,a),bc(_,t,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(t),cl(e,_),cl(l,_)}}}function vc(n){let e,t,l;function i(o){n[41](o)}let s={visible:n[5],padding:!1,elem_id:n[3],elem_classes:n[4],container:!1,scale:n[12],min_width:n[13],overflow_behavior:"visible",$$slots:{default:[pc]},$$scope:{ctx:n}};return n[2]!==void 0&&(s.fullscreen=n[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}),!t&&r[0]&4&&(t=!0,u.fullscreen=o[2],Bs(()=>t=!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(n,e,t){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:L=null}=e,{show_label:v=!0}=e,{wrap:M}=e,{datatype:d}=e,{scale:g=null}=e,{min_width:b=void 0}=e,{root:y}=e,{line_breaks:p=!0}=e,{column_widths:j=[]}=e,{gradio:B}=e,{latex_delimiters:P}=e,{max_height:T=void 0}=e,{loading_status:K}=e,{interactive:H}=e,{show_fullscreen_button:W=!1}=e,{max_chars:V=void 0}=e,{show_copy_button:re=!1}=e,{show_row_numbers:ue=!1}=e,{show_search:I="none"}=e,{pinned_columns:q=0}=e,{static_columns:D=[]}=e,{fullscreen:fe=!1}=e;const ce=()=>B.dispatch("clear_status",K),X=(...C)=>B.client.upload(...C),U=(...C)=>B.client.stream(...C);function z(C){a=C,t(1,a)}const w=C=>{t(0,_.data=C.detail.data,_),t(0,_.headers=C.detail.headers,_),B.dispatch("change")},E=C=>B.dispatch("input"),R=C=>B.dispatch("select",C.detail),Be=({detail:C})=>{t(2,fe=C)};function Ue(C){fe=C,t(2,fe)}return n.$$set=C=>{"headers"in C&&t(32,o=C.headers),"elem_id"in C&&t(3,r=C.elem_id),"elem_classes"in C&&t(4,u=C.elem_classes),"visible"in C&&t(5,c=C.visible),"value"in C&&t(0,_=C.value),"value_is_output"in C&&t(1,a=C.value_is_output),"col_count"in C&&t(6,f=C.col_count),"row_count"in C&&t(7,k=C.row_count),"label"in C&&t(8,L=C.label),"show_label"in C&&t(9,v=C.show_label),"wrap"in C&&t(10,M=C.wrap),"datatype"in C&&t(11,d=C.datatype),"scale"in C&&t(12,g=C.scale),"min_width"in C&&t(13,b=C.min_width),"root"in C&&t(14,y=C.root),"line_breaks"in C&&t(15,p=C.line_breaks),"column_widths"in C&&t(16,j=C.column_widths),"gradio"in C&&t(17,B=C.gradio),"latex_delimiters"in C&&t(18,P=C.latex_delimiters),"max_height"in C&&t(19,T=C.max_height),"loading_status"in C&&t(20,K=C.loading_status),"interactive"in C&&t(21,H=C.interactive),"show_fullscreen_button"in C&&t(22,W=C.show_fullscreen_button),"max_chars"in C&&t(23,V=C.max_chars),"show_copy_button"in C&&t(24,re=C.show_copy_button),"show_row_numbers"in C&&t(25,ue=C.show_row_numbers),"show_search"in C&&t(26,I=C.show_search),"pinned_columns"in C&&t(27,q=C.pinned_columns),"static_columns"in C&&t(28,D=C.static_columns),"fullscreen"in C&&t(2,fe=C.fullscreen)},n.$$.update=()=>{n.$$.dirty[0]&1|n.$$.dirty[1]&2&&t(31,l=[..._.headers||o]),n.$$.dirty[0]&1&&t(30,i=_?.metadata?.display_value?[..._?.metadata?.display_value]:null),n.$$.dirty[0]&2097153&&t(29,s=!H&&_?.metadata?.styling?[..._?.metadata?.styling]:null)},[_,a,fe,r,u,c,f,k,L,v,M,d,g,b,y,p,j,B,P,T,K,H,W,V,re,ue,I,q,D,s,i,l,o,ce,X,U,z,w,E,R,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-xVIt7Xy1.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.