UNPKG

@finos/perspective-viewer-datagrid

Version:

Perspective datagrid plugin based on `regular-table`

1 lines 66.1 kB
import"regular-table";var E=Symbol("Plugin Symbol");function Je(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}function X(e,t,r){let s=Array.from(e.children[0].children[0].children),o=s.length,l=t.hasAttribute("settings");if(o<=1?s[0]?.removeAttribute("id"):s.forEach((i,n)=>{let a=l?1:0,c=n===o-(a+1)?"psp-column-titles":n===o-a?"psp-column-edit-buttons":null;c?i.setAttribute("id",c):i.removeAttribute("id")}),t.classList.toggle("psp-menu-open",!!r),l&&o>=2){let i=Array.from(s[o-2].children),n=Array.from(s[o-1].children);if(i&&n){s.slice(0,o-2).forEach(a=>{Array.from(a.children).forEach(c=>{c.classList.toggle("psp-menu-open",!1)})});for(let a=0;a<i.length;a++){let c=i[a],d=n[a],p=c.textContent===r;if(c.classList.toggle("psp-menu-open",p),d.classList.toggle("psp-menu-open",p),this._config.columns.length>1)for(let g of e.querySelectorAll("td")){let _=e.getMeta(g),u=_.column_header[_.column_header.length-2]===r;g.classList.toggle("psp-menu-open",u)}}}}}function le(e,t){let r=Array.from(e.children[0].children[0].children);if(r.length>0){X.call(this,e,t,this._column_settings_selected_column);let[s]=r.splice(this._config.split_by.length,1);s&&se.call(this,e,s,!1);let[o]=r.splice(this._config.split_by.length,1);o&&se.call(this,e,o,!0)}}function se(e,t,r){let s=e._view_cache.config.row_pivots.length-1;for(let o of t.children){let l=e.getMeta(o),i=l.column_header?.[this._config.split_by.length],n=this._config.sort.find(m=>m[0]===i),a=l.row_header_x===s,c=typeof l.x>"u";a=a||(l.x+1)%this._config.columns.length===0,o.classList.toggle("psp-header-border",a),o.classList.toggle("psp-header-group",!1),o.classList.toggle("psp-header-leaf",!0),o.classList.toggle("psp-is-top",!1),o.classList.toggle("psp-header-corner",c),o.classList.toggle("psp-header-sort-asc",!r&&!!n&&n[1]==="asc"),o.classList.toggle("psp-header-sort-desc",!r&&!!n&&n[1]==="desc"),o.classList.toggle("psp-header-sort-col-asc",!r&&!!n&&n[1]==="col asc"),o.classList.toggle("psp-header-sort-col-desc",!r&&!!n&&n[1]==="col desc"),o.classList.toggle("psp-header-sort-abs-asc",!r&&!!n&&n[1]==="asc abs"),o.classList.toggle("psp-header-sort-abs-desc",!r&&!!n&&n[1]==="desc abs"),o.classList.toggle("psp-header-sort-abs-col-asc",!r&&!!n&&n[1]==="col asc abs"),o.classList.toggle("psp-header-sort-abs-col-desc",!r&&!!n&&n[1]==="col desc abs");let d=Je.call(this,l),p=d==="integer"||d==="float",g=d==="string",_=d==="date",u=d==="datetime";o.classList.toggle("psp-align-right",p),o.classList.toggle("psp-align-left",!p),o.classList.toggle("psp-menu-enabled",(g||p||_||u)&&!c&&l.column_header_y==this._config.split_by.length+1),o.classList.toggle("psp-sort-enabled",(g||p||_||u)&&!c&&l.column_header_y===this._config.split_by.length),o.classList.toggle("psp-is-width-override",e._column_sizes?.override[l.size_key]!==void 0)}}function ie(e){let t=e._view_cache.config.row_pivots.length-1,r=Array.from(e.children[0].children[0].children),s=[],o=new Set,l=e.children[0];for(let i=0;i<r.length;i++){let n=l.rows[i],a=new Set;for(let c=0;c<n.cells.length;c++){let d=n.cells[c];d.style.backgroundColor="";let p=e.getMeta(d),g=t>0&&p.row_header_x===t||p.x>=0;d.classList.toggle("psp-align-right",!1),d.classList.toggle("psp-align-left",!1),d.classList.toggle("psp-header-group",!0),d.classList.toggle("psp-header-leaf",!1),d.classList.toggle("psp-header-border",g),d.classList.toggle("psp-header-group-corner",typeof p.x>"u"),d.classList.toggle("psp-color-mode-bar",!1),d.classList.toggle("psp-header-sort-asc",!1),d.classList.toggle("psp-header-sort-desc",!1),d.classList.toggle("psp-header-sort-col-asc",!1),d.classList.toggle("psp-header-sort-col-desc",!1),d.classList.toggle("psp-sort-enabled",!1);let _=n.cells[c],u=c,m,f;for(;s[i]&&s[i][u];++u);for(a.add(u),m=u;m<u+_.colSpan;++m)for(f=i;f<i+_.rowSpan;++f)s[f]||(s[f]=[]),s[f][m]=!0;_.classList.toggle("psp-is-top",i===0||!o.has(m))}o=a}}function ne(e,t,[,,,,,r,s],[,,,,,o,l],i){let n=this._ids?.[e.dy]?.join("|"),a=(i?e.column_header.slice(0,-1):e.column_header).join("|");if(this.last_reverse_columns?.has(a)&&this.last_reverse_ids?.has(n)){let c=this.last_reverse_ids?.get(n),d=this.last_reverse_columns.get(a);this._is_old_viewport?this.last_meta?.[d]?.[c]>e.user?(t.style.setProperty("--pulse--background-color-start",o),t.style.setProperty("--pulse--background-color-end",l),t.style.animationName==="pulse_neg"?t.style.animation="pulse_neg2 0.5s linear":t.style.animation="pulse_neg 0.5s linear"):this.last_meta?.[d]?.[c]<e.user?(t.style.setProperty("--pulse--background-color-start",r),t.style.setProperty("--pulse--background-color-end",s),t.style.animationName==="pulse_pos"?t.style.animation="pulse_pos2 0.5s linear":t.style.animation="pulse_pos 0.5s linear"):c!==e.dy&&(t.style.animation=""):t.style.animation=""}else t.style.animation=""}import ae from"chroma-js";function Q(e,t){return ae.mix(e,`rgb(${t[0]},${t[1]},${t[2]})`,.5).hex()}function A([e,t,r,s],o=[255,255,255]){function l(i,n){return((1-s)*(o[i]/255)+s*(n/255))*255}return[l(0,e),l(1,t),l(2,r)]}function T([e,t,r]){return Math.sqrt(e*e*.299+t*t*.587+r*r*.114)>130?"#161616":"#ffffff"}function Ke(e){let[t,r,s]=e.rgb(),[o,l,i]=e.set("hsl.h",(e.get("hsl.h")-15)%360).rgb(),[n,a,c]=e.set("hsl.h",(e.get("hsl.h")+15)%360).rgb();return`linear-gradient(to right top,rgb(${o},${l},${i}),rgb(${t},${r},${s}) 50%,rgb(${n},${a},${c}))`}function O(e){let t=ae(e),r=Ke(t),s=t.rgb();return[e,...s,r,`rgba(${s[0]},${s[1]},${s[2]},1)`,`rgba(${s[0]},${s[1]},${s[2]},0)`]}function ce(e,t,r,s){let o=r.user>0,l=r.user<0,i;e?.pos_bg_color!==void 0?i=e.pos_bg_color:i=this._pos_bg_color;let n;e?.neg_bg_color!==void 0?n=e.neg_bg_color:n=this._neg_bg_color;let a=o?i:l?n:["",...this._plugin_background,""];{let[u,m,f,y,w]=a;if(t.style.position="",r._is_hidden_by_aggregate_depth)t.style.animation="",t.style.backgroundColor="";else if(e?.number_bg_mode==="color")t.style.animation="",t.style.backgroundColor=u;else if(e?.number_bg_mode==="gradient"){let k=Math.max(0,Math.min(1,Math.abs(r.user/e.bg_gradient))),L=this._plugin_background,R=T(A([m,f,y,k],L));t.style.animation="",t.style.color=R,t.style.backgroundColor=`rgba(${m},${f},${y},${k})`}else e?.number_bg_mode==="pulse"?(ne.call(this,r,t,i,n,s),t.style.backgroundColor=""):(e?.number_bg_mode==="disabled"||e?.number_bg_mode,t.style.animation="",t.style.backgroundColor="")}let[c,d,p,g,_]=e?.pos_fg_color!==void 0?o?e.pos_fg_color:l?e.neg_fg_color:["",...this._plugin_background,""]:o?this._pos_fg_color:l?this._neg_fg_color:["",...this._plugin_background,""];if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.number_fg_mode==="disabled")if(e?.number_bg_mode==="color"){let u=this._plugin_background,m=T(A([a[1],a[2],a[3],1],u));t.style.color=m}else e?.number_bg_mode==="gradient"||(t.style.color="");else e?.number_fg_mode==="bar"?(t.style.color="",t.style.position="relative",_!==""&&t.children.length>0&&t.children[0].nodeType===Node.ELEMENT_NODE&&(t.children[0].style.background=_)):(e?.number_fg_mode==="color"||!e?.number_fg_mode)&&(t.style.color=c)}import de from"chroma-js";function pe(e,t,r){let s=r.column_header?.[this._config.split_by.length],[o,l,i,n,a]=e?.color!==void 0?e.color:this._color;if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.string_color_mode==="foreground"&&r.user!==null)t.style.color=o,t.style.backgroundColor="",e?.format==="link"&&(t.children[0].style.color=o);else if(e?.string_color_mode==="background"&&r.user!==null){let c=this._plugin_background,d=T(A([l,i,n,1],c));t.style.color=d,t.style.backgroundColor=o}else if(e?.string_color_mode==="series"&&r.user!==null){this._series_color_map.has(s)||(this._series_color_map.set(s,new Map),this._series_color_seed.set(s,0));let c=this._series_color_map.get(s);if(!c.has(r.user)){let R=this._series_color_seed.get(s);c.set(r.user,R),this._series_color_seed.set(s,R+1)}let d=c.get(r.user),[p,g,_]=de(o).hsl();p=p+d*150%360;let u=de(p,g,_,"hsl"),[m,f,y]=u.rgb(),w=u.hex(),k=this._plugin_background,L=T(A([m,f,y,1],k));t.style.color=L,t.style.backgroundColor=w}else t.style.backgroundColor="",t.style.color=""}import"chroma-js";function _e(e,t,r){let s=r.column_header?.[this._config.split_by.length],[o,l,i,n,a]=e?.color!==void 0?e.color:this._color;if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else if(e?.datetime_color_mode==="foreground"&&r.user!==null)t.style.color=o,t.style.backgroundColor="";else if(e?.datetime_color_mode==="background"&&r.user!==null){let c=this._plugin_background,d=T(A([l,i,n,1],c));t.style.color=d,t.style.backgroundColor=o}else t.style.backgroundColor="",t.style.color=""}function he(e,t,r){if(r._is_hidden_by_aggregate_depth)t.style.backgroundColor="",t.style.color="";else{let[s]=r.user===!0?this._pos_fg_color:r.user===!1?this._neg_fg_color:["",0,0,0,""];t.style.backgroundColor="",t.style.color=s}}function ue(e,t,r){let s=typeof r.value!=null&&typeof r.value!=null&&r.value?.toString()?.trim().length>0,o=r.row_header_x>=this._config.group_by.length,l=e.getMeta({dx:0,dy:r.y-r.y0+1}),i=l&&l.row_header&&typeof l.row_header[r.row_header_x+1]<"u";t.classList.toggle("psp-tree-label",s&&!o),t.classList.toggle("psp-tree-label-expand",s&&!o&&!i),t.classList.toggle("psp-tree-label-collapse",s&&!o&&i),t.classList.toggle("psp-tree-leaf",s&&o)}function Ze(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}function ge(e,t){let r=e[E]||{},s=t.hasAttribute("settings");for(let o of e.children[0].children[1].children)for(let l of o.children){let i=e.getMeta(l),n=i.column_header?.[this._config.split_by.length],a=Ze.call(this,i),c=r[n],d=a==="integer"||a==="float";i._is_hidden_by_aggregate_depth=(g=>g===0?!1:g-1<Math.min(this._config.group_by.length,c?.aggregate_depth))(i.row_header?.filter(g=>g!==void 0)?.length),d?ce.call(this,c,l,i,s):a==="boolean"?he.call(this,c,l,i):a==="string"?pe.call(this,c,l,i):a==="date"||a==="datetime"?_e.call(this,c,l,i):(l.style.backgroundColor="",l.style.color=""),l.classList.toggle("psp-bool-type",a==="boolean"&&i.user!==null);let p=l.tagName==="TH";p&&ue.call(this,e,l,i),o.dataset.y=i.y,i.row_header_x===void 0||i.row_header_x===i.row_header.length-1||i.row_header[i.row_header_x+1]===void 0?(l.dataset.y=i.y,l.dataset.x=i.x):(delete l.dataset.y,delete l.dataset.x),l.classList.toggle("psp-null",i.value===null),l.classList.toggle("psp-align-right",!p&&d),l.classList.toggle("psp-align-left",p||!d),l.classList.toggle("psp-color-mode-bar",c?.number_fg_mode==="bar"&&d)}}async function me(e,t,r,s){let l=e.getMeta(s).column_header[this._config.split_by.length],i=r.ctrlKey||r.metaKet||r.altKey?Xe:Qe,n=r.shiftKey,a=i.call(this,l,n);await t.restore({sort:a})}function Xe(e,t){let r=[],s=!1;for(let o of this._config.sort){let[l,i]=o;if(l===e){s=!0;let n=be.call(this,e,i,t);n&&r.push(n)}else r.push(o)}return s||r.push([e,t?"desc abs":"desc"]),r}function Qe(e,t){for(let[r,s]of this._config.sort)if(r===e){let o=be.call(this,e,s,t);return o?[o]:[]}return[[e,t?"desc abs":"desc"]]}function be(e,t,r){let o=this._config.split_by.length>0?tt:et,l=t?o[t]:"desc";if(l)return[e,l]}var et={desc:"asc",asc:void 0,"desc abs":"asc abs","asc abs":void 0},tt={desc:"asc",asc:"col desc","desc abs":"asc abs","asc abs":"col desc abs","col desc":"col asc","col asc":void 0,"col desc abs":"col asc abs","col asc abs":void 0};async function fe(e,t){let r=e.getMeta(t.target),s=t.target.classList.contains("psp-tree-label-collapse");t.shiftKey&&s?this._view.set_depth(r.row_header.filter(o=>o!==void 0).length-2):t.shiftKey?this._view.set_depth(r.row_header.filter(o=>o!==void 0).length-1):s?this._view.collapse(r.y):this._view.expand(r.y),this._num_rows=await this._view.num_rows(),this._num_columns=await this._view.num_columns(),e.draw()}async function ye(e,t,r){if(r.which!==1)return;let s=r.target;if(s.tagName!=="A"){for(;s.tagName!=="TD"&&s.tagName!=="TH";)if(s=s.parentElement,!e.contains(s))return;if(s.classList.contains("psp-tree-label")){fe.call(this,e,r);return}if(s.classList.contains("psp-menu-enabled")){let l=e.getMeta(s).column_header?.[this._config.split_by.length];await t.toggleColumnSettings(l)}else s.classList.contains("psp-sort-enabled")&&me.call(this,e,t,r,s)}}function xe(e,t){if(t.which!==1)return;let r=t.target;for(;r.tagName!=="TD"&&r.tagName!=="TH";)if(r=r.parentElement,!e.contains(r))return;(r.classList.contains("psp-tree-label")&&t.offsetX<26||r.classList.contains("psp-header-leaf")&&!r.classList.contains("psp-header-corner"))&&t.stopImmediatePropagation()}function ve(e,t=!1){let r=this._config.group_by.length===0&&this._config.split_by.length===0,s=e.hasAttribute("selectable"),o=t||e.querySelector("perspective-viewer-datagrid").dataset.editMode==="EDIT";return r&&!s&&o}function we(e,t,r){let s=e[E]||{},o=ve.call(this,t);r.classList.toggle("edit-mode-allowed",ve.call(this,t,!0));for(let l of e.querySelectorAll("td")){let i=e.getMeta(l),n=this.get_psp_type(i);if(o&&this._is_editable[i.x]){let a=i.column_header[this._config.split_by.length];n==="string"&&s[a]?.format==="link"?(l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",!1)):n==="boolean"?(l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",i.user!==null)):(o!==l.hasAttribute("contenteditable")&&l.toggleAttribute("contenteditable",o),l.classList.toggle("boolean-editable",!1))}else l.toggleAttribute("contenteditable",!1),l.classList.toggle("boolean-editable",!1)}}var G=(e,t,r)=>{let s=e.querySelectorAll("td"),o=r.get(e),l=e.getRootNode();if(o){for(let i of s){let n=e.getMeta(i);if(n.x===o.x&&n.y===o.y)return l.activeElement!==i&&i.focus({preventScroll:!0}),!0}document.activeElement!==document.body&&e.contains(l.activeElement)&&l.activeElement.blur()}};function ee(e,t,r){let s=e.getMeta(r),o=t._schema[t._column_paths[s.x]];if(s){let l=r.textContent,i=t._ids[s.y-s.y0][0];if(o==="float"||o==="integer"){if(l=parseFloat(l.replace(/,/g,"")),isNaN(l))return!1}else if(o==="date"||o==="datetime"){if(l=Date.parse(l),isNaN(l))return!1}else o==="boolean"&&(l=l==="true"?!1:l==="false"?!0:null);let n={__INDEX__:i,[t._column_paths[s.x]]:l};return t._table.update([n],{port_id:t._edit_port}),!0}}function ke(e,t,r){let s=e.getMeta(r.target);if(typeof s?.x<"u"){let o=this._is_editable[s.x],l=this.get_psp_type(s)==="boolean",i=r.target.classList.contains("psp-null");o&&l&&!i&&ee(e,this,r.target)}}function rt(e){let t;return async function(...r){if(t&&await t&&t)return;let s;t=new Promise(o=>s=o),await e.apply(this,r),t=void 0,s()}}function Ee(){if(this.isContentEditable){let e=this.getRootNode().getSelection().getRangeAt(0),t=e.cloneRange();return t.selectNodeContents(this),t.setEnd(e.endContainer,e.endOffset),t.toString().length}else return this.target.selectionStart}var D=rt(async function(e,t,r,s,o){let l=e.getMeta(r),i=this._column_paths.length,n=this._num_rows,a=t.get(e);if(!a)return;l.x+s<i&&0<=l.x+s&&(a.x=l.x+s),l.y+o<n&&0<=l.y+o&&(a.y=l.y+o);let c=Math.max(l.x0-10,0),d=Math.min(l.x0+10,i),p=Math.max(l.y0-5,0),g=Math.min(l.y0+10,n),_=l.x0+s,u=l.y0+o;for(;!G(e,void 0,t)&&_>=c&&_<d&&u>=p&&u<g;)await e.scrollToCell(_,u,i,n),t.set(e,a),_+=s,u+=o});function st(e,t,r){return t.getMeta(r).y===e._num_rows-1}function Le(e,t,r,s){let o=e.getRootNode().activeElement;switch(s.target.classList.remove("psp-error"),s.key){case"Enter":s.preventDefault(),st(this,e,o)?(o.blur(),r.delete(e)):s.shiftKey?D.call(this,e,r,o,0,-1):D.call(this,e,r,o,0,1);break;case"ArrowLeft":Ee.call(o)==0&&(s.preventDefault(),D.call(this,e,r,o,-1,0));break;case"ArrowUp":s.preventDefault(),D.call(this,e,r,o,0,-1);break;case"ArrowRight":Ee.call(o)==o.textContent.length&&(s.preventDefault(),D.call(this,e,r,o,1,0));break;case"ArrowDown":s.preventDefault(),D.call(this,e,r,o,0,1);break;default:}}function H(e,t=!1){let r=this._config.group_by.length===0&&this._config.split_by.length===0,s=e.hasAttribute("selectable"),o=t||e.children[0]._edit_mode==="EDIT";return r&&!s&&o}function Se(e,t,r,s){if(this._edit_mode==="EDIT"){if(!H.call(this,t))return;Le.call(this,e,t,r,s)}else console.debug(`Mode ${this._edit_mode} for "keydown" event not yet implemented`)}function Oe(e,t,r){if(this._edit_mode==="EDIT"){if(!H.call(this,t))return;ke.call(this,e,t,r)}else this._edit_mode==="READ_ONLY"||this._edit_mode==="SELECT_COLUMN"||this._edit_mode==="SELECT_ROW"||this._edit_mode==="SELECT_REGION"||console.debug(`Mode ${this._edit_mode} for "click" event not yet implemented`)}function Ce(e,t,r,s){if(H.call(this,t)&&r.has(e)){s.target.classList.remove("psp-error");let o=r.get(e);r.delete(e),o.content!==s.target.textContent&&(ee(e,this,s.target)||(s.target.textContent=o.content,s.target.classList.add("psp-error"),s.target.focus()))}}function Re(e,t,r,s){let o=e.getMeta(s.target);if(o){let l={x:o.x,y:o.y,content:s.target.textContent};r.set(e,l)}}async function I({_view:e,_config:t},r,s){let o=t.group_by,l=t.split_by,i=r>=0?r:0,n=i+1,a=await e.to_json({start_row:i,end_row:n}),d=a.map(y=>y.__ROW_PATH__)[0]||[],p=o.map((y,w)=>{let k=d[w];return k?[y,"==",k]:void 0}).filter(y=>y),g=o.length>0?s+1:s,_=Object.keys(a[0])[g],u={row:a[0]},m=[];if(_){let y=_.split("|");u.column_names=[y[l.length]],m=l.map((w,k)=>{let L=y[k];return L?[w,"==",L]:void 0}).filter(w=>w).filter(([,,w])=>w!=="__ROW_PATH__")}let f=t.filter.concat(p).concat(m);return u.config={filter:f},u}async function Me(e,t,r,s){let o=e.getMeta(s.target);if(!t.hasAttribute("selectable")||s.handled||s.which!==1||!o)return;let l=this._ids?.[o.y-o.y0];if(o&&o.y>=0){let i=r.get(e),n=!!i&&i.reduce((_,u,m)=>_&&u===l[m],!0),a=!!i&&l.length===i.length&&n,c={selected:!a},{row:d,column_names:p,config:g}=await I(this,o.y,o.x);a?(r.delete(e),c={...c,row:d,config:{filter:structuredClone(this._config.filter)}}):(r.set(e,l),c={...c,row:d,column_names:p,config:g}),await e.draw({preserve_width:!0}),s.handled=!0,t.dispatchEvent(new CustomEvent("perspective-select",{bubbles:!0,composed:!0,detail:c}))}}function Ne(e,t,r){if(!t.hasAttribute("selectable"))return;let s=r.has(e),o=r.get(e);for(let l of e.querySelectorAll("td"))if(!s)l.classList.toggle("psp-row-selected",!1),l.classList.toggle("psp-row-subselected",!1);else{let i=e.getMeta(l),n=this._ids[i.y-i.y0],a=o.reduce((c,d,p)=>c&&d===n[p],!0);l.classList.toggle("psp-row-selected",n.length===o.length&&a),l.classList.toggle("psp-row-subselected",n.length!==o.length&&a)}for(let l of e.querySelectorAll("tbody th")){let i=e.getMeta(l),n=this._ids[i.y-i.y0];if(!s||n[i.row_header_x])l.classList.toggle("psp-row-selected",!1),l.classList.toggle("psp-row-subselected",!1);else{let a=o.reduce((c,d,p)=>c&&d===n[p],!0);l.classList.toggle("psp-row-selected",n.length===o.length&&a),l.classList.toggle("psp-row-subselected",n.length!==o.length&&a)}}}async function Ae(e,t,r){r.delete(e);for(let s of e.querySelectorAll("td,th"))s.classList.toggle("psp-row-selected",!1),s.classList.toggle("psp-row-subselected",!1)}import nt from"chroma-js";var Te={datetime:Intl.DateTimeFormat,date:Intl.DateTimeFormat,integer:Intl.NumberFormat,float:Intl.NumberFormat,boolean:class{format(e){return e?"true":"false"}}},it={types:{float:{format:{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}},datetime:{format:{dateStyle:"short",timeStyle:"medium"}},date:{format:{dateStyle:"short"}}}},F=class{constructor(){this._formatters=new Map}create_datetime_formatter(t,r){let s={dateStyle:"short",timeStyle:"medium"};if(r.date_format?.format!=="custom"){let o={...s,timeZone:r.date_format?.timeZone,dateStyle:r.date_format?.dateStyle,timeStyle:r.date_format?.timeStyle};return o.dateStyle==="disabled"?o.dateStyle=void 0:o.dateStyle===void 0&&(o.dateStyle="short"),o.timeStyle==="disabled"?o.timeStyle=void 0:o.timeStyle===void 0&&(o.timeStyle="medium"),new Intl.DateTimeFormat(navigator.languages,o)}else{let o={timeZone:r.date_format?.timeZone,second:r.date_format?.second,minute:r.date_format?.minute,hour:r.date_format?.hour,day:r.date_format?.day,weekday:r.date_format?.weekday,month:r.date_format?.month,year:r.date_format?.year,hour12:r.date_format?.hour12,fractionalSecondDigits:r.date_format?.fractionalSecondDigits};return o.year==="disabled"?o.year=void 0:o.year===void 0&&(o.year="2-digit"),o.month==="disabled"?o.month=void 0:o.month===void 0&&(o.month="numeric"),o.day==="disabled"?o.day=void 0:o.day===void 0&&(o.day="numeric"),o.weekday==="disabled"&&(o.weekday=void 0),o.hour==="disabled"?o.hour=void 0:o.hour===void 0&&(o.hour="numeric"),o.minute==="disabled"?o.minute=void 0:o.minute===void 0&&(o.minute="numeric"),o.second==="disabled"?o.second=void 0:o.second===void 0&&(o.second="numeric"),o.hour12===void 0&&(o.hour12=!0),new Intl.DateTimeFormat(navigator.languages,o)}}create_date_formatter(t,r){let s={dateStyle:r.date_format?.dateStyle,timeZone:"utc"};return s.dateStyle==="disabled"?s.dateStyle=void 0:s.dateStyle===void 0&&(s.dateStyle="short"),new Intl.DateTimeFormat(navigator.languages,s)}create_number_formatter(t,r){let s=it.types[t]?.format;return r.number_format!==void 0&&(s=r.number_format),new Te[t](navigator.languages,s)}create_boolean_formatter(t,r){return new Te[t](navigator.languages,{})}get(t,r){let s=[t,...Object.values(r.date_format??{}),...Object.values(r.number_format??{})].join("-");return this._formatters.has(s)||(t==="date"?this._formatters.set(s,this.create_date_formatter(t,r)):t==="datetime"?this._formatters.set(s,this.create_datetime_formatter(t,r)):t==="integer"||t==="float"?this._formatters.set(s,this.create_number_formatter(t,r)):t==="boolean"?this._formatters.set(s,this.create_boolean_formatter(t,r)):this._formatters.set(s,!1)),this._formatters.get(s)}};var ze=new F,De=1;function Ie(e,t){return ze.get(e,t)}function U(e,t,r={},s=!1){if(t===null)return null;let o=s&&this._table_schema[e]||this._schema[e]||"string",l=r[e]||{};if((o==="integer"||o==="float")&&l?.number_fg_mode==="bar"){let n=Math.max(0,Math.min(De,Math.abs(t/l.fg_gradient)*De)),a=this._div_factory.get(),c=t>=0?"left":"right",d=(n*100).toFixed(2);return a.setAttribute("style",`width:calc(${d}% - 4px);position:absolute;${c}:2px;height:80%;top:10%;pointer-events:none;`),a}else if(l?.format==="link"&&o==="string"){let n=document.createElement("a");return n.setAttribute("href",t),n.setAttribute("target","_blank"),n.textContent=t,n}else if(l?.format==="bold"&&o==="string"){let n=document.createElement("b");return n.textContent=t,n}else if(l?.format==="italics"&&o==="string"){let n=document.createElement("i");return n.textContent=t,n}else{let n=ze.get(o,l);return n?n.format(t):t}}function*Ue(e=[],t,r){let s=r[E];for(let o of e){o=["TOTAL",...o];let l=o[o.length-1];o=o.slice(0,o.length-1).fill("");let i=U.call(this,t[o.length-1],l,s,!0);i instanceof HTMLElement?o=o.concat(i):o=o.concat({toString:()=>i}),o.length=t.length+1,yield o}}function*Pe(e=[],t,r){let s=r[E];for(let o of e){let l=[""];for(let i in o)l.push(U.call(this,t[i],o[i],s,!0));yield o}}function We(e){let t,r,s,o,l;return async function(n,a,c,d,p){let g={},_;if(d-a>0&&p-c>0){if(this._is_old_viewport=this._last_window?.start_row===c&&this._last_window?.end_row===p&&this._last_window?.start_col===a&&this._last_window?.end_col===d,_={start_row:c,start_col:a,end_row:p,end_col:d,id:!0},this._config.split_by?.length>0){let[v,h]=await Promise.all([this._view.to_columns_string(_),this._view.column_paths(_)]);g=JSON.parse(v);let b=h.filter(S=>S!=="__ROW_PATH__"&&S!=="__ID__"),M=this._column_paths.length;if(this._column_paths.splice(_.start_col,b.length,...b),this._column_paths.length!==M){let[S,N]=await Promise.all([this._view.schema(),this._view.expression_schema()]);this._schema={...S,...N};for(let C=0;C<b.length;C++){let x=b[C].split("|")[this._config.split_by.length];this._column_types[C+_.start_col]=this._schema[x]}}}else g=JSON.parse(await this._view.to_columns_string(_));this._last_window=_,this._ids=g.__ID__||Array(p-c).fill().map((v,h)=>[h+c]),this._reverse_columns=this._column_paths.slice(a,d).reduce((v,h,b)=>(v.set(h,b),v),new Map),this._reverse_ids=this._ids?.reduce((v,h,b)=>(v.set(h?.join("|"),b),v),new Map)}else this._div_factory.clear();let u=[],m=[],f=[],y=[],w=e.hasAttribute("settings");for(let v=a;v<Math.min(d,this._column_paths.length);++v){let h=this._column_paths[v],b=h.split("|"),M=g[h]||new Array(p-c).fill(null),S=Math.min(n[E]?.[b[this._config.split_by.length]]?.aggregate_depth||0,this._config.group_by.length);u.push(M.map((N,C)=>g?.__ROW_PATH__?.[C]?.length<S?"":U.call(this,b[this._config.split_by.length],N,n[E]))),m.push(M),w&&b.push(""),f.push(b),y.push(h)}d-a>0&&p-c>0&&(this.last_column_paths=r,this.last_meta=t,this.last_ids=s,this.last_reverse_ids=o,this.last_reverse_columns=l,r=y,t=m,s=this._ids,o=this._reverse_ids,l=this._reverse_columns);let k=g.__ROW_PATH__!==void 0,L=Array.from((k?Ue:Pe).call(this,g.__ROW_PATH__,this._config.group_by,n)),R=L[0]?.length;return{num_column_headers:f[0]?.length||1,num_row_headers:R,num_rows:this._num_rows,num_columns:this._column_paths.length,row_headers:L,column_headers:f,data:u,metadata:m,column_header_merge_depth:Math.max(0,this._config.split_by.length)}}}function j(e,t,r){let s=window.getComputedStyle(e).getPropertyValue(t).trim();return s.length>0?s:r}var te=class{constructor(t){this._name=t,this._elements=[],this._index=0}clear(){this._index=0}get(){this._elements[this._index]||(this._elements[this._index]=document.createElement(this._name));let t=this._elements[this._index];return this._index+=1,t}};function at(e){return e.x>=0?this._column_types[e.x]:this._row_header_types[e.row_header_x-1]}async function oe(e,t,r,s={}){let o=await r.get_config();if(this?.model?._config){let h=this.model._config,b=h.group_by.length!==o.group_by.length,M=(h.group_by.length===0||o.group_by.length===0)&&b;if(!b)for(let x in h.group_by)b||=o.group_by[x]!==h.group_by[x];let S=h.split_by.length!==o.split_by.length;if(S)for(let x in h.split_by)S||=o.split_by[x]!==h.split_by[x];let N=h.columns.length!==o.columns.length;if(N)for(let x in h.columns)N||=o.columns[x]!==h.columns[x];let C=h.filter.length!==o.filter.length;if(C)for(let x in h.filter)for(let z in o.filter[x])C||=o.filter[x][z]!==h.filter[x][z];let $=h.sort.length!==o.sort.length;if($)for(let x in h.sort)for(let z in o.sort[x])$||=o.sort[x][z]!==h.sort[x][z];this._reset_scroll_top=b,this._reset_scroll_left=S,this._reset_select=b||S||C||$||N,this._reset_column_size=S||b||N||M}let[l,i,n,a,c,d]=await Promise.all([t.schema(),r.num_rows(),r.schema(),r.expression_schema(),r.column_paths(),this.parentElement.getEditPort()]),p=nt(j(e,"--plugin--background","#FFFFFF")).rgb(),g=O(j(e,"--rt-pos-cell--color","#338DCD")),_=O(j(e,"--rt-neg-cell--color","#FF5942")),u=O(Q(g[0],p)),m=O(Q(_[0],p)),f=O(j(e,"--active--color","#ff0000")),y={...n,...a},w={...l,...a},k=c.filter(h=>h!=="__ROW_PATH__"&&h!=="__ID__"),L=[],R=[];for(let h of k){let M=h.split("|")[o.split_by.length];R.push(y[M]),L.push(!!l[M])}let Z=this._edit_mode||"READ_ONLY";this._edit_button.dataset.editMode=Z;let v=Object.assign(s,{_edit_port:d,_view:r,_table:t,_table_schema:w,_config:o,_num_rows:i,_schema:y,_ids:[],_plugin_background:p,_color:f,_pos_fg_color:g,_neg_fg_color:_,_pos_bg_color:u,_neg_bg_color:m,_column_paths:k,_column_types:R,_is_editable:L,_edit_mode:Z,_selection_state:{selected_areas:[],dirty:!1},_row_header_types:o.group_by.map(h=>w[h]),_series_color_map:new Map,_series_color_seed:new Map,get_psp_type:at});return v._div_factory=v._div_factory||new te("div"),e.setDataListener(We(this.parentElement).bind(v,e),{virtual_mode:window.getComputedStyle(e).getPropertyValue("--datagrid-virtual-mode")?.trim()||"both"}),v}async function $e(e,t,r){let s=e.getMeta(r.target);if(!s)return;let{x:o,y:l}=s,{row:i,column_names:n,config:a}=await I(this,l,o);t.dispatchEvent(new CustomEvent("perspective-click",{bubbles:!0,composed:!0,detail:{row:i,column_names:n,config:a}}))}var ct="mouse-selected-area",Ge=(e,t,{className:r=ct,selected:s=[]}={})=>(e.model._selection_state={selected_areas:s,dirty:!0},t.addEventListener("mousedown",dt(e,t,r)),t.addEventListener("mouseover",pt(e,t,r)),t.addEventListener("mouseup",_t(e,t,r)),t.addStyleListener(()=>P(e,t,r)),t),dt=(e,t,r)=>s=>{if(s.button===0&&(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN")){e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={};let o=t.getMeta(s.target);if(o&&o.x!==void 0&&o.y!==void 0){e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={x:o.x,y:o.y},e.model._selection_state.old_selected_areas=e.model._selection_state.selected_areas,e.model._selection_state.selected_areas=[];let l={x0:o.x,x1:o.x,y0:o.y,y1:o.y};e.model._selection_state.potential_selection=l,P(e,t,r,e.model._selection_state.selected_areas.concat([l]));return}}e.model._selection_state.selected_areas=[]},pt=(e,t,r)=>s=>{if((e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN")&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x!==void 0){let o=t.getMeta(s.target);if(o&&o.x!==void 0&&o.y!==void 0){let l={x0:Math.min(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),x1:Math.max(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),y0:Math.min(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y),y1:Math.max(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y)};e.model._selection_state.potential_selection=l,P(e,t,r,e.model._selection_state.selected_areas.concat([l]))}}},_t=(e,t,r)=>s=>{if(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN"){let o=t.getMeta(s.target);if(e.model._selection_state.old_selected_areas?.length>0){let l=e.model._selection_state.old_selected_areas[0];if(l.x0===l.x1&&l.y0===l.y1&&l.x0===o.x&&l.y0===o.y){e.model._selection_state.selected_areas=[],e.model._selection_state.old_selected_areas=[],e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={},e.model._selection_state.potential_selection=void 0,P(e,t,r,[]);return}}if(e.model._selection_state.old_selected_areas=[],e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES&&e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x!==void 0&&o.x!==void 0&&o.y!==void 0){let l={x0:Math.min(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),x1:Math.max(o.x,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.x),y0:Math.min(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y),y1:Math.max(o.y,e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES.y)};e.model._selection_state.selected_areas.push(l),P(e,t,r)}e.model._selection_state.CURRENT_MOUSEDOWN_COORDINATES={},e.model._selection_state.potential_selection=void 0}};function ht(e,t,{x0:r,x1:s,y0:o,y1:l}){let i={},n=t.model._edit_mode;r!==void 0&&["SELECT_COLUMN","SELECT_REGION"].indexOf(n)>-1&&(i.start_col=r),s!==void 0&&["SELECT_COLUMN","SELECT_REGION"].indexOf(n)>-1&&(i.end_col=s+1),o!==void 0&&["SELECT_ROW","SELECT_REGION"].indexOf(n)>-1&&(i.start_row=o),l!==void 0&&["SELECT_ROW","SELECT_REGION"].indexOf(n)>-1&&(i.end_row=l+1),e.setSelection(i)}var P=(e,t,r,s)=>{if(e.model._edit_mode==="SELECT_REGION"||e.model._edit_mode==="SELECT_ROW"||e.model._edit_mode==="SELECT_COLUMN"){s=e.model._selection_state.selected_areas.slice(0),e.model._selection_state.potential_selection&&s.push(e.model._selection_state.potential_selection);let o=t.querySelectorAll("tbody td");if(s.length>0)ht(e.parentElement,e,s[0]),ut(e,t,s,r);else{e.parentElement.setSelection();for(let l of o)l.classList.remove(r)}}else if(e.model._selection_state.dirty){e.model._selection_state.dirty=!1;let o=t.querySelectorAll("tbody td");for(let l of o)l.classList.remove(r)}},ut=(e,t,r,s)=>{if(e.model._edit_mode==="SELECT_REGION"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&a<=i.x&&i.x<=c&&d<=i.y&&i.y<=p&&(n=!0,e.model._selection_state.dirty=!0,l.classList.add(s));n||l.classList.remove(s)}}else if(e.model._edit_mode==="SELECT_ROW"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&d<=i.y&&i.y<=p&&(e.model._selection_state.dirty=!0,n=!0,l.classList.add(s));n||l.classList.remove(s)}}else if(e.model._edit_mode==="SELECT_COLUMN"&&r.length>0){let o=t.querySelectorAll("tbody td");for(let l of o){let i=t.getMeta(l),n=!1;for(let{x0:a,x1:c,y0:d,y1:p}of r)a!==void 0&&d!==void 0&&c!==void 0&&p!==void 0&&a<=i.x&&i.x<=c&&(e.model._selection_state.dirty=!0,n=!0,l.classList.add(s));n||l.classList.remove(s)}}};async function He(e){let t=this.parentElement,r=await t.getTable(!0);if(this._initialized)await oe.call(this,this.regular_table,r,e,this.model);else{if(this.innerHTML="",this.shadowRoot?this.shadowRoot.appendChild(this.regular_table):this.appendChild(this.regular_table),this.model=await oe.call(this,this.regular_table,r,e),!this.model)return;Ge(this,this.regular_table,{className:"psp-select-region"}),this.regular_table.addStyleListener(ge.bind(this.model,this.regular_table,t)),this.regular_table.addStyleListener(ie.bind(this.model,this.regular_table)),this.regular_table.addStyleListener(le.bind(this.model,this.regular_table,t)),this.regular_table.addEventListener("click",xe.bind(this.model,this.regular_table)),this.regular_table.addEventListener("mousedown",ye.bind(this.model,this.regular_table,t));let s=new WeakMap;this.regular_table.addStyleListener(Ne.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("mousedown",Me.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("psp-deselect-all",Ae.bind(this.model,this.regular_table,t,s)),this.regular_table.addEventListener("click",$e.bind(this.model,this.regular_table,t));let o=new WeakMap;this.regular_table.addStyleListener(we.bind(this.model,this.regular_table,t,this)),this.regular_table.addStyleListener(G.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("click",Oe.bind(this.model,this.regular_table,t)),this.regular_table.addEventListener("focusin",Re.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("focusout",Ce.bind(this.model,this.regular_table,t,o)),this.regular_table.addEventListener("keydown",Se.bind(this.model,this.regular_table,t,o)),t.addEventListener("perspective-toggle-column-settings",l=>{if(this.isConnected){if(X.call(this.model,this.regular_table,t,l.detail.column_name),!l.detail.open){this.model._column_settings_selected_column=null;return}this.model._column_settings_selected_column=l.detail.column_name}}),this._initialized=!0}}function Y(e,t=!1){if(!this._initialized)return;t&&(this._cached_column_sizes=e);let r={},{group_by:s,columns:o}=this.model._config,l=s?.length>0?s.length+1:0;for(let i of Object.keys(e))if(i==="__ROW_PATH__")r[l-1]=e[i];else{let n=this.model._column_paths.indexOf(i);r[n+l]=e[i]}this.regular_table._column_sizes.override=r}function q(){if(!this._initialized)return[];if(this._cached_column_sizes){let l=this._cached_column_sizes;return this._cached_column_sizes=void 0,l}let e=this.regular_table._column_sizes.override,{group_by:t,columns:r}=this.model._config,s=t?.length>0?t.length+1:0,o={};for(let l of Object.keys(e))if(e[l]!==void 0){let i=l-s;i>-1?o[this.model._column_paths[i]]=e[l]:i===-1&&(o.__ROW_PATH__=e[l])}return o}var W=["READ_ONLY","EDIT","SELECT_ROW","SELECT_COLUMN","SELECT_REGION"];function B(e=void 0){typeof e>"u"&&(e=W[(W.indexOf(this._edit_mode)+1)%W.length]),this.parentElement?.setSelection(),this._edit_mode=e,this.model&&(this.model._edit_mode=e,this.model._selection_state={selected_areas:[],dirty:!0}),this._edit_button!==void 0&&(this._edit_button.dataset.editMode=e),this.dataset.editMode=e}function V(e=void 0){typeof e>"u"&&(e=!this._is_scroll_lock),this._is_scroll_lock=e,this.classList.toggle("sub-cell-scroll-disabled",e),this._scroll_lock!==void 0&&this._scroll_lock.classList.toggle("lock-scroll",e)}function Fe(e,t){e=JSON.parse(JSON.stringify(e)),t=JSON.parse(JSON.stringify(t));let r={};if(e.columns)for(let[l,i]of Object.entries(e.columns))i.column_size_override!==void 0&&(r[l]=i.column_size_override,delete i.column_size_override);let s={};if(t)for(let[l,i]of Object.entries(t))s[l]={...i,pos_fg_color:i.pos_fg_color?O(i.pos_fg_color):void 0,neg_fg_color:i.neg_fg_color?O(i.neg_fg_color):void 0,pos_bg_color:i.pos_bg_color?O(i.pos_bg_color):void 0,neg_bg_color:i.neg_bg_color?O(i.neg_bg_color):void 0,color:i.color?O(i.color):void 0};"edit_mode"in e&&(W.indexOf(e.edit_mode)!==-1?B.call(this,e.edit_mode):console.error("Unknown edit mode "+e.edit_mode)),"scroll_lock"in e&&V.call(this,e.scroll_lock);let o=this.regular_table;Y.call(this,r,!0),o[E]=s}function je(){if(this.regular_table){let e={columns:{},scroll_lock:!!this._is_scroll_lock,edit_mode:this._edit_mode},t=q.call(this);for(let r of Object.keys(t||{}))e.columns[r]||(e.columns[r]={}),e.columns[r].column_size_override=t[r];return JSON.parse(JSON.stringify(e))}return{}}async function Ye(e){if(this.parentElement&&await this.activate(e),!this.isConnected||this.offsetParent==null||!this.model)return;let t=q.call(this),r=this.regular_table.draw({invalid_columns:!0});this._reset_scroll_top&&(this.regular_table.scrollTop=0,this._reset_scroll_top=!1),this._reset_scroll_left&&(this.regular_table.scrollLeft=0,this._reset_scroll_left=!1),this._reset_select&&(this.regular_table.dispatchEvent(new CustomEvent("psp-deselect-all",{bubbles:!1})),this._reset_select=!1),this._reset_column_size&&(this.regular_table._resetAutoSize(),this._reset_column_size=!1),Y.call(this,t),await r,this._toolbar.classList.toggle("aggregated",this.model._config.group_by.length>0||this.model._config.split_by.length>0)}function re(e,t){return e==="integer"||e==="float"?{datagrid_number_style:{fg_gradient:0,pos_fg_color:this.model._pos_fg_color[0],neg_fg_color:this.model._neg_fg_color[0],number_fg_mode:"color",bg_gradient:0,pos_bg_color:this.model._pos_bg_color[0],neg_bg_color:this.model._neg_bg_color[0],number_bg_mode:"disabled"},number_string_format:!0}:e==="date"||e==="datetime"||e==="string"?{[e==="date"||e==="datetime"?"datagrid_datetime_style":"datagrid_string_style"]:{color:this.model._color[0],bg_color:this.model._color[0]}}:null}var qe='regular-table{padding:0;margin:12px 0 0 12px;font-family:inherit;--rt-hover--border-color:var(--inactive--color,#c5c9d080);}regular-table div[tabindex]{outline:none;}regular-table>div{position:absolute;top:0;left:0;right:0;bottom:0;overflow:hidden;}regular-table th{text-align:center;}regular-table thead tr:not(.rt-autosize) th{overflow:hidden;max-width:0px;}regular-table thead tr:last-child .rt-float,regular-table tbody .rt-float{text-align:right;}regular-table thead .rt-integer,regular-table tbody .rt-integer{text-align:right;}regular-table tbody th{text-align:left;}regular-table span.rt-tree-container{display:flex;align-items:center;height:100%;}regular-table thead .rt-string,regular-table tbody .rt-string,regular-table thead .rt-date,regular-table tbody .rt-date,regular-table thead .rt-datetime,regular-table tbody .rt-datetime{text-align:left;}regular-table thead tr:last-child th{border-bottom:1px solid#8b868045;}regular-table tbody tr:first-child td,regular-table tbody tr:first-child th{border-top:1px solid transparent!important;}regular-table th{position:relative;}regular-table tr th span.rt-tree-group{margin-left:5px;margin-right:15px;border-left:1px solid#eee;height:100%;}regular-table td,regular-table th{white-space:nowrap;font-size:12px;padding-right:5px;padding-left:5px;padding-top:0px;padding-bottom:0px;height:19px;}regular-table table *{box-sizing:border-box;}regular-table table{position:absolute;color:#666;outline:none;}regular-table span.rt-row-header-icon{color:#aaa;padding-right:4px;font-family:var(--button--font-family);}regular-table span.rt-column-header-icon{font-size:10px;padding-left:3px;display:inline-block;width:10px;font-family:var(--button--font-family);}regular-table span.rt-row-header-icon:hover{color:#1a7da1;text-shadow:0px 0px 3px#1a7da1;}regular-table .rt-selected td{background-color:#eee;}regular-table .rt-cell-clip{overflow:hidden;text-overflow:ellipsis;}regular-table td span.rt-group-name,regular-table th span.rt-group-name{margin-right:-5px;padding-right:5px;padding-left:8px;flex:1;height:100%;}regular-table th span.rt-group-name{text-align:left;}regular-table td th span.rt-group-leaf,regular-table th span.rt-group-leaf{margin-left:16px;height:100%;}regular-table .rt-column-resize{height:100%;width:10px;position:absolute;top:0;right:0;cursor:col-resize;}regular-table a{color:var(--rt-pos-cell--color);}regular-table a:visited{color:var(--active--color);}regular-table td.psp-null:after,regular-table th.psp-null:after{content:var(--null--content,"-");}.psp-header-border:not(.psp-is-top):not(.psp-header-leaf){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-group{box-shadow:0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-is-top{box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045);}.psp-is-top.psp-header-group:not(.psp-header-group-corner){box-shadow:5px 4px 0px -4px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}.psp-header-border.psp-header-group:not(.psp-is-top):not(.psp-header-group-corner){box-shadow:1px 0px var(--inactive--border-color,#8b868045),0px 10px 0 -9px var(--inactive--border-color,#8b868045);}perspective-viewer[settings] tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}:host-context(perspective-viewer[settings]) tr.rt-autosize .psp-header-leaf.psp-header-border:not(.psp-menu-enabled){box-shadow:1px 0px var(--inactive--border-color,#8b868045);}.psp-header-leaf.psp-header-border{box-shadow:5px -4px 0px -4px var(--inactive--border-color,#8b868045);}tr:only-child th{box-shadow:none!important;}regular-table tbody tr:hover th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover:after{border-color:var(--rt-hover--border-color,#c5c9d080)!important;box-shadow:0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover th.psp-tree-leaf.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover th.psp-tree-label.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr.psp-menu-open:hover:after{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:last-child:hover td.psp-menu-open:not(.psp-row-selected):not(.psp-row-subselected){box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color),0px 1px 0px var(--rt-hover--border-color,#c5c9d080);}regular-table tbody tr:hover+tr th.psp-tree-leaf:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr th.psp-tree-label:not(.psp-row-selected):not(.psp-row-subselected),regular-table tbody tr:hover+tr td:not(.psp-row-selected):not(.psp-row-subselected){border-top-color:transparent;}regular-table tbody tr th:first-child:not(:empty),regular-table tbody tr th:first-child:empty+th:not(:empty),regular-table tbody tr th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr td:first-child{border-left-width:1px;border-left-color:transparent;}regular-table tbody tr th:last-child,regular-table tbody tr td:last-child{border-right-width:0px;border-right-color:transparent;}regular-table tbody tr:hover{color:inherit;}regular-table tbody tr:hover th:first-child:not(:empty),regular-table tbody tr:hover th:first-child:empty+th:not(:empty),regular-table tbody tr:hover th:first-child:empty~th:empty+th:not(:empty),regular-table tbody tr:hover td:first-child{border-left-color:var(--rt-hover--border-color,#c5c9d080)!important;}regular-table tbody tr:hover th:last-child,regular-table tbody tr:hover td:last-child{border-right-color:var(--rt-hover--border-color,#c5c9d080)!important;}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody td,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead th:not(.rt-group-corner){transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody{transform:translate(0,var(--regular-table--transform-y,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child th,perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child th,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0)0,var(--regular-table--clip-x,0)200%,200% 200%,200% 0);}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:first-child td:first-of-type,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:first-child td:first-of-type{clip-path:polygon(var(--regular-table--clip-x,0)var(--regular-table--clip-y,0),var(--regular-table--clip-x,0)200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr:last-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr:last-child:after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:not(:first-child):after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:not(:first-child):after{transform:translate(var(--regular-table--transform-x,0px));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table tbody tr:hover:first-child:after,:host(:not(.sub-cell-scroll-disabled)) regular-table table tbody tr:hover:first-child:after{clip-path:polygon(0 var(--regular-table--clip-y,0),0 200%,200% 200%,200% var(--regular-table--clip-y,0));}perspective-viewer-datagrid:not(.sub-cell-scroll-disabled) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner),:host(:not(.sub-cell-scroll-disabled)) regular-table table thead tr th.rt-group-corner+th:not(.rt-group-corner){clip-path:polygon(var(--regular-table--clip-x,0)0,var(--regular-table--clip-x,0)200%,200% 200%,200% 0);}regular-table{outline:none;}regular-table::-webkit-scrollbar,regular-table::-webkit-scrollbar-corner{background-color:transparent;height:12px;width:12px;}regular-table::-webkit-scrollbar-thumb{background-clip:content-box;background:var(--icon--color);border:5.5px solid var(--plugin--background);max-height:50%;max-width:50%;min-width:10%;min-height:10%;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th{height:0px;}perspective-viewer:not([settings]) regular-table table tr.rt-autosize+tr th span{display:none;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th{height:0px;}:host-context(perspective-viewer:not([settings])) regular-table table tr.rt-autosize+tr th span{display:none;}perspective-viewer[settings] .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}perspective-viewer[settings] .psp-menu-enabled:hover,perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}perspective-viewer[settings] tr:not(.rt-autosize) th.psp-menu-open:before{background-repeat:no-repeat;background-color:var(--icon--color);content:"";display:inline-block;-webkit-mask-size:cover;mask-size:cover;height:8px;width:10px;-webkit-mask-image:var(--column-settings-icon--mask-image);mask-image:var(--column-settings-icon--mask-image);margin-right:4px;background-color:var(--plugin--background);}perspective-viewer[settings] td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color);}perspective-viewer[settings] tr:first-child td.psp-menu-open{border-top-color:var(--icon--color)!important;}perspective-viewer[settings] tr:last-child td.psp-menu-open{box-shadow:inset -2px 0px 0px var(--icon--color),inset 2px 0px 0px var(--icon--color),inset 0px -2px 0px var(--icon--color);}:host-context(perspective-viewer[settings]) .psp-menu-enabled{padding:0 6px;font-size:8px;border-radius:3px 3px 0 0;}:host-context(perspective-viewer[settings]) .psp-menu-enabled:hover,:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open{color:var(--plugin--background);background-color:var(--icon--color);border-bottom-color:var(--icon--color);cursor:pointer;}:host-context(perspective-viewer[settings]) tr:not(.rt-autosize) th.psp-menu-open:before{background-repe