@deephaven/code-studio 0.85.20 → 0.85.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{AppRoot-42a17b8e.js → AppRoot-3da1828a.js} +4 -4
- package/build/assets/{AppRoot-42a17b8e.js.map → AppRoot-3da1828a.js.map} +1 -1
- package/build/assets/{Chart-85f035e2.js → Chart-93017bb0.js} +2 -2
- package/build/assets/{Chart-85f035e2.js.map → Chart-93017bb0.js.map} +1 -1
- package/build/assets/{ControlType-774d7fe4.js → ControlType-ae0db8e1.js} +5 -5
- package/build/assets/ControlType-ae0db8e1.js.map +1 -0
- package/build/assets/{FontBootstrap-99824283.js → FontBootstrap-3e3a0b4f.js} +2 -2
- package/build/assets/{FontBootstrap-99824283.js.map → FontBootstrap-3e3a0b4f.js.map} +1 -1
- package/build/assets/{FormatterUtils-2669a872.js → FormatterUtils-75ad9efb.js} +2 -2
- package/build/assets/{FormatterUtils-2669a872.js.map → FormatterUtils-75ad9efb.js.map} +1 -1
- package/build/assets/Grid-3bb94eca.js +4 -0
- package/build/assets/Grid-3bb94eca.js.map +1 -0
- package/build/assets/{IrisGrid-7130f50c.js → IrisGrid-6dac5f07.js} +2 -2
- package/build/assets/{IrisGrid-7130f50c.js.map → IrisGrid-6dac5f07.js.map} +1 -1
- package/build/assets/{IrisGridModel-9cb3893e.js → IrisGridModel-1c26dcf8.js} +2 -2
- package/build/assets/{IrisGridModel-9cb3893e.js.map → IrisGridModel-1c26dcf8.js.map} +1 -1
- package/build/assets/{IrisGridShortcuts-7c0cadfd.js → IrisGridShortcuts-a0e50c5e.js} +2 -2
- package/build/assets/{IrisGridShortcuts-7c0cadfd.js.map → IrisGridShortcuts-a0e50c5e.js.map} +1 -1
- package/build/assets/IrisGridThemeProvider-31b8442c.js +11 -0
- package/build/assets/IrisGridThemeProvider-31b8442c.js.map +1 -0
- package/build/assets/{LocalWorkspaceStorage-9dd17113.js → LocalWorkspaceStorage-e39208a1.js} +2 -2
- package/build/assets/{LocalWorkspaceStorage-9dd17113.js.map → LocalWorkspaceStorage-e39208a1.js.map} +1 -1
- package/build/assets/{MarkdownEditor-c0485a95.js → MarkdownEditor-058b80a4.js} +2 -2
- package/build/assets/{MarkdownEditor-c0485a95.js.map → MarkdownEditor-058b80a4.js.map} +1 -1
- package/build/assets/{MarkdownNotebook-36debeb7.js → MarkdownNotebook-a7cd39f9.js} +2 -2
- package/build/assets/{MarkdownNotebook-36debeb7.js.map → MarkdownNotebook-a7cd39f9.js.map} +1 -1
- package/build/assets/{MissingPartitionError-e020a19e.js → MissingPartitionError-588bc1a3.js} +2 -2
- package/build/assets/MissingPartitionError-588bc1a3.js.map +1 -0
- package/build/assets/{StyleGuideRoot-0ff89949.js → StyleGuideRoot-6606e84a.js} +2 -2
- package/build/assets/{StyleGuideRoot-0ff89949.js.map → StyleGuideRoot-6606e84a.js.map} +1 -1
- package/build/assets/TokenBoxCellRenderer-7992cbdf.js +2 -0
- package/build/assets/TokenBoxCellRenderer-7992cbdf.js.map +1 -0
- package/build/assets/{index-92d8000d.js → index-29777e6c.js} +2 -2
- package/build/assets/{index-92d8000d.js.map → index-29777e6c.js.map} +1 -1
- package/build/assets/{index-67e9cb27.js → index-576eeba9.js} +3 -3
- package/build/assets/{index-67e9cb27.js.map → index-576eeba9.js.map} +1 -1
- package/build/assets/{index-3b53804c.js → index-7bcf604b.js} +2 -2
- package/build/assets/{index-3b53804c.js.map → index-7bcf604b.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +12 -12
- package/build/assets/ControlType-774d7fe4.js.map +0 -1
- package/build/assets/Grid-a169a656.js +0 -4
- package/build/assets/Grid-a169a656.js.map +0 -1
- package/build/assets/IrisGridThemeProvider-1dfd5be9.js +0 -11
- package/build/assets/IrisGridThemeProvider-1dfd5be9.js.map +0 -1
- package/build/assets/MissingPartitionError-e020a19e.js.map +0 -1
- package/build/assets/TokenBoxCellRenderer-bc5fc12e.js +0 -2
- package/build/assets/TokenBoxCellRenderer-bc5fc12e.js.map +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{r as S,J as d,M as V,N as K,aS as pr,aR as Te,bi as br,I as ke,bh as On,bj as Vt,ab as Er,a1 as Cr,a2 as Ce,V as dr,bR as yn,bS as he,bT as Tn,bU as Pn,bV as xn,bW as En,bX as cr,bY as Nn,bZ as Dn,b_ as In,b$ as Nr,c0 as jn,c1 as Dr,c2 as Rn,c3 as An,c4 as Fn,c5 as kn,c6 as Gn,c7 as Mn,aq as hr,bk as _n,bm as Sr}from"./vendor-3cc10195.js";import{L as ue,bs as Ir,aq as zt,f as Ge,g as wr,T as J,bt as Or,bu as yr,au as Ln,as as Kt,x as $n,bv as Un,av as Qt,am as Ke,an as Bn,U as qt,e as R,aU as vr,bw as Hn,bg as jr,n as Wn,bx as Yt,by as Xt,v as Vn,bz as zn,K as Kn,bl as Qn,bA as qn,bB as Yn,bC as Xn,bD as Zn,bE as me,bF as Jn,bG as ei,bH as ri,bI as ti,b9 as re,bJ as ni,d as Rr,aN as ii,bK as oi,aa as ai,a4 as si,a$ as li}from"./index-92d8000d.js";import{S as ui,m as di,b as ir,n as ci,c as Zt,C as ye}from"./MissingPartitionError-e020a19e.js";import{k as ge,I as Le,q as hi,M as vi,o as mi}from"./IrisGridShortcuts-7c0cadfd.js";import{c as le,O as fi,n as de,o as Jt,p as en,q as Ar,r as gi,s as pi,T as bi,v as rn,w as Ci,G as Si,u as wi,g as Oi}from"./TokenBoxCellRenderer-bc5fc12e.js";import{B as L,S as Ye,c as M,C as Pe,w as yi,aG as Ti,a6 as tn,D as Tr,R as nn,s as Xe,d as Pi,P as xi,cy as Qe,b3 as qe,b as Re,a as Z,I as pe,t as Ie,a7 as Ei,H as Ni,ai as A,u as rr,bf as on,be as Fr,bi as Di,bg as kr,b8 as Ii,bd as ji,cU as Ri,b9 as Ai,E as Fi}from"./ControlType-774d7fe4.js";import{e as ki}from"./monaco-b5248072.js";import{b as Ee,G as ne,d as $,m as an,i as Ae,e as Gr}from"./IrisGridModel-9cb3893e.js";import{F as Gi,c as Mi}from"./FormatterUtils-2669a872.js";function Mr(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(u){r(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function _i(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(l){Mr(o,n,i,a,s,"next",l)}function s(l){Mr(o,n,i,a,s,"throw",l)}a(void 0)})}}function Li(t,e){var{autoLoad:r=!0}=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},[n,i]=S.useState(null),[o,a]=S.useState(null),[s,l]=S.useState(!1),u=S.useCallback(_i(function*(){l(!0);try{var c=yield t(...e);i(c),a(null)}catch(h){i(null),a(h)}finally{l(!1)}}),[t,...e]);return S.useEffect(()=>{r&&u()},[r,u]),{data:n,error:o,isError:o!=null,isLoading:s,reload:u}}function $i(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,n=S.useRef(),i=S.useRef(0);return S.useCallback(o=>{window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var a=Math.floor(o.target.scrollTop/t);i.current!==a&&(i.current=a,e(a))},r)},[r,t,e])}function Ui(){var{getKey:t=Bi}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},[e,r]=S.useState([]),[n,i]=S.useState(()=>new Set),o=S.useCallback(m=>p=>t(p)===m,[t]),a=S.useCallback(m=>{var p;return(p=e.find(o(m)))!==null&&p!==void 0?p:null},[e,o]),s=S.useCallback(m=>{var p=a(m);if(p==null)throw new Error("No item found matching key: ".concat(m));return p},[a]),l=S.useCallback(m=>{r(p=>[...p,...m])},[]),u=S.useCallback((m,p)=>{r(g=>[...g.slice(0,m),...p,...g.slice(m)])},[]),c=S.useCallback(m=>{var p=new Set(m);r(g=>g.filter(b=>!p.has(t(b))))},[t]),h=S.useCallback((m,p)=>{var g=e.findIndex(o(m));g!==-1&&r(b=>[...b.slice(0,g),p,...b.slice(g+1)])},[e,o]),f=S.useCallback(m=>{if(m.size!==0){var p=[],g=new Map;for(var b of m.keys()){var O=e.findIndex(o(b));p.push(O),g.set(O,b)}p.sort((y,T)=>y-T);var C=[];e.forEach((y,T)=>{if(p[0]===T){var P=g.get(p.shift()),j=m.get(P);C.push(j)}else C.push(y)}),r(C)}},[e,o]),v=S.useMemo(()=>({items:e,selectedKeys:n,append:l,bulkUpdate:f,findItem:a,getItem:s,insert:u,remove:c,setItems:r,setSelectedKeys:i,update:h}),[l,f,a,s,u,e,c,r,n,h]);return v}function Bi(t){var e=t!=null&&typeof t=="object"&&"key"in t;if(!e)throw new Error("Item does not have a `key` prop.");return t.key}function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Lr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(r),!0).forEach(function(n){Hi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hi(t,e,r){return e=Wi(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Wi(t){var e=Vi(t,"string");return typeof e=="symbol"?e:String(e)}function Vi(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $r=ue.module("Aggregations");function Jl(t){var{isRollup:e,settings:r,onChange:n,onEdit:i,dh:o}=t,{aggregations:a,showOnTop:s}=r,l=S.useMemo(()=>ui.filter(N=>!a.some(E=>E.operation===N)&&!(N===di.MEDIAN&&o.AggregationOperation.MEDIAN===void 0)),[a,o]),[u,c]=S.useState(l[0]),[h,f]=S.useState([]),v=S.useCallback(function(N){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];n(Lr(Lr({},r),N),E,k)},[n,r]),m=S.useCallback(function(N){var E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];v({aggregations:N},E,k)},[v]),p=S.useCallback(N=>{v({showOnTop:N})},[v]),g=S.useCallback(()=>{$r.debug("handleDragStart"),ge.startDragging()},[]),b=S.useCallback(N=>{var{destination:E,source:k}=N;if($r.debug("handleDragEnd",E,k),ge.stopDragging(),E!==null){var F=E.index;k.index<E.index&&(F+=1);var G=[...a],H=ge.reorder(G,h,G,F),B=ge.adjustDestinationIndex(F,h),z=[[B,B+H.length-1]];m(G),f(z)}},[m,a,h,f]),O=S.useCallback(N=>{c(N)},[c]),C=S.useCallback(()=>{m([...a,{operation:u,selected:[],invert:!0}],[u])},[a,u,m]),y=S.useCallback(N=>{var[E,k]=a.reduce((F,G,H)=>{var[B,z]=F;return H===N?z.push(G.operation):B.push(G),[B,z]},[[],[]]);m(E,[],k)},[a,m]),T=S.useCallback(N=>{f(N)},[f]),P=S.useCallback(N=>{var E=a[N];ir.isRollupOperation(E.operation)||i(E)},[a,i]),j=S.useCallback(N=>{p(N==="true")},[p]);S.useEffect(function(){l.length>0&&!l.includes(u)&&c(l[0])},[l,u]);var D=S.useCallback(N=>{var{item:E,itemIndex:k,isClone:F=!1,selectedCount:G}=N,H=E.operation,B=F?"".concat(G):void 0,z=F?"item-list-item-clone":void 0,ve=ir.isRollupOperation(E.operation),Me=ir.isRollupProhibited(E.operation),_e=!F&&!ve;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:V("item-list-item-content","draggable-item-list-item-content",z),children:[d.jsxs("span",{className:"title",children:[H,!e&&ve&&d.jsxs("span",{className:"small text-warning",children:[d.jsx(K,{icon:Ir})," Requires rollup"]}),e&&Me&&d.jsxs("span",{className:"small text-warning",children:[d.jsx(K,{icon:Ir})," Not available on rollups"]})]}),le.renderBadge({text:B}),le.renderHandle()]}),!F&&d.jsxs(d.Fragment,{children:[d.jsx(L,{kind:"ghost",className:"btn-edit",icon:zt,tooltip:"Edit Columns",onClick:()=>i(E),disabled:!_e}),d.jsx(L,{kind:"ghost",className:"btn-delete",icon:Ge,tooltip:"Delete Aggregation",onClick:()=>y(k)})]})]})},[y,i,e]),x=l.length>0,I=a.length>0;return d.jsxs("div",{className:"aggregations",children:[x&&d.jsxs("div",{className:"form-inline",children:[d.jsx(Ye,{onChange:O,value:u,children:l.map(N=>d.jsx(fi,{value:N,children:N},N))}),d.jsxs("button",{type:"button",className:"btn btn-link btn-add",onClick:C,children:[d.jsx(K,{icon:wr}),"Add Aggregation"]})]}),x&&I&&d.jsx("hr",{}),I&&d.jsxs(d.Fragment,{children:[!e&&d.jsxs("div",{children:[d.jsx("label",{id:"placement-options-label",children:"Placement: "}),d.jsxs(pr,{"aria-labelledby":"placement-options-label",marginStart:"size-125",orientation:"horizontal",onChange:j,value:"".concat(s),children:[d.jsx(Te,{value:"true",children:"Top"}),d.jsx(Te,{value:"false",children:"Bottom"})]})]}),d.jsx(br,{onDragStart:g,onDragEnd:b,children:d.jsx(le,{className:"selected-aggregations",itemCount:a.length,items:a,renderItem:D,offset:0,onSelectionChange:T,onSelect:P,selectedRanges:h,isMultiSelect:!0})})]})]})}function Ur(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ur(Object(r),!0).forEach(function(n){zi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ur(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function zi(t,e,r){return e=Ki(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ki(t){var e=Qi(t,"string");return typeof e=="symbol"?e:String(e)}function Qi(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ae;(function(t){t[t.NONE=0]="NONE",t[t.ASCENDING=1]="ASCENDING",t[t.DESCENDING=2]="DESCENDING"})(ae||(ae={}));var qi=30;function eu(t){var{aggregation:e,columns:r,onChange:n}=t,[i,o]=S.useState(-1),[a,s]=S.useState(-1),[l,u]=S.useState(ae.NONE),{invert:c,selected:h}=e,f=S.useRef(null),v=S.useCallback(P=>h.includes(P)?!c:c,[c,h]),m=S.useMemo(()=>{var P=ci(r,e.operation);return l!==ae.NONE&&(P=M.sortColumns(P,l===ae.ASCENDING)),P},[r,e.operation,l]),p=S.useMemo(()=>i>=0?m.slice(i,a+1).map(P=>({value:P.name,displayValue:P.name,isSelected:v(P.name)})):[],[m,v,a,i]),g=S.useCallback(P=>{var{name:j}=m[P],D=h.indexOf(j),x=[...h],I=c;D>=0?x.splice(D,1):(x.push(j),x.length===m.length&&(x=[],I=!c)),n(be(be({},e),{},{selected:x,invert:I}))},[e,c,m,h,n]),b=S.useCallback(()=>{u(ae.NONE),n(be(be({},e),{},{selected:[],invert:!0}))},[e,n]),O=S.useCallback((P,j)=>{o(P),s(j)},[o,s]),C=S.useCallback(()=>{h.length===0?n(be(be({},e),{},{invert:!c})):n(be(be({},e),{},{selected:[],invert:!0}))},[e,c,n,h]),y=h.length===0?c:null,T=h.length!==0||!c||l!==ae.NONE;return d.jsxs("div",{role:"menu",className:"aggregation-edit",children:[d.jsx("div",{className:"top-menu",children:d.jsxs("div",{className:"form-inline",children:[d.jsx(Pe,{checked:y,onChange:C,children:"Toggle All"}),d.jsx("div",{className:"spacer"}),d.jsx(yi,{in:T,timeout:J.transitionSlowMs,mountOnEnter:!0,unmountOnExit:!0,children:d.jsx(L,{kind:"ghost",className:"btn-reset",onClick:b,children:"Reset"})}),d.jsx(L,{kind:"ghost",className:V({active:l===ae.ASCENDING}),icon:Or,tooltip:"Sort ascending",onClick:()=>u(ae.ASCENDING)}),d.jsx(L,{kind:"ghost",className:V({active:l===ae.DESCENDING}),icon:yr,tooltip:"Sort descending",onClick:()=>u(ae.DESCENDING)})]})}),d.jsx("div",{className:"aggregation-edit-item-list",children:d.jsx(Ti,{itemCount:m.length,items:p,offset:i,renderItem:P=>{var{item:j}=P;return d.jsx(Pe,{checked:v(j.value),children:j.displayValue})},onSelect:g,onViewportChange:O,rowHeight:qi,focusSelector:"input",ref:f})})]})}function Br(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Br(Object(r),!0).forEach(function(n){Yi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Br(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yi(t,e,r){return e=Xi(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xi(t){var e=Zi(t,"string");return typeof e=="symbol"?e:String(e)}function Zi(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ji(t){return d.jsx("svg",Hr(Hr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},t),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#7DA4FF",d:"M8 26h4v15H8zM15 17h4v24h-4zM22 21h4v20h-4zM29 17h4v24h-4zM36 11h4v30h-4z"})]})}))}function Wr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Vr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wr(Object(r),!0).forEach(function(n){eo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function eo(t,e,r){return e=ro(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ro(t){var e=to(t,"string");return typeof e=="symbol"?e:String(e)}function to(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function no(t){return d.jsx("svg",Vr(Vr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},t),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#7DA4FF",d:"M7 34h4v8H7zM12 31h4v11h-4zM17 27h4v15h-4zM22 22h4v20h-4zM27 27h4v15h-4zM32 29h4v13h-4zM37 31h4v11h-4z"})]})}))}function zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?zr(Object(r),!0).forEach(function(n){io(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):zr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function io(t,e,r){return e=oo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oo(t){var e=ao(t,"string");return typeof e=="symbol"?e:String(e)}function ao(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function so(t){return d.jsx("svg",Kr(Kr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},t),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M4 4h1v40H4zM44 43v1H5v-1z"}),d.jsx("path",{stroke:"#7DA4FF",d:"M7.984 32.44l7.982-11.378 5.273 3.739 9.952-10.838 2.826 1.894 7.45-5.802"}),d.jsx("path",{stroke:"#BECDEF",d:"M8.244 37.926L17 33.496l5 .87 10.637-10.35 10.615-1.381"})]})}))}function Qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qr(Object(r),!0).forEach(function(n){lo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function lo(t,e,r){return e=uo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function uo(t){var e=co(t,"string");return typeof e=="symbol"?e:String(e)}function co(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ho(t){return d.jsx("svg",qr(qr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},t),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{d:"M24 10c7.732 0 14 6.268 14 14s-6.268 14-14 14-14-6.268-14-14h14V10z",fill:"#80A6FF"}),d.jsx("path",{d:"M10 24c0-7.732 6.268-14 14-14v14H10z",fill:"#C1C0C0"})]})}))}function Yr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Xr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Yr(Object(r),!0).forEach(function(n){vo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vo(t,e,r){return e=mo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mo(t){var e=fo(t,"string");return typeof e=="symbol"?e:String(e)}function fo(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function go(t){return d.jsx("svg",Xr(Xr({width:48,height:48,xmlns:"http://www.w3.org/2000/svg"},t),{},{children:d.jsxs("g",{fill:"none",fillRule:"evenodd",children:[d.jsx("path",{fill:"#C1C0C0",d:"M44 43v1H4v-1z"}),d.jsx("path",{fill:"#939293",d:"M44 34v1H4v-1zM44 25v1H4v-1zM44 16v1H4v-1z"}),d.jsx("circle",{fill:"#7DA4FF",cx:9.5,cy:37.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:16.5,cy:30.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:22.5,cy:36.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:28.5,cy:30.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:15.5,cy:38.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:23.5,cy:25.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:19.5,cy:19.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:29.5,cy:19.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:32.5,cy:26.5,r:1.5}),d.jsx("circle",{fill:"#7DA4FF",cx:36.5,cy:13.5,r:1.5})]})}))}function Zr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zr(Object(r),!0).forEach(function(n){po(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function po(t,e,r){return e=bo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bo(t){var e=Co(t,"string");return typeof e=="symbol"?e:String(e)}function Co(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ru(t){return d.jsxs("svg",Jr(Jr({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{},{children:[d.jsx("rect",{width:"48",height:"48",fill:"none"}),d.jsx("rect",{x:"26",y:"10",width:"15",height:"4",fill:"#9FDE70"}),d.jsx("rect",{x:"26",y:"22",width:"15",height:"4",fill:"#9FDE70"}),d.jsx("rect",{x:"26",y:"28",width:"15",height:"4",fill:"#FFD95C"}),d.jsx("rect",{x:"26",y:"34",width:"15",height:"4",fill:"#9FDE70"})]}))}function et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?et(Object(r),!0).forEach(function(n){So(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function So(t,e,r){return e=wo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wo(t){var e=Oo(t,"string");return typeof e=="symbol"?e:String(e)}function Oo(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tu(t){return d.jsxs("svg",rt(rt({width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),{},{children:[d.jsx("rect",{width:"48",height:"48",fill:"none"}),d.jsx("rect",{x:"4",y:"16",width:"40",height:"4",fill:"#FFD95C"}),d.jsx("rect",{x:"4",y:"10",width:"40",height:"4",fill:"#78DCE8"}),d.jsx("rect",{x:"4",y:"34",width:"40",height:"4",fill:"#78DCE8"})]}))}var tt=ue.module("ChartBuilder");class se extends S.PureComponent{static getMaxSeriesCount(e,r){switch(r){case e.plot.SeriesPlotStyle.PIE:return 1;case e.plot.SeriesPlotStyle.HISTOGRAM:return 0;default:return 100}}static makeSeriesItem(e){return{id:ke(),value:e}}static makeDefaultSeriesItems(e,r,n){var i=se.getMaxSeriesCount(e,r);if(i===0||n==null||n.length===0)return[];var o=n.length>1?n[1].name:n[0].name;return[se.makeSeriesItem(o)]}static getDefaultXAxis(e,r){return r!=null&&r.length>0?r[0].name:null}constructor(e){super(e),tn(this);var{model:r}=e,{columns:n,dh:i}=r,o=this.getTypes()[0],a=se.getDefaultXAxis(o,n),s=se.makeDefaultSeriesItems(i,o,n);this.state={type:o,seriesItems:s,xAxis:a,isLinked:!0}}getTypes(){var{model:e}=this.props,{dh:r}=e;return[r.plot.SeriesPlotStyle.LINE,r.plot.SeriesPlotStyle.BAR,r.plot.SeriesPlotStyle.SCATTER,r.plot.SeriesPlotStyle.PIE]}getTypeName(e){var{model:r}=this.props,{dh:n}=r;switch(e){case n.plot.SeriesPlotStyle.LINE:return"Line";case n.plot.SeriesPlotStyle.BAR:return"Bar";case n.plot.SeriesPlotStyle.SCATTER:return"Scatter";case n.plot.SeriesPlotStyle.PIE:return"Pie";case n.plot.SeriesPlotStyle.HISTOGRAM:return"Histogram";default:return e}}getTypeIcon(e){var{model:r}=this.props,{dh:n}=r;switch(e){case n.plot.SeriesPlotStyle.LINE:return d.jsx(so,{});case n.plot.SeriesPlotStyle.BAR:return d.jsx(Ji,{});case n.plot.SeriesPlotStyle.SCATTER:return d.jsx(go,{});case n.plot.SeriesPlotStyle.PIE:return d.jsx(ho,{});case n.plot.SeriesPlotStyle.HISTOGRAM:return d.jsx(no,{});default:return null}}getXAxisLabel(e){var{model:r}=this.props,{dh:n}=r;switch(e){case n.plot.SeriesPlotStyle.PIE:return"Labels";case n.plot.SeriesPlotStyle.HISTOGRAM:return"Data";default:return"X-Axis"}}getSeriesLabel(e){var{model:r}=this.props,{dh:n}=r;switch(e){case n.plot.SeriesPlotStyle.PIE:return"Values";default:return"Series"}}handleAddSeries(){this.setState(e=>{var{seriesItems:r}=e,n=[...r],{model:i}=this.props,{columns:o}=i;return n.push({id:ke(),value:o[0].name}),{seriesItems:n}},this.sendChange)}handleLinkStateChange(e){this.setState({isLinked:e==="true"},this.sendChange)}handleReset(){var{model:e}=this.props,{columns:r,dh:n}=e,i=this.getTypes()[0],o=se.getDefaultXAxis(i,r),a=se.makeDefaultSeriesItems(n,i,r),s=!0;this.setState({type:i,seriesItems:a,xAxis:o,isLinked:s},this.sendChange)}handleSeriesChange(e,r){var n=e;this.setState(i=>{var{seriesItems:o}=i;return o=[...o],o[r].value=n,{seriesItems:o}},this.sendChange)}handleSeriesDeleteClick(e){this.setState(r=>{var{seriesItems:n}=r,i=[...n];return i.splice(e,1),{seriesItems:i}},this.sendChange)}handleSubmit(e){e.preventDefault();var{onSubmit:r}=this.props,{type:n,seriesItems:i,xAxis:o,isLinked:a}=this.state,s=i.map(l=>l.value);r({type:n,series:s,xAxis:o,isLinked:a})}handleTypeClick(e){var r=this.getTypes()[e];tt.debug2("handleTypeSelect",r),this.setState(n=>{var{model:i}=this.props,{dh:o}=i,a=se.getMaxSeriesCount(o,r),{seriesItems:s}=n;if(s=s.slice(0,a),s.length===0&&a>0){var{columns:l}=i;s=se.makeDefaultSeriesItems(o,r,l)}return{type:r,seriesItems:s}},this.sendChange)}handleXAxisChange(e){var r=e;tt.debug2("x-axis change",r),this.setState({xAxis:r},this.sendChange)}sendChange(){var{onChange:e}=this.props,{isLinked:r,type:n,seriesItems:i,xAxis:o}=this.state,a=i.map(s=>s.value);e({type:n,series:a,xAxis:o,isLinked:r})}render(){var{model:e}=this.props,{columns:r,dh:n}=e,{seriesItems:i,type:o,xAxis:a,isLinked:s}=this.state,l=se.getMaxSeriesCount(n,o),u=this.getXAxisLabel(o),c=this.getSeriesLabel(o),h=i.length>0,f=i.length<l;return d.jsx("div",{className:"chart-builder",children:d.jsxs("form",{onSubmit:this.handleSubmit,children:[d.jsxs("div",{className:"form-row",children:[d.jsx("label",{children:"Select Chart Type"}),d.jsx("div",{className:"form-row",children:this.getTypes().map((v,m)=>{var p=v;return d.jsx("div",{className:"col col-chart-type",children:d.jsxs("button",{type:"button",className:V("btn","btn-icon","btn-chart-type",{active:v===o}),onClick:()=>this.handleTypeClick(m),children:[this.getTypeIcon(v),this.getTypeName(v)]})},p)})})]}),d.jsx("hr",{}),d.jsxs("div",{className:"form-row form-inline",children:[d.jsx("label",{className:"col-2 label-left",children:u}),d.jsx(Ye,{className:"form-control select-x-axis col",value:a,onChange:this.handleXAxisChange,children:r.map(v=>d.jsx("option",{value:v.name,children:v.name},v.name))})]}),h&&d.jsx("hr",{}),i.map((v,m)=>d.jsxs("div",{className:"form-row form-inline form-series-item","data-testid":"form-series-item-".concat(m),children:[d.jsx("label",{className:"col-2 label-left",children:m===0?c:""}),d.jsx(Ye,{className:"form-control select-series col",value:v.value,onChange:p=>this.handleSeriesChange(p,m),"data-testid":"select-series-item-".concat(m),children:r.map(p=>d.jsx("option",{value:p.name,children:p.name},p.name))}),i.length>1&&d.jsx(L,{kind:"ghost",className:"btn-delete-series ml-2 px-2","data-testid":"delete-series-".concat(m),onClick:()=>{this.handleSeriesDeleteClick(m)},icon:Ge,tooltip:"Delete"})]},v.id)),f&&d.jsxs("div",{className:"form-row",children:[d.jsx("div",{className:"col-2"}),d.jsx(L,{kind:"ghost",className:"btn-add-series mt-1",onClick:this.handleAddSeries,icon:wr,children:"Add Series"})]}),d.jsxs("div",{className:"form-row chart-builder-link",children:[d.jsx("label",{className:"col-2 label-right",children:d.jsxs("div",{className:"fa-md fa-layers",children:[d.jsx(K,{mask:Ln,icon:Kt,transform:"right-5 down-5"}),d.jsx(K,{icon:s?$n:Un,transform:"grow-2 right-8 down-6"})]})}),d.jsxs(pr,{"aria-label":"Link state options",orientation:"horizontal",onChange:this.handleLinkStateChange,value:"".concat(s),children:[d.jsx(Te,{value:"true",children:"Sync State"}),d.jsx(Te,{value:"false",children:"Freeze State"})]})]}),d.jsxs("div",{className:"form-row",children:[d.jsx("div",{className:"col-2 label-right"}),d.jsx("div",{className:"col chart-builder-link-info",children:s?"Charts with synced state will update to match any filters or user modifications applied to the parent table.":"Freeze State disconnects the chart state from the parent table. New filters or user modifications on the parent table will not be applied."})]}),d.jsxs("div",{className:V("form-row","justify-content-end","my-3"),children:[d.jsx(L,{kind:"secondary",className:"btn-reset",onClick:this.handleReset,children:"Reset"}),d.jsx(L,{kind:"primary",type:"submit",className:"btn-submit",children:"Create"})]})]})})}}const nu=se;function nt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function yo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?nt(Object(r),!0).forEach(function(n){Ze(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):nt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ze(t,e,r){return e=To(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function To(t){var e=Po(t,"string");return typeof e=="symbol"?e:String(e)}function Po(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class sn extends S.Component{constructor(e){super(e),Ze(this,"editorContainer",void 0),Ze(this,"editor",void 0),this.handleContentChanged=this.handleContentChanged.bind(this),this.handleEditorFocus=this.handleEditorFocus.bind(this),this.handleEditorBlur=this.handleEditorBlur.bind(this),this.handleContainerClick=this.handleContainerClick.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.state={isEditorFocused:!1,isEditorEmpty:!0},this.editorContainer=null}componentDidMount(){this.initEditor()}componentWillUnmount(){this.destroyEditor()}initEditor(){var e,{value:r,editorSettings:n}=this.props,i=yo({copyWithSyntaxHighlighting:"false",fixedOverflowWidgets:!0,folding:!1,fontFamily:"Fira Mono",glyphMargin:!1,language:"groovyDB",lineDecorationsWidth:8,lineNumbers:"off",minimap:{enabled:!1},renderLineHighlight:"none",scrollbar:{arrowSize:0,horizontal:"hidden",horizontalScrollbarSize:0},scrollBeyondLastLine:!1,padding:{top:6,bottom:6},tabCompletion:"off",useTabStops:!0,value:r,wordWrap:"on",automaticLayout:!0,autoClosingBrackets:"beforeWhitespace"},n);if(!this.editorContainer)throw new Error("editorContainer is null");this.editor=ki.create(this.editorContainer,i),this.editor.layout(),(e=this.editor.getModel())===null||e===void 0||e.updateOptions({tabSize:0}),this.editor.onKeyDown(this.handleKeyDown),this.editor.onDidChangeModelContent(this.handleContentChanged),this.editor.onDidFocusEditorText(this.handleEditorFocus),this.editor.onDidBlurEditorText(this.handleEditorBlur)}destroyEditor(){var e;(e=this.editor)===null||e===void 0||e.dispose(),this.editor=void 0}handleContentChanged(){var e,r,{onContentChanged:n}=this.props,i=(e=this.editor)===null||e===void 0||(r=e.getModel())===null||r===void 0?void 0:r.getValue();i!==void 0&&this.setState({isEditorEmpty:i.length===0}),n(i)}handleEditorFocus(){this.setState({isEditorFocused:!0})}handleEditorBlur(){var e,r,n,i=(e=(r=this.editor)===null||r===void 0||(n=r.getModel())===null||n===void 0?void 0:n.getValue())!==null&&e!==void 0?e:"";this.setState({isEditorEmpty:i.length===0,isEditorFocused:!1})}handleContainerClick(){var e,{isEditorFocused:r}=this.state;r||(e=this.editor)===null||e===void 0||e.focus()}handleKeyDown(e){var{onTab:r,editorIndex:n}=this.props;e.code==="Tab"&&(e.stopPropagation(),e.preventDefault(),r(n,e.shiftKey))}render(){var{className:e,invalid:r,placeholder:n="",value:i}=this.props,{isEditorFocused:o,isEditorEmpty:a}=this.state;return d.jsxs("div",{className:V("input-editor-wrapper",{focused:o,invalid:r},e),role:"presentation",onClick:this.handleContainerClick,children:[d.jsx("div",{className:"editor-container",ref:s=>{this.editorContainer=s},"data-testid":"custom-column-formula"}),a&&!i&&n.length>0&&d.jsx("div",{className:"editor-placeholder text-muted",children:n})]})}}Ze(sn,"defaultProps",{value:"",onContentChanged:()=>{},editorSettings:{},editorIndex:0,onTab:()=>{},invalid:!1});function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function $e(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?it(Object(r),!0).forEach(function(n){xo(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):it(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xo(t,e,r){return e=Eo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eo(t){var e=No(t,"string");return typeof e=="symbol"?e:String(e)}function No(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ot=Object.freeze({NAME:"name",FORMULA:"formula"}),Do=()=>{};function Io(t){var{eventKey:e,name:r,inputIndex:n,formula:i,onChange:o,onDeleteColumn:a,onTabInEditor:s,invalid:l,isDuplicate:u}=t,c=r===""||Tr.isValidColumnName(r),h=S.useCallback(f=>{f!==void 0&&(f.replace(/(\r\n|\n|\r)/gm,""),o(e,ot.FORMULA,f))},[o,e]);return d.jsx(On,{draggableId:e,index:n,disableInteractiveElementBlocking:!0,children:(f,v)=>d.jsxs("div",$e($e({className:V("draggable-container",{dragging:v.isDragging}),ref:f.innerRef},f.draggableProps),{},{children:[d.jsxs("div",{className:"custom-column-input-container",children:[d.jsxs("div",{className:"pb-3",children:[d.jsxs("div",{className:"d-flex flex-row custom-column-name",children:[d.jsx("input",{className:V("form-control custom-column-input",{"is-invalid":l||!c||u}),placeholder:"Column Name",value:r,onChange:m=>{o(e,ot.NAME,m.target.value)}}),d.jsx(L,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{a(e)},icon:Ge,tooltip:"Delete custom column"}),d.jsx(L,$e($e({kind:"ghost",className:"btn-drag-handle",onClick:Do},f.dragHandleProps),{},{icon:Qt,tooltip:"Drag column to re-order"}))]}),(!c||u)&&d.jsx("p",{className:"validate-label-error text-danger mb-0 mt-2 pl-1",children:c?"Duplicate name":"Invalid name"})]}),d.jsx(sn,{editorSettings:{language:"deephavenDb"},editorIndex:n,placeholder:"Column Formula",value:i,onContentChanged:h,onTab:s,invalid:l})]}),d.jsx("hr",{})]}))})}function jo(t){return t?.isDeletable!==void 0}function at(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function or(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?at(Object(r),!0).forEach(function(n){De(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function De(t,e,r){return e=Ro(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ro(t){var e=Ao(t,"string");return typeof e=="symbol"?e:String(e)}function Ao(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class we extends S.Component{static makeCustomColumnInputEventKey(){return ke()}static createCustomColumnInput(){return{eventKey:ke(),name:"",formula:""}}constructor(e){super(e),De(this,"container",void 0),De(this,"successButtonTimer",void 0),De(this,"getInput",Er((r,n)=>r.find(i=>i.eventKey===n))),De(this,"getInputIndex",Er((r,n)=>r.findIndex(i=>i.eventKey===n))),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleSaveClick=this.handleSaveClick.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleCustomColumnUpdated=this.handleCustomColumnUpdated.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.resetRequestFailed=this.resetRequestFailed.bind(this),this.handleEditorTabNavigation=this.handleEditorTabNavigation.bind(this),this.state={inputs:[],isCustomColumnApplying:!1,errorMessage:null,hasRequestFailed:!1,isSuccessShowing:!1},this.container=null,this.successButtonTimer=null}componentDidMount(){var{customColumns:e}=this.props;this.parseCustomColumns(e),this.startListening()}componentWillUnmount(){this.stopListening(),this.successButtonTimer&&clearTimeout(this.successButtonTimer)}resetErrorMessage(){this.setState({errorMessage:null})}startListening(){var{model:e}=this.props;e.addEventListener(Ee.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.addEventListener(Ee.EVENT.UPDATED,this.handleCustomColumnUpdated),e.addEventListener(Ee.EVENT.REQUEST_FAILED,this.handleRequestFailed)}stopListening(){var{model:e}=this.props;e.removeEventListener(Ee.EVENT.COLUMNS_CHANGED,this.handleCustomColumnUpdated),e.removeEventListener(Ee.EVENT.UPDATED,this.handleCustomColumnUpdated),e.removeEventListener(Ee.EVENT.REQUEST_FAILED,this.handleRequestFailed)}parseCustomColumns(e){if(e.length>0){var r=e.map(n=>{var i=n.split(/=(.+)/,2);return{eventKey:we.makeCustomColumnInputEventKey(),name:i[0],formula:i[1]}});this.setState({inputs:r})}else this.setState({inputs:[we.createCustomColumnInput()]})}handleAddColumnClick(){var{inputs:e}=this.state,r=[...e];r.push(we.createCustomColumnInput()),this.setState({inputs:r})}handleDeleteColumn(e){var{inputs:r}=this.state,n=this.getInputIndex(r,e),i=[...r];i.splice(n,1),i.length===0&&i.push(we.createCustomColumnInput()),this.setState({inputs:i})}handleInputChange(e,r,n){var{inputs:i}=this.state,o=this.getInputIndex(i,e),a=this.getInput(i,e),s=or({},a);s[r]=n;var l=[...i];l.splice(o,1,s),this.setState({inputs:l})}handleCustomColumnUpdated(){var{isCustomColumnApplying:e}=this.state;e&&this.setState({isCustomColumnApplying:!1,isSuccessShowing:!0},()=>{this.successButtonTimer=setTimeout(()=>this.setState({isSuccessShowing:!1}),we.SUCCESS_SHOW_DURATION)})}handleRequestFailed(e){var r=e,{isCustomColumnApplying:n}=this.state;n&&this.setState({isCustomColumnApplying:!1,errorMessage:d.jsxs(d.Fragment,{children:[d.jsxs("p",{children:[d.jsx(K,{icon:Ke})," Failed to apply custom columns."]}),d.jsxs("div",{className:"error-box",children:[r.detail.errorMessage,d.jsx("br",{}),"Table configuration:"," ",JSON.stringify(r.detail.configuration)]})]}),hasRequestFailed:!0})}handleDragEnd(e){if(ge.stopDragging(),!!e.destination){var{inputs:r}=this.state,n=e.source.index,i=e.destination.index,o=[...r],a=r[n];o.splice(n,1),o.splice(i,0,a),this.setState({inputs:o})}}handleEditorTabNavigation(e,r){var{inputs:n}=this.state;if(r){var i;((i=this.container)===null||i===void 0?void 0:i.querySelectorAll(".btn-drag-handle")[e]).focus();return}if(e===n.length-1){var o,a;(o=this.container)===null||o===void 0||(a=o.querySelector(".btn-add-column"))===null||a===void 0||a.focus()}else{var s,l=e+1;((s=this.container)===null||s===void 0?void 0:s.querySelectorAll(".custom-column-input")[l]).focus()}}handleSaveClick(){var{onSave:e,customColumns:r}=this.props,{inputs:n,isCustomColumnApplying:i}=this.state;if(!i){var o=[];n.forEach(a=>{var{name:s,formula:l}=a;s&&l&&o.push("".concat(s,"=").concat(l))}),this.resetErrorMessage(),this.setState({isCustomColumnApplying:o.length>0||r.length>0}),e(o)}}resetRequestFailed(){this.setState(e=>{var{hasRequestFailed:r}=e;return r?{hasRequestFailed:!1}:null})}renderInputs(){var{inputs:e,hasRequestFailed:r}=this.state,n=new Map;return e.forEach(i=>{var o,{name:a}=i;return n.set(a,((o=n.get(a))!==null&&o!==void 0?o:0)+1)}),e.map((i,o)=>{var a,{eventKey:s,name:l,formula:u}=i,c=((a=n.get(l))!==null&&a!==void 0?a:0)>1;return d.jsx(Io,{inputIndex:o,eventKey:s,name:l,formula:u,onChange:this.handleInputChange,onDeleteColumn:this.handleDeleteColumn,onTabInEditor:this.handleEditorTabNavigation,invalid:r,isDuplicate:c},s)})}renderSaveButton(){var{inputs:e,isCustomColumnApplying:r,isSuccessShowing:n}=this.state,i=e.length>1?"Save Columns":"Save Column",o=e.every(l=>{var{name:u}=l;return u===""||Tr.isValidColumnName(u)}),a=e.filter(l=>{var{name:u}=l;return u!==""}).map(l=>{var{name:u}=l;return u}),s=new Set(a).size===a.length;return d.jsxs(L,{kind:n?"success":"primary",className:V("btn-apply",{"btn-spinner":r}),disabled:n||r||!o||!s,onClick:this.handleSaveClick,icon:n?Bn:void 0,children:[r&&d.jsxs("span",{children:[d.jsx(qt,{className:"mr-2 loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Applying"})]}),!n&&!r&&i,n&&"Success"]})}render(){var{onCancel:e}=this.props,{errorMessage:r}=this.state;return d.jsxs("div",{role:"presentation",className:"custom-column-builder-container",ref:n=>{this.container=n},onClick:this.resetRequestFailed,onFocus:this.resetRequestFailed,children:[d.jsx("hr",{}),d.jsx(br,{onDragStart:ge.startDragging,onDragEnd:this.handleDragEnd,children:d.jsx(Vt,{droppableId:"droppable-custom-columns",children:(n,i)=>d.jsxs("div",or(or({ref:n.innerRef},n.droppableProps),{},{className:V("droppable-container",{dragging:i.draggingFromThisWith}),children:[this.renderInputs(),n.placeholder]}))})}),d.jsx("div",{className:"pt-1 px-3",children:d.jsx(L,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,icon:wr,children:"Add Another Column"})}),d.jsxs("div",{className:"custom-column-builder-footer",children:[r&&d.jsx("div",{className:"error-message",children:r}),d.jsxs("div",{className:"d-flex justify-content-end",children:[d.jsx(L,{kind:"secondary",className:"mr-2",onClick:e,children:"Cancel"}),this.renderSaveButton()]})]})]})}}De(we,"SUCCESS_SHOW_DURATION",750);const iu=we;var mr;(function(t){t.ADVANCED_SETTINGS="ADVANCED_SETTINGS",t.AGGREGATIONS="AGGREGATIONS",t.AGGREGATION_EDIT="AGGREGATIONS_EDIT",t.CHART_BUILDER="CHART_BUILDER",t.CUSTOM_COLUMN_BUILDER="CUSTOM_COLUMN_BUILDER",t.QUICK_FILTERS="QUICK_FILTERS",t.ROLLUP_ROWS="ROLLUP_ROWS",t.SEARCH_BAR="SEARCH_BAR",t.SELECT_DISTINCT="SELECT_DISTINCT",t.TABLE_EXPORTER="TABLE_EXPORTER",t.VISIBILITY_ORDERING_BUILDER="VISIBILITY_ORDERING_BUILDER",t.CONDITIONAL_FORMATTING="CONDITIONAL_FORMATTING",t.CONDITIONAL_FORMATTING_EDIT="CONDITIONAL_FORMATTING_EDIT",t.GOTO="GOTO"})(mr||(mr={}));const ou=mr;function st(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function lt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?st(Object(r),!0).forEach(function(n){Oe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):st(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Oe(t,e,r){return e=Fo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fo(t){var e=ko(t,"string");return typeof e=="symbol"?e:String(e)}function ko(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var je=ue.module("RollupRows"),Go=150,Ue="grouped-rollup-rows",Be="ungrouped-rollup-rows";class q extends S.Component{static renderColumn(e){var{item:r,isClone:n,selectedCount:i}=e,o=r?.name,a=n!==void 0&&n?"".concat(i):void 0,s=n!==void 0&&n?"item-list-item-clone":"";return le.renderTextItem({text:o,badgeText:a,className:s})}static addGroupings(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length;if(r==null||r.length===0)return e;var i=n,o=e.filter((a,s)=>r.includes(a)?(s<i&&(i-=1),!1):!0);return o.splice(i,0,...r),o}static isGroupable(e){return!M.isBigDecimalType(e.type)&&!M.isBigIntegerType(e.type)}constructor(e){super(e),Oe(this,"ungroupedList",void 0),Oe(this,"groupedList",void 0),Oe(this,"search",Cr(a=>{for(var s=this.getSortedUngroupedColumns(),l=[],u=null,c=0;c<s.length;c+=1){var h=s[c];h.name.toLowerCase().includes(a.toLowerCase())&&(u==null&&(u=c),l.push([c,c]))}R(u),this.setState({ungroupedSelectedRanges:l}),l.length>0&&this.ungroupedList.current&&this.ungroupedList.current.scrollToItem(u)},Go)),Oe(this,"getCachedUngroupedColumns",Ce((a,s)=>a.filter(l=>q.isGroupable(l)&&s.find(u=>u===l.name)==null))),Oe(this,"getCachedSortedColumns",Ce((a,s)=>s==null?[...a]:M.sortColumns(a,s===q.SORT.ASCENDING))),this.handleDeleteClicked=this.handleDeleteClicked.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUngroupedSelect=this.handleUngroupedSelect.bind(this),this.handleUngroupedSelectionChange=this.handleUngroupedSelectionChange.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupedSelectionChange=this.handleGroupedSelectionChange.bind(this),this.handleShowConstituentsChange=this.handleShowConstituentsChange.bind(this),this.handleShowNonAggregatedColumnsChange=this.handleShowNonAggregatedColumnsChange.bind(this),this.handleSortAscending=this.handleSortAscending.bind(this),this.handleSortDescending=this.handleSortDescending.bind(this),this.renderGroupedItem=this.renderGroupedItem.bind(this),this.ungroupedList=dr.createRef(),this.groupedList=dr.createRef();var{config:r}=e,{columns:n=[],showConstituents:i=!0,showNonAggregatedColumns:o=!0}=r??{};this.state={ungroupedSelectedRanges:[],columns:n,groupedSelectedRanges:[],searchFilter:"",showConstituents:i,showNonAggregatedColumns:o,dragSource:null,sort:null}}componentDidUpdate(e,r){var{config:n}=this.props,{columns:i,showConstituents:o,showNonAggregatedColumns:a}=this.state;n!==e.config?this.updateFromConfig():(i!==r.columns||o!==r.showConstituents||a!==r.showNonAggregatedColumns)&&(n==null||i!==n.columns||o!==n.showConstituents||a!==n.showNonAggregatedColumns)&&this.sendChange()}componentWillUnmount(){this.search.cancel()}handleSearchChange(e){var r=e.target.value;if(this.setState({searchFilter:r}),!r){this.search.cancel(),this.resetSelection();return}this.search(r)}handleSortAscending(){this.setState(e=>{var{sort:r}=e;return{sort:r===q.SORT.ASCENDING?null:q.SORT.ASCENDING}})}handleSortDescending(){this.setState(e=>{var{sort:r}=e;return{sort:r===q.SORT.DESCENDING?null:q.SORT.DESCENDING}})}resetSelection(){this.setState({ungroupedSelectedRanges:[],groupedSelectedRanges:[]})}handleDragStart(e){je.debug("handleDragStart",e),document.documentElement.classList.add("drag-pointer-events-none"),this.setState({dragSource:e.source})}handleDragEnd(e){je.debug("handleDragEnd",e),document.documentElement.classList.remove("drag-pointer-events-none"),this.setState({dragSource:null});var{destination:r,source:n}=e;if(!(r==null||n==null)){if(r.droppableId===Be){this.setState(a=>{var{groupedSelectedRanges:s,columns:l}=a,u=[...l];return ge.reorder(u,s,[],0),{columns:u,ungroupedSelectedRanges:[],groupedSelectedRanges:[]}});return}var i=n.droppableId===Ue,o=r.index;i&&n.index<r.index&&(o+=1),this.setState(a=>{var{columns:s,ungroupedSelectedRanges:l,groupedSelectedRanges:u}=a,c=[...s],h=i?c:this.getSortedUngroupedColumns().map(g=>g.name),f=i?u:l,v=ge.reorder(h,f,c,o),m=i?ge.adjustDestinationIndex(o,u):o,p=[[m,m+v.length-1]];return{columns:c,ungroupedSelectedRanges:[],groupedSelectedRanges:p}}),this.resetSelection()}}handleUngroupedSelect(e){je.debug("handleUngroupedSelect"),this.setState(r=>{var{columns:n}=r;return{columns:q.addGroupings(n,[this.getSortedUngroupedColumns()[e].name]),ungroupedSelectedRanges:[],groupedSelectedRanges:[]}})}handleUngroupedSelectionChange(e){je.debug2("handleUngroupedSelectionChange",e),this.setState(r=>{var{ungroupedSelectedRanges:n}=r;return e===n?null:{ungroupedSelectedRanges:e,groupedSelectedRanges:[]}})}handleGroupedSelectionChange(e){je.debug2("handleGroupedSelectedRanges",e),this.setState(r=>{var{groupedSelectedRanges:n}=r;return e===n?null:{groupedSelectedRanges:e,ungroupedSelectedRanges:[]}})}handleDeleteClicked(e){this.setState(r=>{var{columns:n}=r,i=n.slice();return i.splice(e,1),{columns:i}})}handleShowConstituentsChange(){this.setState(e=>{var{showConstituents:r}=e;return{showConstituents:!r}})}handleShowNonAggregatedColumnsChange(){this.setState(e=>{var{showNonAggregatedColumns:r}=e;return{showNonAggregatedColumns:!r}})}updateFromConfig(){var{config:e}=this.props,{columns:r=[],showConstituents:n=!0,showNonAggregatedColumns:i=!0}=e??{};this.setState({columns:r,showConstituents:n,showNonAggregatedColumns:i})}sendChange(){var{onChange:e}=this.props,{columns:r,showConstituents:n,showNonAggregatedColumns:i}=this.state;e({columns:r,showConstituents:n,showNonAggregatedColumns:i})}getUngroupedColumns(){var{model:e}=this.props,{columns:r}=this.state,{originalColumns:n}=e;return this.getCachedUngroupedColumns(n,r)}getSortedUngroupedColumns(){var{sort:e}=this.state,r=this.getUngroupedColumns();return this.getCachedSortedColumns(r,e)}renderGroupedItem(e){var{item:r,itemIndex:n,isClone:i,selectedCount:o}=e,a=i!==void 0&&i?"":" ".repeat(n),s="".concat(a).concat(r),l=i!==void 0&&i?"".concat(o):void 0,u=i!==void 0&&i?"item-list-item-clone":"";return d.jsxs(d.Fragment,{children:[le.renderTextItem({text:s,badgeText:l,className:u}),(i===void 0||!i)&&d.jsx(L,{kind:"ghost",className:"btn btn-link btn-link-icon btn-delete-grouping float-right",onClick:()=>this.handleDeleteClicked(n),children:d.jsx(K,{icon:Ge})})]})}render(){var{columns:e,dragSource:r,searchFilter:n,groupedSelectedRanges:i,ungroupedSelectedRanges:o,showConstituents:a,showNonAggregatedColumns:s,sort:l}=this.state,u=this.getSortedUngroupedColumns(),c=e.length*le.DEFAULT_ROW_HEIGHT;r?.droppableId===Be&&(c+=le.DEFAULT_ROW_HEIGHT);var h=u.length*le.DEFAULT_ROW_HEIGHT+10,f=Math.min(3*le.DEFAULT_ROW_HEIGHT,h);return d.jsx("div",{role:"menu",className:V("rollup-rows",{"is-dragging":r!=null}),tabIndex:0,children:d.jsxs(br,{onDragEnd:this.handleDragEnd,onDragStart:this.handleDragStart,children:[d.jsxs("div",{className:"rollup-rows-group-by",children:[d.jsx("div",{className:"section-title",children:"Group By"}),e.length===0&&d.jsx(Vt,{droppableId:"placeholder",children:(v,m)=>d.jsx("div",lt(lt({className:V("placeholder","text-muted",{"is-dragging-from-this":m.draggingFromThisWith,"is-dragging-over":m.isDraggingOver,"is-dropping":m.draggingOverWith}),ref:v.innerRef},v.droppableProps),{},{children:"To create a rollup, drag columns from the list below and drop them into this area."}))}),e.length>0&&d.jsx(le,{draggingItemClassName:"rollup-rows-dragging-grouped-item",draggablePrefix:Ue,droppableId:Ue,itemCount:e.length,items:e,offset:0,onSelectionChange:this.handleGroupedSelectionChange,ref:this.groupedList,renderItem:this.renderGroupedItem,selectedRanges:i,style:{height:c},isMultiSelect:!0})]}),d.jsxs("div",{className:"rollup-rows-available-columns",children:[d.jsx("div",{className:"section-title",children:"Available Grouping Columns"}),d.jsxs("div",{className:"top-menu",children:[d.jsx(nn,{className:"w-100",value:n,matchCount:n?o.length:void 0,placeholder:"Find column...",onChange:this.handleSearchChange}),d.jsxs(L,{kind:"ghost",className:V("btn-link btn-link-icon",{active:l===q.SORT.ASCENDING}),onClick:this.handleSortAscending,children:[d.jsx(K,{icon:Or}),d.jsx(Xe,{children:"Sort ascending"})]}),d.jsxs(L,{kind:"ghost",className:V("btn-link btn-link-icon",{active:l===q.SORT.DESCENDING}),onClick:this.handleSortDescending,children:[d.jsx(K,{icon:yr}),d.jsx(Xe,{children:"Sort descending"})]})]}),d.jsx(le,{className:"rollup-available-grouping-columns",draggablePrefix:Be,droppableId:Be,itemCount:u.length,items:u,renderItem:q.renderColumn,offset:0,onSelect:this.handleUngroupedSelect,onSelectionChange:this.handleUngroupedSelectionChange,ref:this.ungroupedList,selectedRanges:o,style:{maxHeight:h,minHeight:f},isDropDisabled:r?.droppableId!==Ue,isMultiSelect:!0}),d.jsxs("div",{className:"bottom-menu",children:[d.jsx("div",{className:"label",children:"Show:"}),d.jsx(Pe,{checked:a,onChange:this.handleShowConstituentsChange,children:"Constituents"}),d.jsx(Pe,{checked:s,onChange:this.handleShowNonAggregatedColumnsChange,children:"Non-Aggregated Columns"})]})]})]})})}}Oe(q,"SORT",Object.freeze({ASCENDING:"ASC",DESCENDING:"DESC"}));Oe(q,"defaultProps",{config:null,onChange:()=>{}});const au=q;function ut(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(u){r(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Mo(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(l){ut(o,n,i,a,s,"next",l)}function s(l){ut(o,n,i,a,s,"throw",l)}a(void 0)})}}function dt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ct(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dt(Object(r),!0).forEach(function(n){xe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xe(t,e,r){return e=_o(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _o(t){var e=Lo(t,"string");return typeof e=="symbol"?e:String(e)}function Lo(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $o=ue.module("TableCsvExporter");class _ extends S.Component{static getDateString(e){return e.i18n.DateTimeFormat.format(_.FILENAME_DATE_FORMAT,new Date)}constructor(e){super(e),this.handleDownloadClick=this.handleDownloadClick.bind(this),this.handleDownloadRowOptionChanged=this.handleDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowOptionChanged=this.handleCustomizedDownloadRowOptionChanged.bind(this),this.handleCustomizedDownloadRowsChanged=this.handleCustomizedDownloadRowsChanged.bind(this),this.handleIncludeColumnHeadersChanged=this.handleIncludeColumnHeadersChanged.bind(this),this.handleIncludeHiddenColumnsChanged=this.handleIncludeHiddenColumnsChanged.bind(this),this.handleUseUnformattedValuesChanged=this.handleUseUnformattedValuesChanged.bind(this);var{model:r,name:n}=e;this.state={fileName:"".concat(n,"-").concat(_.getDateString(r.dh),".csv"),downloadRowOption:_.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,customizedDownloadRowOption:_.CUSTOMIZED_ROWS_OPTIONS.FIRST,customizedDownloadRows:_.DEFAULT_DOWNLOAD_ROWS,includeColumnHeaders:!0,includeHiddenColumns:!1,useUnformattedValues:!1,errorMessage:null,id:ke()}}getSnapshotRanges(){var{model:e,selectedRanges:r}=this.props,{downloadRowOption:n,customizedDownloadRowOption:i,customizedDownloadRows:o}=this.state,{rowCount:a,columnCount:s}=e,l=[];switch(n){case _.DOWNLOAD_ROW_OPTIONS.ALL_ROWS:l.push(new ne(0,0,s-1,a-1));break;case _.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS:l=r.map(u=>ct(ct({},u),{},{startColumn:0,endColumn:s-1})).sort((u,c)=>u.startRow!=null&&c.startRow!=null?u.startRow-c.startRow:0);break;case _.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS:switch(i){case _.CUSTOMIZED_ROWS_OPTIONS.FIRST:l.push(new ne(0,0,s-1,Math.min(o-1,a-1)));break;case _.CUSTOMIZED_ROWS_OPTIONS.LAST:l.push(new ne(0,Math.max(0,a-o),s-1,a-1));break}break}return l}getModelRanges(e){var{userColumnWidths:r,movedColumns:n}=this.props,{includeHiddenColumns:i}=this.state,o=Zt.getHiddenColumns(r),a=$.getModelRanges(e,n);if(!i&&o.length>0){var s=o.map(ne.makeColumn);a=ne.subtractRangesFromRanges(a,s)}return a}resetDownloadState(){this.setState({errorMessage:null})}handleDownloadClick(){var e=this;return Mo(function*(){var{model:r,isDownloading:n,onDownloadStart:i,onDownload:o,onCancel:a}=e.props,{fileName:s,includeColumnHeaders:l,useUnformattedValues:u}=e.state;if(n){a();return}e.resetDownloadState();var c=e.getSnapshotRanges(),h=e.getModelRanges(c);if(e.validateOptionInput()){i();try{var f=yield r.export(),v=f.setViewport(0,0);yield v.getViewportData(),o(s,f,v,c,h,l,u)}catch(m){$o.error("CSV download failed",m),e.setState({errorMessage:d.jsxs("p",{children:[d.jsx(K,{icon:Ke})," ","".concat(m)]})}),a()}}})()}handleDownloadRowOptionChanged(e){this.setState({downloadRowOption:e})}handleCustomizedDownloadRowOptionChanged(e){this.setState({customizedDownloadRowOption:e})}handleCustomizedDownloadRowsChanged(e){this.setState({customizedDownloadRows:parseInt(e.target.value,10)})}handleIncludeColumnHeadersChanged(){this.setState(e=>{var{includeColumnHeaders:r}=e;return{includeColumnHeaders:!r}})}handleIncludeHiddenColumnsChanged(){this.setState(e=>{var{includeHiddenColumns:r}=e;return{includeHiddenColumns:!r}})}handleUseUnformattedValuesChanged(){this.setState(e=>{var{useUnformattedValues:r}=e;return{useUnformattedValues:!r}})}validateOptionInput(){var{selectedRanges:e}=this.props,{downloadRowOption:r,customizedDownloadRows:n}=this.state;return r===_.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS&&e.length===0?(this.setState({errorMessage:d.jsxs("p",{children:[d.jsx(K,{icon:Ke})," No rows selected. Please select some rows in the table."]})}),!1):r===_.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS&&n<=0?(this.setState({errorMessage:d.jsxs("p",{children:[d.jsx(K,{icon:Ke})," Number of rows to output must be greater than 0"]})}),!1):!0}render(){var{model:e,isDownloading:r,tableDownloadProgress:n,tableDownloadEstimatedTime:i,selectedRanges:o,tableDownloadStatus:a}=this.props,{fileName:s,downloadRowOption:l,customizedDownloadRowOption:u,customizedDownloadRows:c,includeColumnHeaders:h,includeHiddenColumns:f,useUnformattedValues:v,errorMessage:m,id:p}=this.state,{rowCount:g}=e;return d.jsxs("div",{className:"table-csv-exporter",children:[d.jsx("div",{id:"download-rows-label",className:"section-title",children:"Download Rows"}),d.jsx("div",{className:"form-group",children:d.jsxs(pr,{"aria-labelledby":"download-rows-label",onChange:this.handleDownloadRowOptionChanged,value:l,isDisabled:r,children:[d.jsxs(Te,{value:_.DOWNLOAD_ROW_OPTIONS.ALL_ROWS,"data-testid":"radio-csv-exporter-download-all",children:["All Rows",d.jsx("span",{className:"text-muted ml-2",children:"(".concat(g.toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)")})]}),d.jsxs(Te,{value:_.DOWNLOAD_ROW_OPTIONS.SELECTED_ROWS,"data-testid":"radio-csv-exporter-only-selected",children:["Only Selected Rows",d.jsx("span",{className:"text-muted ml-2",children:o.length>0?"(".concat(ne.rowCount(o).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")," rows)"):null})]}),d.jsx(Te,{value:_.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS,"data-testid":"radio-csv-exporter-customized-rows",children:d.jsxs("div",{className:"radio-input-row",role:"presentation",onClick:()=>{this.setState({downloadRowOption:_.DOWNLOAD_ROW_OPTIONS.CUSTOMIZED_ROWS})},children:[d.jsxs(Ye,{value:u,"data-testid":"select-csv-exporter-customized-rows",className:"custom-select",disabled:r,onChange:this.handleCustomizedDownloadRowOptionChanged,children:[d.jsx("option",{value:"FIRST",children:"First"}),d.jsx("option",{value:"LAST",children:"Last"})]}),d.jsx("input",{type:"number",className:"form-control",id:"customizedRows-".concat(p),"data-testid":"input-csv-exporter-customized-rows",name:"customizedRows-".concat(p),placeholder:"100",value:c,disabled:r,onChange:this.handleCustomizedDownloadRowsChanged}),d.jsx("div",{children:"Rows"})]})})]})}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{htmlFor:"customizedRows-".concat(p),children:"File Name"}),d.jsx("input",{type:"text",className:"form-control",id:"filename-".concat(p),"data-testid":"input-csv-exporter-file-name",name:"filename-".concat(p),value:s,onChange:b=>{this.setState({fileName:b.target.value})},disabled:r})]}),d.jsxs("div",{className:"checkbox-options",children:[d.jsx(Pe,{checked:h,onChange:this.handleIncludeColumnHeadersChanged,children:"Include column headers"}),d.jsx(Pe,{checked:f,onChange:this.handleIncludeHiddenColumnsChanged,children:"Include hidden columns"}),d.jsx(Pe,{checked:v,onChange:this.handleUseUnformattedValuesChanged,children:"Use unformatted values"})]}),d.jsxs("div",{className:"section-footer flex-column",children:[m!=null&&d.jsx("div",{className:"error-message",children:m}),a&&d.jsxs("div",{className:"download-status",children:[(a===_.DOWNLOAD_STATUS.DOWNLOADING||a===_.DOWNLOAD_STATUS.INITIATING)&&d.jsxs(d.Fragment,{children:[a===_.DOWNLOAD_STATUS.INITIATING&&d.jsx("div",{className:"text-muted",children:"Starting Download..."}),a===_.DOWNLOAD_STATUS.DOWNLOADING&&d.jsxs("div",{className:"text-muted d-flex justify-content-between",children:[d.jsx("span",{children:i||i===0?"Estimated time: ".concat(Pi.formatElapsedTime(i)):null}),d.jsx("span",{children:"".concat(n,"%")})]})]}),a===_.DOWNLOAD_STATUS.FINISHED&&d.jsx("div",{className:"text-muted text-right",children:"Download Completed"}),a===_.DOWNLOAD_STATUS.CANCELED&&d.jsx("div",{className:"text-muted",children:"Download Canceled"}),(a===_.DOWNLOAD_STATUS.DOWNLOADING||a===_.DOWNLOAD_STATUS.INITIATING)&&d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar progress-bar-striped progress-bar-animated",style:{width:"".concat(n,"%")}})}),a===_.DOWNLOAD_STATUS.FINISHED&&d.jsx("div",{className:"progress",children:d.jsx("div",{className:"progress-bar bg-success",style:{width:"".concat(n,"%")}})})]}),d.jsxs(L,{kind:"primary","data-testid":"btn-csv-exporter-download",className:V("btn-downloading",{"btn-spinner btn-cancelable":r}),onClick:this.handleDownloadClick,children:[r&&d.jsxs("span",{children:[d.jsx(qt,{className:"mr-2 loading-spinner-vertical-align"}),d.jsx("span",{className:"btn-normal-content",children:"Downloading"}),d.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!r&&"Download"]})]})]})}}xe(_,"FILENAME_DATE_FORMAT","yyyy-MM-dd-HHmmss");xe(_,"DOWNLOAD_STATUS",{INITIATING:"INITIATING",DOWNLOADING:"DOWNLOADING",FINISHED:"FINISHED",CANCELED:"CANCELED"});xe(_,"DOWNLOAD_ROW_OPTIONS",{ALL_ROWS:"ALL_ROWS",SELECTED_ROWS:"SELECTED_ROWS",CUSTOMIZED_ROWS:"CUSTOMIZED_ROWS"});xe(_,"CUSTOMIZED_ROWS_OPTIONS",{FIRST:"FIRST",LAST:"LAST"});xe(_,"DEFAULT_DOWNLOAD_ROWS",100);xe(_,"defaultProps",{onDownloadStart:()=>{},isDownloading:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:null,selectedRanges:[]});const su=_;function U(t,e,r){return e=Uo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Uo(t){var e=Bo(t,"string");return typeof e=="symbol"?e:String(e)}function Bo(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var fe=ue.module("TableSaver"),Ho="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function Wo(t){return t.added!==void 0}function Vo(t){if(!Wo(t))throw new Error("event is not UpdateEventData")}class te extends S.PureComponent{static csvEscapeString(e){return'"'.concat(e.replace(/"/g,'""'),'"')}constructor(e){super(e),U(this,"sw",void 0),U(this,"port",void 0),U(this,"fileWriter",void 0),U(this,"table",void 0),U(this,"tableSubscription",void 0),U(this,"columns",void 0),U(this,"fileName",void 0),U(this,"includeColumnHeaders",void 0),U(this,"useUnformattedValues",void 0),U(this,"chunkRows",void 0),U(this,"gridRanges",void 0),U(this,"gridRangeCounter",void 0),U(this,"rangedSnapshotsTotal",void 0),U(this,"rangedSnapshotCounter",void 0),U(this,"snapshotsTotal",void 0),U(this,"snapshotCounter",void 0),U(this,"snapshotsBuffer",void 0),U(this,"currentSnapshotIndex",void 0),U(this,"snapshotPending",void 0),U(this,"cancelableSnapshots",void 0),U(this,"streamTimeout",void 0),U(this,"snapshotHandlerTimeout",void 0),U(this,"downloadStartTime",void 0),U(this,"iframe",void 0),U(this,"useBlobFallback",void 0),U(this,"getCachedCustomColumnFormatFlag",an(Gi.isCustomColumnFormatDefined,{max:1e4})),this.handlePortMessage=this.handlePortMessage.bind(this),this.handleSnapshotResolved=this.handleSnapshotResolved.bind(this),this.handleDownloadTimeout=this.handleDownloadTimeout.bind(this),this.state={},this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.useBlobFallback=!1}componentDidMount(){var{getDownloadWorker:e}=this.props;e().then(r=>{fe.info("found active service worker"),this.sw=r,this.sw.postMessage("ping")}).catch(r=>{fe.warn("Download csv is not optimized.",r),this.useBlobFallback=!0})}componentWillUnmount(){this.removeIframe(),this.streamTimeout&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout&&clearTimeout(this.snapshotHandlerTimeout)}createWriterStream(e){var r=this.useBlobFallback,n=[],i=null;r&&(i=TextEncoder.prototype.encode.bind(new TextEncoder));var{fileName:o}=this,a={};return r?(a.write=s=>{R(i),s.header!==void 0&&n.push(i(s.header)),s.rows!==void 0&&n.push(i(s.rows))},a.close=()=>{R(o);var s=new Blob(n,{type:"application/octet-stream; charset=utf-8"}),l=document.createElement("a");l.href=URL.createObjectURL(s),l.download=o,l.click()},a.abort=()=>{e.postMessage({cancel:!0}),e.close()}):(a.write=s=>{e.postMessage(s)},a.close=()=>{e.postMessage({end:!0}),e.close()},a.abort=()=>{e.postMessage({cancel:!0}),e.close()}),new WritableStream(a)}startDownload(e,r,n,i,o,a,s){var{isDownloading:l}=this.props;if(!l){this.downloadStartTime=Date.now(),fe.info("start downloading ".concat(e)),this.table=r,this.columns=Zt.columnsFromRanges(o,r.columns),this.tableSubscription=n,this.gridRanges=i,this.includeColumnHeaders=a,this.useUnformattedValues=s;var u=encodeURIComponent(e.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A"),c=new MessageChannel;if(this.port=c.port1,this.fileName=e,this.fileWriter=this.createWriterStream(this.port).getWriter(),this.useBlobFallback){this.writeCsvTable(a);return}this.sw&&this.sw.postMessage({encodedFileName:u},[c.port2]),this.port.onmessage=this.handlePortMessage}}finishDownload(){this.table&&this.table.close(),this.tableSubscription&&this.tableSubscription.close(),this.fileWriter&&this.fileWriter.close();var{onDownloadCompleted:e}=this.props;e(),this.resetTableSaver(),this.downloadStartTime!==void 0&&fe.info("download finished, total elapsed time ".concat((Date.now()-this.downloadStartTime)/1e3," seconds"))}cancelDownload(){var e,r,n;(e=this.table)===null||e===void 0||e.close(),(r=this.tableSubscription)===null||r===void 0||r.close(),(n=this.fileWriter)===null||n===void 0||n.abort(),this.cancelableSnapshots.forEach(o=>{o&&(o.catch(()=>null),o.cancel())});var{onDownloadCanceled:i}=this.props;i(),this.resetTableSaver()}resetTableSaver(){this.table=void 0,this.tableSubscription=void 0,this.columns=void 0,this.chunkRows=void 0,this.removeIframe(),this.gridRanges=[],this.gridRangeCounter=0,this.rangedSnapshotsTotal=[],this.rangedSnapshotCounter=0,this.includeColumnHeaders=!0,this.useUnformattedValues=!1,this.snapshotsTotal=0,this.snapshotCounter=0,this.snapshotsBuffer=new Map,this.currentSnapshotIndex=0,this.snapshotPending=0,this.cancelableSnapshots=[],this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.snapshotHandlerTimeout!=null&&clearTimeout(this.snapshotHandlerTimeout),this.streamTimeout=void 0,this.snapshotHandlerTimeout=void 0}handleDownloadTimeout(){fe.info("download canceled"),this.cancelDownload()}writeTableHeader(){var e,r="";if(this.columns)for(var n=0;n<this.columns.length;n+=1)r+=this.columns[n].name,r+=n===this.columns.length-1?`
|
|
2
|
-
`:",";(e=this.fileWriter)===null||e===void 0||e.write({header:r}).then(()=>null)}startWriteTableBody(){this.columns&&this.gridRanges!=null&&(this.chunkRows=Math.floor(te.DOWNLOAD_CELL_CHUNK/this.columns.length),this.rangedSnapshotsTotal=this.gridRanges.map(e=>(R(e.endRow),R(e.startRow),R(this.chunkRows),Math.ceil((e.endRow-e.startRow+1)/this.chunkRows))),this.snapshotsTotal=this.rangedSnapshotsTotal.reduce((e,r)=>e+r),fe.info("start writing table, total snapshots: ",this.snapshotsTotal),this.makeSnapshot(Math.min(te.SNAPSHOT_BUFFER_SIZE,this.snapshotsTotal)))}writeCsvTable(e){e&&this.writeTableHeader(),this.startWriteTableBody()}writeSnapshot(e,r,n){if(this.currentSnapshotIndex===e&&this.fileWriter){for(;this.snapshotsBuffer.has(this.currentSnapshotIndex);){var i=this.snapshotsBuffer.get(this.currentSnapshotIndex);R(i),this.fileWriter.write({rows:this.convertSnapshotIntoCsv(i)}),this.snapshotsBuffer.delete(this.currentSnapshotIndex),this.currentSnapshotIndex+=1,this.updateDownloadProgress(e)}if(this.snapshotsTotal&&this.currentSnapshotIndex>=this.snapshotsTotal){this.finishDownload();return}}this.snapshotCounter&&this.snapshotsTotal&&this.snapshotCounter<this.snapshotsTotal&&(fe.debug2(`
|
|
3
|
-
current range index: `.concat(this.gridRangeCounter,`,
|
|
4
|
-
snapshotIndexCounter: `).concat(this.snapshotCounter,`,
|
|
5
|
-
currentRangedSnapshotIndex : `).concat(this.rangedSnapshotCounter,`,
|
|
6
|
-
snapshotpending: `).concat(this.snapshotPending,`,
|
|
7
|
-
buffered `).concat(this.snapshotsBuffer.size,`
|
|
8
|
-
making `).concat(Math.min(te.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter),` more snapshots
|
|
9
|
-
`)),this.makeSnapshot(Math.min(te.SNAPSHOT_BUFFER_SIZE-this.snapshotsBuffer.size-this.snapshotPending,this.snapshotsTotal-this.snapshotCounter)))}updateDownloadProgress(e){if(e!=null&&this.snapshotsTotal!=null&&this.downloadStartTime!=null){var{onDownloadProgressUpdate:r}=this.props,n=Math.floor(e*100/this.snapshotsTotal),i=e>1?Math.floor((Date.now()-this.downloadStartTime)*(this.snapshotsTotal-e)/e/1e3):null;r(n,i)}}convertSnapshotIntoCsv(e){for(var r="",n=e.added.iterator(),{dh:i,formatter:o}=this.props,a=[];n.hasNext();)a.push(n.next().value);R(this.columns);for(var{useUnformattedValues:s}=this,l=0;l<a.length;l+=1)for(var u=a[l],c=0;c<this.columns.length;c+=1){var{type:h,name:f}=this.columns[c],v=null;if(s){var m,p=(m=e.getData(u,this.columns[c]))!==null&&m!==void 0?m:"";p!==""&&M.isDateType(h)&&(p=i.i18n.DateTimeFormat.format(Ho,p,i.i18n.TimeZone.getTimeZone(o.timeZone))),v=p.toString()}else{var g=this.getCachedCustomColumnFormatFlag(o,f,h),b=null;if(!g){var O=e.getFormat(u,this.columns[c]);b=O?.formatString!=null?O:null}b?v=o.getFormattedString(e.getData(u,this.columns[c]),h,f,b):v=o.getFormattedString(e.getData(u,this.columns[c]),h,f)}r+=te.csvEscapeString(v),r+=c===this.columns.length-1?`
|
|
10
|
-
`:","}return r}makeSnapshot(e){var r=this;if(!(e<=0)){var{dh:n}=this.props;R(this.gridRangeCounter);var i=0,o=this.gridRanges[this.gridRangeCounter];R(this.tableSubscription),R(this.columns);for(var a=function(){R(o),R(o.startRow),R(o.endRow),R(r.rangedSnapshotCounter),R(r.chunkRows);var l=o.startRow+r.rangedSnapshotCounter*r.chunkRows,u=Math.min(l+r.chunkRows-1,o.endRow),c=r.snapshotCounter;r.cancelableSnapshots.push(xi.makeCancelable(r.tableSubscription.snapshot(n.RangeSet.ofRange(l,u),r.columns).then(h=>(Vo(h),r.handleSnapshotResolved(h,c,l,u),c)).catch(h=>{fe.error(h)}),h=>{fe.info("snapshot ".concat(h," has been canceled"))})),r.rangedSnapshotCounter+=1,r.snapshotCounter+=1,r.snapshotPending+=1,r.rangedSnapshotCounter>=r.rangedSnapshotsTotal[r.gridRangeCounter]&&(r.gridRangeCounter+=1,r.rangedSnapshotCounter=0,o=r.gridRanges[r.gridRangeCounter]),i+=1};i<e;)a()}}handlePortMessage(e){var{data:r}=e,{download:n,readableStreamPulling:i}=r;if(!this.useBlobFallback){if(n!=null){var{includeColumnHeaders:o}=this;this.makeIframe("".concat(n)),this.writeCsvTable(o)}i!=null&&(this.useBlobFallback||(this.streamTimeout!=null&&clearTimeout(this.streamTimeout),this.streamTimeout=setTimeout(this.handleDownloadTimeout,te.STREAM_TIMEOUT)))}}handleSnapshotResolved(e,r,n,i){this.snapshotHandlerTimeout=setTimeout(()=>{this.snapshotsBuffer.set(r,e),this.snapshotPending-=1,this.writeSnapshot(r,n,i),this.cancelableSnapshots[r]=null},te.SNAPSHOT_HANDLER_TIMEOUT)}makeIframe(e){var r=document.createElement("iframe");r.hidden=!0,r.src=e,r.name="iframe",document.body.appendChild(r),this.iframe=r}removeIframe(){var e;(e=this.iframe)===null||e===void 0||e.remove(),this.iframe=void 0}render(){return null}}U(te,"DOWNLOAD_CELL_CHUNK",6e3);U(te,"SNAPSHOT_BUFFER_SIZE",5);U(te,"STREAM_TIMEOUT",8e3);U(te,"SNAPSHOT_HANDLER_TIMEOUT",5);U(te,"defaultProps",{isDownloading:!1,onDownloadCompleted:()=>{},onDownloadCanceled:()=>{},onDownloadProgressUpdate:()=>{}});function zo(t){var e,{group:r,onDelete:n,onColorChange:i,onNameChange:o,validateName:a}=t,{isNew:s}=r,l=S.useRef(r),u=S.useRef(null),c=S.useRef(null),[h,f]=S.useState(!1),[v,m]=S.useState(s?"":r.name),[p,g]=S.useState(s),[b,O]=S.useState(!1),C=v!==r.name?a(v):"",y=s&&!b||C==="",T=S.useCallback(()=>{f(!1)},[]);S.useEffect(function(){p&&u.current&&(u.current.focus(),u.current.select())},[p]),S.useEffect(function(){return()=>{l.current.isNew&&n(l.current)}},[n]),S.useEffect(function(){if(h){var I,N;(I=c.current)===null||I===void 0||I.click(),(N=c.current)===null||N===void 0||N.focus(),window.addEventListener("click",T,!0)}return()=>window.removeEventListener("click",T,!0)},[h,T]);var P=()=>{y&&(o(r,v),g(!1))},j=()=>{if(s){n(r);return}m(r.name),g(!1)},D=x=>{O(!0),x.key==="Enter"&&(x.stopPropagation(),P()),x.key===" "&&x.stopPropagation(),x.key==="Escape"&&j()};return p?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"editing-container",children:[d.jsx("input",{ref:u,className:V("form-control",{"is-invalid":!y}),value:v,placeholder:"Group Name",onChange:x=>m(x.target.value),onKeyDown:D,onBlur:()=>O(!0)}),d.jsx(L,{kind:"ghost",icon:vr,tooltip:"Confirm",onClick:P}),d.jsx(L,{kind:"ghost",icon:Hn,tooltip:"Cancel",onClick:j})]}),!y&&d.jsx("p",{className:"mb-0 validate-label-error text-danger",children:C})]}):d.jsxs("div",{className:"group-name-wrapper",children:[d.jsx("span",{className:"column-name",children:v}),d.jsx(L,{className:"p-1 mx-1",kind:"ghost",icon:zt,tooltip:"Edit",onClick:()=>{g(!0)}}),d.jsxs("span",{className:"right-buttons",children:[d.jsx(L,{kind:"ghost",icon:Ge,tooltip:"Delete group",onClick:()=>n(r)}),d.jsx(L,{kind:"ghost",className:"color-swatch mr-1",icon:r.color!==void 0?d.jsxs("span",{className:"fa-layers",children:[d.jsx(K,{className:"color-swatch",icon:jr,color:J.white,transform:"down-1"}),d.jsx(K,{className:"color-swatch",icon:jr,color:r.color,transform:"shrink-2 down-1"})]}):Wn,tooltip:"Set color",onClick:()=>f(x=>!x)}),h&&d.jsxs(d.Fragment,{children:[d.jsx("input",{"aria-label":"Color input",ref:c,type:"color",list:"presetColors",value:(e=r.color)!==null&&e!==void 0?e:J["content-bg"],style:{visibility:"hidden",width:0,height:0,padding:0,border:0},onChange:x=>{r.color=x.target.value,i(r,x.target.value)}}),d.jsxs("datalist",{id:"presetColors",children:[d.jsx("option",{children:J["content-bg"]}),d.jsx("option",{children:J.primary}),d.jsx("option",{children:J.foreground}),d.jsx("option",{children:J.green}),d.jsx("option",{children:J.yellow}),d.jsx("option",{children:J.orange}),d.jsx("option",{children:J.red}),d.jsx("option",{children:J.purple}),d.jsx("option",{children:J.blue}),d.jsx("option",{children:J["gray-400"]})]})]})]})]})}function ht(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function vt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ht(Object(r),!0).forEach(function(n){Ko(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ht(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ko(t,e,r){return e=Qo(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qo(t){var e=qo(t,"string");return typeof e=="symbol"?e:String(e)}function qo(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Yo(){}var Xo=S.forwardRef(function(e,r){var{value:n,clone:i,childCount:o,item:a,onVisibilityChange:s,onClick:l,onGroupDelete:u,onGroupColorChange:c,onGroupNameChange:h,validateGroupName:f,handleProps:v}=e,{group:m,modelIndex:p,isVisible:g}=a.data,b=S.useRef(null),O=S.useCallback(y=>{if(y.buttons===1){var T;s([p].flat(),!g),(T=b.current)===null||T===void 0||T.focus()}},[s,p,g]),C=S.useCallback(y=>{l(n,y)},[l,n]);return d.jsxs("div",vt(vt({ref:r,className:V("tree-item",{isSelected:a.selected,"two-dragged":o===2,"multiple-dragged":o>2}),onClick:C},v),{},{children:[d.jsx(L,{ref:b,kind:"ghost",className:"px-1",onClick:Yo,onMouseDown:O,onMouseEnter:O,icon:g?Yt:Xt,tooltip:"Toggle visibility"}),d.jsx("span",{className:V("column-name",m&&"column-group"),children:m&&!i?d.jsx(zo,{group:m,onDelete:u,onColorChange:c,onNameChange:h,validateName:f}):n}),d.jsxs("div",{children:[i&&o>1&&d.jsx("span",{className:"item-count",children:o}),d.jsx(Xe,{children:"Drag to re-order"}),d.jsx(K,{icon:Qt})]})]}))});const Zo=Xo;function Jo(t){return t.parentId!==void 0}function mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ft(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mt(Object(r),!0).forEach(function(n){ea(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ea(t,e,r){return e=ra(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ra(t){var e=ta(t,"string");return typeof e=="symbol"?e:String(e)}function ta(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function na(t,e){return Math.round(t/e)}function ln(t,e,r,n,i,o){var a=t.findIndex(u=>u.name===n);if(a===-1){var s=r.get(n);if(s==null)throw new Error("Column or header group not found: ".concat(n));var l=s.childIndexes.flat();return{id:n,selected:o.has(n),children:s.children.map(u=>ln(t,e,r,u,i,o)).sort((u,c)=>{var h=Array.isArray(u.data.visibleIndex)?u.data.visibleIndex[0]:u.data.visibleIndex,f=Array.isArray(c.data.visibleIndex)?c.data.visibleIndex[0]:c.data.visibleIndex;return h-f}),data:{modelIndex:l,visibleIndex:s.getVisibleRange(e),group:s,isVisible:l.some(u=>!i.has(u))}}}return{id:n,children:[],selected:o.has(n),data:{modelIndex:a,visibleIndex:$.getVisibleIndex(a,e),isVisible:!i.has(a)}}}function ia(t,e,r,n,i){for(var o=[],a=new Set(i),s=new Map(r.map(h=>[h.name,h])),l=new Set(n),u=0,c=function(){for(var f=$.getModelIndex(u,e),v=t[f].name,m=r.find(g=>{var{children:b}=g;return b.includes(v)});m!==void 0&&m.parent!==void 0;)m=s.get(m.parent);var p=ln(t,e,s,m?m.name:v,l,a);o.push(p),Array.isArray(p.data.visibleIndex)?u+=p.data.visibleIndex[1]-p.data.visibleIndex[0]+1:u+=1};u<t.length;)c();return o}function Je(t,e,r,n,i){var o=t.findIndex(b=>{var{id:O}=b;return O===r}),a=t.findIndex(b=>{var{id:O}=b;return O===e}),s=t[a],l=yn(t,a,o),u=l[o-1],c=l[o+1],h=na(n,i),f=s.depth+h,v=oa({previousItem:u,nextItem:c}),m=aa({nextItem:c}),p=f;return f>=v?p=v:f<m&&(p=m),{depth:p,maxDepth:v,minDepth:m,parentId:g()};function g(){var b;if(p===0||!u)return null;if(p===u.depth)return u.parentId;if(p>u.depth)return u.id;var O=(b=l.slice(0,o).reverse().find(C=>C.depth===p))===null||b===void 0?void 0:b.parentId;return O??null}}function oa(t){var e,r,{previousItem:n,nextItem:i}=t;return Math.max((e=n?.depth)!==null&&e!==void 0?e:0,(r=i?.depth)!==null&&r!==void 0?r:0)}function aa(t){var{nextItem:e}=t;return e?e.depth:0}function un(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return t.reduce((n,i,o)=>[...n,ft(ft({},i),{},{parentId:e,depth:r,index:o}),...un(i.children,i.id,r+1)],[])}function ee(t){return t.every(Jo)?[...t]:un(t)}function dn(t,e){for(var r=0;r<t.length;r+=1){var n=t[r],{id:i,children:o}=n;if(i===e)return n;if(o.length){var a=dn(o,e);if(a)return a}}}function cn(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return t.reduce((r,n)=>{var{children:i}=n;return i.length?cn(i,r+1):r+1},e)}function sa(t,e){var r=dn(t,e);return r?cn(r.children):0}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function He(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?gt(Object(r),!0).forEach(function(n){la(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function la(t,e,r){return e=ua(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ua(t){var e=da(t,"string");return typeof e=="symbol"?e:String(e)}function da(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ca=[he.Down,he.Right,he.Up,he.Left],ha=[he.Left,he.Right];function va(t,e,r){return(n,i)=>{var{currentCoordinates:o,context:{active:a,over:s,collisionRect:l,droppableRects:u,droppableContainers:c}}=i;if(ca.includes(n.code)){if(!a||!l)return;n.preventDefault();var{current:{items:h,offset:f}}=t;if(ha.includes(n.code)&&s?.id!=null){var{depth:v,maxDepth:m,minDepth:p}=Je(h,a.id,s.id,f,r);switch(n.code){case he.Left:if(v>p)return He(He({},o),{},{x:o.x-r});break;case he.Right:if(v<m)return He(He({},o),{},{x:o.x+r});break}return}var g=[];c.forEach(G=>{if(!(G!=null&&G.disabled||G.id===s?.id)){var H=u.get(G.id);if(H)switch(n.code){case he.Down:l.top<H.top&&g.push(G);break;case he.Up:l.top>H.top&&g.push(G);break}}});var b=Tn({active:a,collisionRect:l,pointerCoordinates:null,droppableRects:u,droppableContainers:g}),O=Pn(b,"id");if(O===s?.id&&b.length>1&&(O=b[1].id),O!=null&&s?.id!=null){var C=u.get(a.id),y=u.get(O),T=c.get(O);if(C&&y&&T){var P=h.findIndex(G=>{var{id:H}=G;return H===O}),j=h[P],D=h.findIndex(G=>{var{id:H}=G;return H===a.id}),x=h[D];if(j!=null&&x!=null){var{depth:I}=Je(h,a.id,O,(j.depth-x.depth)*r,r),N=P>D,E=N?1:-1,k=e?(l.height-C.height)/2:0,F={x:y.left+I*r,y:y.top+E*k};return F}}}}}}function ma(t,e,r){return e=fa(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fa(t){var e=ga(t,"string");return typeof e=="symbol"?e:String(e)}function ga(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class hn extends xn{}ma(hn,"activators",[{eventName:"onPointerDown",handler:t=>{var{nativeEvent:e}=t;return!(!e.isPrimary||e.button!==0||ba(e.target))}}]);var pa=["button","input","textarea","select","option"];function ba(t){return!!(t?.tagName!=null&&pa.includes(t.tagName.toLowerCase()))}function vn(t){var{clone:e=!1,depth:r,disableInteraction:n=!1,ghost:i=!1,handleProps:o,value:a,dragRef:s=null,wrapperRef:l=null,renderItem:u,item:c,childCount:h}=t,f=S.useMemo(()=>Array(r).fill(0).map((m,p)=>d.jsx("span",{className:"depth-line"},"depth-line-".concat(p))),[r]),v=S.useMemo(()=>({ref:s,clone:e,value:a,item:c,childCount:h,handleProps:o}),[s,e,a,c,h,o]);return d.jsxs("li",{className:V("item-wrapper",{clone:e,ghost:i,disableInteraction:n}),ref:l,children:[!e&&f,u(v)]},a)}vn.displayName="TreeItem";var Ca=["id","depth"];function pt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function We(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pt(Object(r),!0).forEach(function(n){Sa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Sa(t,e,r){return e=wa(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wa(t){var e=Oa(t,"string");return typeof e=="symbol"?e:String(e)}function Oa(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ya(t,e){if(t==null)return{};var r=Ta(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Ta(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var Pa=t=>{var{isSorting:e,wasDragging:r}=t;return!(e||r)};function bt(t){var{id:e,depth:r}=t,n=ya(t,Ca),{attributes:i,isDragging:o,isSorting:a,listeners:s,setDraggableNodeRef:l,setDroppableNodeRef:u,transform:c,transition:h}=En({id:e,animateLayoutChanges:Pa}),f=cr.Translate.toString(c),v=S.useMemo(()=>({transform:f,transition:h}),[f,h]),m=S.useMemo(()=>We(We(We({},i),s),{},{style:v}),[i,s,v]);return d.jsx(vn,We({dragRef:l,wrapperRef:u,depth:r,ghost:o,disableInteraction:a,handleProps:m},n))}function Ct(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function er(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ct(Object(r),!0).forEach(function(n){xa(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ct(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xa(t,e,r){return e=Ea(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ea(t){var e=Na(t,"string");return typeof e=="symbol"?e:String(e)}function Na(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Da={keyframes(t){var{transform:e}=t;return[{opacity:1,transform:cr.Transform.toString(e.initial)},{opacity:0,transform:cr.Transform.toString(er(er({},e.final),{},{x:e.final.x+5,y:e.final.y+5}))}]},easing:"ease-out",sideEffects(t){var{active:e}=t;e.node.animate([{opacity:0},{opacity:1}],{duration:Nr.duration,easing:Nr.easing})}},Ve=null;function Ia(t){var e;return Ve==null&&t.activeNodeRect&&t.activatorEvent instanceof PointerEvent&&(Ve=Math.floor((t.activatorEvent.clientY-t.activeNodeRect.top)/t.activeNodeRect.height)*t.activeNodeRect.height),t.activeNodeRect||(Ve=null),er(er({},t.transform),{},{y:t.transform.y+((e=Ve)!==null&&e!==void 0?e:0)})}function ja(t){var{items:e,renderItem:r,indentationWidth:n=30,indicator:i=!1,activeId:o,overId:a,offsetLeft:s}=t,l=Nn(),u=S.useRef(l);S.useEffect(function(){u.current=l},[l]),S.useEffect(function(){u.current.measureDroppableContainers(e.map(m=>{var{id:p}=m;return p}))},[e]);var c=o!=null&&a!=null?Je(e,o,a,s,n):null,h=S.useRef({items:e,offset:s}),f=o!=null?e.find(v=>{var{id:m}=v;return m===o}):null;return S.useEffect(()=>{h.current={items:e,offset:s}},[e,s]),d.jsxs(d.Fragment,{children:[d.jsx("div",{className:V("tree-container",o!=null&&"marching-ants"),children:e.map(v=>{var{id:m,depth:p}=v;return d.jsx(bt,{id:m,value:m,depth:m===o&&c?c.depth:p,item:v,renderItem:r},m)})}),Dn.createPortal(d.jsx(In,{dropAnimation:Da,modifiers:[Ia],className:"visibility-ordering-list",children:o!=null&&f?d.jsx(bt,{id:o,depth:f.depth,clone:!0,childCount:sa(e,o)+1,value:o.toString(),renderItem:r,item:f}):null}),document.body)]})}function St(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ze(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(n){Ra(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ra(t,e,r){return e=Aa(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Aa(t){var e=Fa(t,"string");return typeof e=="symbol"?e:String(e)}function Fa(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ka={droppable:{strategy:Gn.Always}},Ga={activationConstraint:{distance:5}};function Ma(t){var{items:e,indicator:r=!1,indentationWidth:n=30,onDragStart:i,onDragEnd:o,renderItem:a}=t,[s,l]=S.useState(null),[u,c]=S.useState(null),[h,f]=S.useState(0),v=S.useMemo(()=>{var x=ee(e);return s!=null?x.filter(I=>{var{id:N,selected:E}=I;return N===s||!E}):x},[s,e]),m=s!=null&&u!=null?Je(v,s,u,h,n):null,p=S.useRef({items:v,offset:h}),g=S.useMemo(()=>({coordinateGetter:va(p,r,n)}),[n,r]),b=jn(Dr(hn,Ga),Dr(Mn,g)),O=S.useMemo(()=>v.map(x=>{var{id:I}=x;return I}),[v]);S.useEffect(()=>{p.current={items:v,offset:h}},[v,h]);var C=S.useCallback(x=>{var{active:{id:I}}=x;l(I),c(I),i?.(I),document.body.style.setProperty("cursor","grabbing")},[i]),y=S.useCallback(x=>{var{delta:I}=x;f(I.x)},[]),T=S.useCallback(x=>{var I,{over:N}=x;c((I=N?.id)!==null&&I!==void 0?I:null)},[]),P=S.useCallback(()=>{c(null),l(null),f(0),document.body.style.setProperty("cursor","")},[]),j=S.useCallback(x=>{var{active:I,over:N}=x;if(P(),m&&N){var{depth:E,parentId:k}=m,F=JSON.parse(JSON.stringify(ee(e))),G=F.findIndex(z=>{var{id:ve}=z;return ve===N.id}),H=F.findIndex(z=>{var{id:ve}=z;return ve===I.id}),B=F[H];F[H]=ze(ze({},B),{},{depth:E,parentId:k}),o?.(B,ze(ze({},F[G]),{},{parentId:m.parentId}))}},[e,o,m,P]),D=S.useCallback(()=>{P()},[P]);return d.jsx(Rn,{sensors:b,collisionDetection:An,measuring:ka,onDragStart:C,onDragMove:y,onDragOver:T,onDragEnd:j,onDragCancel:D,children:d.jsx(Fn,{items:O,strategy:kn,children:d.jsx(ja,{items:v,renderItem:a,indicator:r,indentationWidth:n,activeId:s,overId:u,offsetLeft:h})})})}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(n){_a(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _a(t,e,r){return e=La(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function La(t){var e=$a(t,"string");return typeof e=="symbol"?e:String(e)}function $a(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ua(t,e,r,n,i,o,a,s){var l=i.map((y,T)=>Ot(Ot({},y),{},{index:T})),u=[],c=n,h=o[0].data.visibleIndex,f=l.findIndex(y=>{var{id:T}=y;return T===t.id}),v=l.findIndex(y=>{var{id:T}=y;return T===e.id}),m=Array.isArray(h)?h[1]+1:h+1;c=Se(o[0],e.parentId,c);for(var p=1;p<o.length;p+=1){var{data:{visibleIndex:g}}=o[p];u=$.moveItemOrRange(g,m,u,!0),m+=Array.isArray(g)?g[1]-g[0]+1:1,c=Se(o[p],e.parentId,c)}var b=[Array.isArray(h)?h[0]:h,m-1],O=Array.isArray(e.data.visibleIndex)?e.data.visibleIndex[0]:e.data.visibleIndex,C=$.getVisibleIndex(O,u);return f>v&&C>O&&(C-=1),e.children.length>0&&(Array.isArray(h)?h[0]:h)<C&&(C-=1),b[0]<C&&(C-=b[1]-b[0]),u=$.moveItemOrRange(b,hr(C,a,s),u),{groups:c,movedColumns:r.concat(u)}}function Se(t,e,r){if(t.parentId===e)return[...r];var n=r.map(g=>new ye(g)),i=new Map(n.map(g=>[g.name,g])),o=n.find(g=>g.name===t.parentId),a=n.find(g=>g.name===e),s=n.find(g=>g.name===t.id);if(o!=null&&(o.children=o.children.filter(g=>g!==t.id),o.children.length===0)){var l,u=new Set([o.name]),{parent:c=""}=o,h=i.get(c);for((l=h)===null||l===void 0||l.removeChildren([o.name]);h&&h.children.length===0;){var f,v;u.add(h.name);var m=(f=(v=h)===null||v===void 0?void 0:v.parent)!==null&&f!==void 0?f:"",p=i.get(m);p?.removeChildren([h.name]),h=p}n=n.filter(g=>{var{name:b}=g;return!u.has(b)})}return a?.addChildren([t.id]),s?.setParent(e??void 0),n}function yt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ne(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yt(Object(r),!0).forEach(function(n){oe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oe(t,e,r){return e=Ba(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ba(t){var e=Ha(t,"string");return typeof e=="symbol"?e:String(e)}function Ha(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Wa=150;class W extends S.PureComponent{static shouldRenderColumn(e){return e.isProxy!==!0}constructor(e){super(e),oe(this,"list",void 0),oe(this,"debouncedSearchColumns",Cr(this.searchColumns,Wa)),oe(this,"handleGroupColorChange",_n((r,n)=>{var{columnHeaderGroups:i,onColumnHeaderGroupChanged:o}=this.props,a=[...i],s=new ye(Ne(Ne({},r),{},{color:n}));a.splice(a.findIndex(l=>{var{name:u}=l;return u===r.name}),1,s),o(a)},250)),oe(this,"renderItem",Ce(r=>{var{value:n,clone:i,item:o,ref:a,handleProps:s}=r,{onColumnVisibilityChanged:l}=this.props,{selectedColumns:u}=this.state,c=n;if(i){var h=this.getSelectedParentItems().map(f=>{var{id:v}=f;return v});c=h.join(", ")}return d.jsx(Zo,{ref:a,value:c,clone:i,item:o,childCount:u.size,onVisibilityChange:l,onClick:this.handleItemClick,onGroupDelete:this.handleGroupDelete,onGroupColorChange:this.handleGroupColorChange,onGroupNameChange:this.handleGroupNameChange,validateGroupName:this.validateGroupName,handleProps:s})})),oe(this,"getMemoizedFirstMovableIndex",Ce((r,n,i)=>{for(var o=0;o<n.length;o+=1){var a=$.getModelIndex(o,i);if(r.isColumnMovable(a))return o}return null})),oe(this,"getMemoizedLastMovableIndex",Ce((r,n,i)=>{for(var o=n.length-1;o>=0;o-=1){var a=$.getModelIndex(o,i);if(r.isColumnMovable(a))return o}return null})),oe(this,"memoizedGetTreeItems",Ce((r,n,i,o,a)=>ia(r,n,i,o,[...a.values()]))),oe(this,"makeVisibilityOrderingList",Ce((r,n)=>{var{movedColumns:i}=this.props,o=[],a=this.getFirstMovableIndex(),s=this.getLastMovableIndex(),l=n.findIndex(y=>{var{data:T}=y;return Array.isArray(T.visibleIndex)?T.visibleIndex[0]===a:T.visibleIndex===a}),u=n.findIndex(y=>{var{data:T}=y;return Array.isArray(T.visibleIndex)?T.visibleIndex[1]===s:T.visibleIndex===s}),c=n.slice(l,u+1);if(a==null||s===null){for(var h=0;h<r.length;h+=1){var f=$.getModelIndex(h,i),v=r[f];W.shouldRenderColumn(v)&&o.push(this.renderImmovableItem(v.name))}return o}for(var m=0;m<a;m+=1){var p=$.getModelIndex(m,i),g=r[p];W.shouldRenderColumn(g)&&o.push(this.renderImmovableItem(g.name))}a!==null&&a>0&&o.push(d.jsx("hr",{},"top-horizontal-divider")),o.push(d.jsx(Ma,{items:c,renderItem:this.renderItem,onDragStart:this.handleDragStart,onDragEnd:this.handleDragEnd},"movable-items")),s!=null&&s<r.length-1&&o.push(d.jsx("hr",{},"bottom-horizontal-divider"));for(var b=s+1;b<r.length;b+=1){var O=$.getModelIndex(b,i),C=r[O];W.shouldRenderColumn(C)&&o.push(this.renderImmovableItem(C.name))}return o})),oe(this,"renderImmovableItem",Ce(r=>d.jsx("div",{className:"visibility-ordering-list-item immovable",children:d.jsx("div",{className:"column-item",children:d.jsx("span",{className:"column-name",children:r})})},r))),this.handleSearchInputChange=this.handleSearchInputChange.bind(this),this.searchColumns=this.searchColumns.bind(this),this.handleItemClick=this.handleItemClick.bind(this),this.handleDragEnd=this.handleDragEnd.bind(this),this.handleGroupDelete=this.handleGroupDelete.bind(this),this.handleGroupNameChange=this.handleGroupNameChange.bind(this),this.handleGroupCreate=this.handleGroupCreate.bind(this),this.validateGroupName=this.validateGroupName.bind(this),this.addColumnToSelected=this.addColumnToSelected.bind(this),this.handleDragStart=this.handleDragStart.bind(this),this.state={selectedColumns:new Set,queriedColumnIndex:void 0,queriedColumnRange:void 0,prevQueriedColumns:void 0,lastSelectedColumn:"",searchFilter:""},this.list=null}componentDidUpdate(e){var{movedColumns:r}=this.props;if(r!==e.movedColumns){var{searchFilter:n}=this.state;this.searchColumns(n,!1)}}componentWillUnmount(){this.debouncedSearchColumns.cancel()}resetVisibilityOrdering(){var{model:e,onReset:r,onMovedColumnsChanged:n,onColumnHeaderGroupChanged:i}=this.props;this.setState({selectedColumns:new Set,queriedColumnIndex:void 0,queriedColumnRange:void 0,prevQueriedColumns:void 0,lastSelectedColumn:"",searchFilter:""}),r(),i(e.initialColumnHeaderGroups),n(e.initialMovedColumns)}resetSelection(){this.setState({selectedColumns:new Set,lastSelectedColumn:""})}handleSearchInputChange(e){var r=e.target.value;if(this.setState({searchFilter:r}),!r){this.debouncedSearchColumns.cancel(),this.resetSelection();return}this.debouncedSearchColumns(r)}searchColumns(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=ee(this.getTreeItems()),i=n.filter(c=>{var h,f,{id:v,data:m}=c;return!((h=(f=m.group)===null||f===void 0?void 0:f.isNew)!==null&&h!==void 0&&h)&&v.toLowerCase().includes(e.toLowerCase())}),o=i.reduce((c,h)=>{var{id:f}=h,v=n.findIndex(m=>m.id===f);return Ne(Ne({},c),{},{[v]:f})},{});if(!r){this.setState({prevQueriedColumns:o});return}var a=i.map(c=>{var{id:h}=c;return h});if(this.addColumnToSelected(a,!1),a.length>0){var s,l=n.findIndex(c=>{var{id:h}=c;return h.toLowerCase().includes(e.toLowerCase())}),u=(s=this.list)===null||s===void 0?void 0:s.querySelectorAll(".item-wrapper")[l];u?.scrollIntoView({block:"center"})}this.setState({prevQueriedColumns:o,queriedColumnIndex:void 0})}changeSelectedColumn(e){var r,{queriedColumnIndex:n,queriedColumnRange:i,prevQueriedColumns:o}=this.state,a=n;if(o!==void 0){var s=Object.keys(o).length;e==="forward"?i!==void 0?a=i.nextIndex:a===void 0||a>=s-1?a=0:a+=1:e==="back"&&(i!==void 0?a=i.prevIndex:a===void 0||a<=0?a=s-1:a-=1),this.addColumnToSelected([Object.values(o)[a]],!1);var l=parseInt(Object.keys(o)[a],10),u=(r=this.list)===null||r===void 0?void 0:r.querySelectorAll(".item-wrapper")[l];u?.scrollIntoView({block:"center"}),this.setState({queriedColumnIndex:a,queriedColumnRange:void 0})}}adjustQueriedIndex(e){var{prevQueriedColumns:r}=this.state;if(r!==void 0){if(e in Object.values(r)){var n=Object.values(r).indexOf(e);this.setState({queriedColumnIndex:n,queriedColumnRange:void 0});return}for(var i=ee(this.getTreeItems()),o=i.findIndex(h=>h.id===e),a=Object.keys(r).map(h=>parseInt(h,10)),s=a.length-1,l=0,u=0;u<a.length;u+=1){var c=a[u];if(c<o)s=u;else if(c>o){l=u;break}}this.setState({queriedColumnRange:{prevIndex:s,nextIndex:l}})}}moveSelectedColumns(e){var{columnHeaderGroups:r}=this.props,{selectedColumns:n}=this.state,i=ee(this.getTreeItems()),o=this.getFirstMovableIndex(),a=this.getLastMovableIndex();R(o),R(a);var s=this.getSelectedParentItems(),l=e===W.MOVE_OPTIONS.UP||e===W.MOVE_OPTIONS.TOP;l||s.reverse();for(var u=[],c=r,h=function(){var{id:m,parentId:p,depth:g,data:{visibleIndex:b}}=s[f];switch(e){case W.MOVE_OPTIONS.TOP:{u=$.moveItemOrRange(b,o,u,!0);var O=Array.isArray(b)?b[1]-b[0]+1:1;o+=O,c=Se(s[f],null,c);break}case W.MOVE_OPTIONS.BOTTOM:{u=$.moveItemOrRange(b,a,u,!0);var C=Array.isArray(b)?b[1]-b[0]+1:1;a-=C,c=Se(s[f],null,c);break}case W.MOVE_OPTIONS.UP:{var y=i.findIndex(B=>B.id===m),T=i.map((B,z)=>z<y&&!n.has(B.id)).lastIndexOf(!0),P=i[T];if(P!=null&&P.parentId!==p)if(Math.abs(P.depth-g)>1){var j=i.map((B,z)=>z<T&&B.depth===g).lastIndexOf(!0),D=i[j];c=Se(s[f],D.id,c)}else c=Se(s[f],P.parentId,c);else{var x=hr(Array.isArray(b)?b[0]-1:b-1,o,a);u=$.moveItemOrRange(b,x,u,!1);var I=Array.isArray(b)?b[1]-b[0]+1:1;o+=I}break}case W.MOVE_OPTIONS.DOWN:{var N=i.findIndex(B=>B.id===m),E=i.find((B,z)=>z>N&&!n.has(B.id));if(E?.parentId!==p){var k,F=i.find(B=>B.id===p);c=Se(s[f],(k=F?.parentId)!==null&&k!==void 0?k:null,c);break}else if(E?.children.length>0){c=Se(s[f],E.id,c);break}var G=hr(Array.isArray(b)?b[0]+1:b+1,o,a);u=$.moveItemOrRange(b,G,u,!1);var H=Array.isArray(b)?b[1]-b[0]+1:1;a-=H;break}}},f=0;f<s.length;f+=1)h();return{newMoves:u,groups:c}}handleMoveColumns(e){var{onMovedColumnsChanged:r,movedColumns:n,onColumnHeaderGroupChanged:i}=this.props,{newMoves:o,groups:a}=this.moveSelectedColumns(e),s;e===W.MOVE_OPTIONS.TOP&&(s=()=>{var l,u;(l=this.list)===null||l===void 0||(u=l.parentElement)===null||u===void 0||u.scroll({top:0})}),e===W.MOVE_OPTIONS.BOTTOM&&(s=()=>{var l,u;(l=this.list)===null||l===void 0||(u=l.parentElement)===null||u===void 0||u.scroll({top:this.list.parentElement.scrollHeight})}),i(a),o.length>0&&r(n.concat(o),s)}getSortMoves(e,r,n){var i=[...e],o=r===W.SORTING_OPTIONS.ASC;i.sort((f,v)=>{var m=f.id.toUpperCase(),p=v.id.toUpperCase();return Qe.sort(m,p,o)});for(var a=[...n],s=Math.min(...i.flatMap(f=>{var{modelIndex:v}=f.data;return Array.isArray(v)?$.getVisibleIndexes(v,a):$.getVisibleIndex(v,a)})),l=0;l<i.length;l+=1){var u=i[l],{modelIndex:c}=u.data,h=Array.isArray(c)?$.getVisibleIndexes(c,a):$.getVisibleIndex(c,a);a=Array.isArray(h)?$.moveRange([Math.min(...h),Math.max(...h)],s,a,!0):$.moveItem(h,s,a),Array.isArray(h)&&(a=this.getSortMoves(u.children,r,a)),s+=Array.isArray(c)?c.length:1}return a}handleSortColumns(e){for(var r,n,{model:i,onMovedColumnsChanged:o}=this.props,a=this.getTreeItems(),s=(r=this.getFirstMovableIndex())!==null&&r!==void 0?r:0,l=(n=this.getLastMovableIndex())!==null&&n!==void 0?n:a.length-1,u=a.slice(s,l+1),c=[...i.initialMovedColumns],h=0;h<i.frozenColumns.length;h+=1){var f,v=i.frozenColumns[h],m=$.getVisibleIndex((f=i.getColumnIndexByName(v))!==null&&f!==void 0?f:0,c);m!==h&&c.push({from:m,to:h})}var p=this.getSortMoves(u,e,c);o(p)}handleItemClick(e,r){if(r.stopPropagation(),!(r.target instanceof HTMLElement&&(r.target.tagName==="BUTTON"||r.target.tagName==="INPUT"))){r.currentTarget.focus();var{selectedColumns:n,lastSelectedColumn:i}=this.state,o=$.isModifierKeyDown(r),a=r.shiftKey,s=n.has(e),l=[e];if(s&&o){this.removeColumnFromSelected(e);return}var u=ee(this.getTreeItems());if(s&&!a&&i===e){var c=u.find(m=>{var{id:p}=m;return p===e});R(c);var h=ee(c.children).length;if(h+1===n.size){this.resetSelection();return}}if(a){var f=u.findIndex(m=>m.id===e),v=u.findIndex(m=>m.id===i);l.push(...u.slice(Math.min(v,f),Math.max(v,f)+1).map(m=>m.id))}this.addColumnToSelected(l,o||a),this.adjustQueriedIndex(e),this.setState({lastSelectedColumn:e})}}addColumnToSelected(e,r){var{selectedColumns:n}=this.state,i=new Set(r?[...n.values()].concat(e):e),o=ee(this.getTreeItems());o.forEach(a=>{var{id:s,children:l}=a;i.has(s)&&l.forEach(u=>i.add(u.id))}),this.setState({selectedColumns:i})}removeColumnFromSelected(e){var{selectedColumns:r}=this.state,n=ee(this.getTreeItems()),i=n.find(s=>{var{id:l}=s;return l===e});R(i);var o=n.find(s=>{var{id:l}=s;return l===i.parentId});ee(i?.children).forEach(s=>r.delete(s.id));for(var a=function(){r.delete(o.id);var l=o.parentId;o=n.find(u=>{var{id:c}=u;return c===l})};o!=null;)a();r.delete(e),this.setState({selectedColumns:new Set(r)})}handleDragStart(e){var{selectedColumns:r}=this.state;r.has(e)||this.addColumnToSelected([e],!1)}handleDragEnd(e,r){var{movedColumns:n,onMovedColumnsChanged:i,columnHeaderGroups:o,onColumnHeaderGroupChanged:a}=this.props,s=this.getSelectedParentItems(),l=ee(this.getTreeItems()).map((v,m)=>Ne(Ne({},v),{},{index:m})),u=this.getFirstMovableIndex(),c=this.getLastMovableIndex();R(u),R(c);var{groups:h,movedColumns:f}=Ua(e,r,n,o,l,s,u,c);a(h),i(f)}handleGroupNameChange(e,r){var{columnHeaderGroups:n,onColumnHeaderGroupChanged:i}=this.props,o=[...n],a=e.name,s=o.findIndex(f=>{var{name:v}=f;return v===a}),l=o[s];R(l);var u=new ye(l);u.name=r,o.splice(s,1,u);var c=o.findIndex(f=>{var{name:v}=f;return v===u.parent});if(c>=0){var h=new ye(o[c]);h.removeChildren([a]),h.addChildren([r]),o.splice(c,1,h)}i(o)}handleGroupDelete(e){var{columnHeaderGroups:r,onColumnHeaderGroupChanged:n}=this.props,i=r.filter(s=>s.name!==e.name),o=i.findIndex(s=>s.name===e.parent);if(o>=0){var a=new ye(i[o]);a.addChildren(e.children),a.removeChildren([e.name]),i.splice(o,1,a)}n(i)}handleGroupCreate(){var{movedColumns:e,onMovedColumnsChanged:r,onColumnHeaderGroupChanged:n}=this.props,{newMoves:i,groups:o}=this.moveSelectedColumns(W.MOVE_OPTIONS.TOP),a=o.filter(h=>!h.isNew),s=this.getSelectedParentItems(),l=s.map(h=>h.data.modelIndex).flat().filter(h=>h>=0),u="".concat(ye.NEW_GROUP_PREFIX,"-").concat(Date.now()),c=new ye({name:u,children:s.map(h=>{var{id:f}=h;return f}),depth:0,childIndexes:[...new Set(l)]});r(e.concat(i),()=>{var h,f;(h=this.list)===null||h===void 0||(f=h.parentElement)===null||f===void 0||f.scroll({top:0})}),n(a.concat([c])),this.resetSelection()}validateGroupName(e){var{model:r,columnHeaderGroups:n}=this.props,{columns:i}=r;return Tr.isValidColumnName(e)?i.some(o=>{var{name:a}=o;return a===e})||n.some(o=>{var{name:a}=o;return a===e})?"Duplicate name":"":"Invalid name"}getFirstMovableIndex(){var{model:e,movedColumns:r}=this.props;return this.getMemoizedFirstMovableIndex(e,e.columns,r)}getLastMovableIndex(){var{model:e,movedColumns:r}=this.props;return this.getMemoizedLastMovableIndex(e,e.columns,r)}getTreeItems(){var{model:e,movedColumns:r,hiddenColumns:n,columnHeaderGroups:i}=this.props,{selectedColumns:o}=this.state;return this.memoizedGetTreeItems(e.columns,r,i,n,o)}getSelectedParentItems(){var{selectedColumns:e}=this.state,r=ee(this.getTreeItems());return r.filter(n=>{var{id:i,parentId:o}=n;return e.has(i)&&!e.has(o??"")})}render(){var{model:e,hiddenColumns:r,onColumnVisibilityChanged:n}=this.props,{selectedColumns:i,searchFilter:o,prevQueriedColumns:a,queriedColumnIndex:s}=this.state,l=i.size>0,u=this.getTreeItems(),c=new Map(ee(u).map(C=>[C.id,C.data.modelIndex])),h=new Set(r),f=[...new Set(l?[...i.values()].map(C=>c.get(C)).filter(C=>C!=null).flat():u.map(C=>C.data.modelIndex).flat())],v=f.some(C=>!h.has(C)),m=v?"Hide All":"Show All",p=v?"Hide Selected":"Show Selected",g=this.makeVisibilityOrderingList(e.columns,u),b={index:s,next:C=>this.changeSelectedColumn(C)},O=Object.keys(a??{}).length;return d.jsxs("div",{role:"menu",className:"visibility-ordering-builder",tabIndex:0,children:[d.jsxs("div",{className:"top-menu",children:[d.jsx(L,{kind:"ghost",className:"toggle-visibility-btn",onClick:()=>{n(f,!v)},icon:v?Yt:Xt,tooltip:"Toggle column visibility",children:l?p:m}),d.jsx(nn,{className:"visibility-search",value:o,matchCount:o?O:void 0,onChange:this.handleSearchInputChange,cursor:b})]}),d.jsxs("div",{className:"top-menu",children:[d.jsx(L,{kind:"ghost",icon:Vn,className:"px-1",tooltip:"Reset to default",onClick:()=>{this.resetVisibilityOrdering()},children:"Reset"}),d.jsx("span",{className:"vertical-divider"}),d.jsx(L,{kind:"ghost",icon:Or,className:"px-1",tooltip:"Sort ascending",onClick:()=>{this.handleSortColumns(W.SORTING_OPTIONS.ASC)}}),d.jsx(L,{kind:"ghost",icon:yr,className:"px-1",tooltip:"Sort descending",onClick:()=>{this.handleSortColumns(W.SORTING_OPTIONS.DSC)}}),d.jsx("span",{className:"vertical-divider"}),d.jsxs(L,{kind:"ghost",className:"px-1",tooltip:"Create group from selection",disabled:!l,onClick:this.handleGroupCreate,children:[d.jsxs("span",{className:"fa-layers",children:[d.jsx(K,{mask:zn,icon:Kt,transform:"right-7 down-5 shrink-6"}),d.jsx(K,{icon:Kn,transform:"right-8 down-6 shrink-8"})]}),"Group"]}),d.jsx("span",{className:"vertical-divider"}),d.jsx(L,{kind:"ghost",icon:Qn,className:"px-1",tooltip:"Move selection up",onClick:()=>{this.handleMoveColumns(W.MOVE_OPTIONS.UP)},disabled:!l}),d.jsx(L,{kind:"ghost",icon:qn,className:"px-1",tooltip:"Move selection down",onClick:()=>{this.handleMoveColumns(W.MOVE_OPTIONS.DOWN)},disabled:!l}),d.jsx(L,{kind:"ghost",icon:Yn,className:"px-1",tooltip:"Move selection to top",onClick:()=>{this.handleMoveColumns(W.MOVE_OPTIONS.TOP)},disabled:!l}),d.jsx(L,{kind:"ghost",icon:Xn,className:"px-1",tooltip:"Move selection to bottom",onClick:()=>{this.handleMoveColumns(W.MOVE_OPTIONS.BOTTOM)},disabled:!l})]}),d.jsx("div",{role:"menu",className:V("visibility-ordering-list"),children:d.jsx("div",{className:"column-list",ref:C=>{this.list=C},children:g})})]})}}oe(W,"SORTING_OPTIONS",{DSC:"DSC",ASC:"ASC"});oe(W,"MOVE_OPTIONS",{TOP:"TOP",BOTTOM:"BOTTOM",UP:"UP",DOWN:"DOWN"});const lu=W;function Va(t,e,r){return e=za(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function za(t){var e=Ka(t,"string");return typeof e=="symbol"?e:String(e)}function Ka(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Qa extends de{constructor(e){super(850),Va(this,"irisGrid",void 0),this.irisGrid=e}destroyColumnTooltip(){this.irisGrid.setState({overflowButtonTooltipProps:null})}setCursor(e){return this.isHoveringOverflowButton(e)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:r,y:n,column:i,row:o}=e;if(i==null||o==null)return null;var{renderer:a,grid:s,state:l,props:u}=this.irisGrid;if(!s)return null;var{metrics:c}=l,{model:h}=u,{canvasContext:f}=s,v=this.irisGrid.getTheme(),m={context:f,mouseX:r,mouseY:n,metrics:c,model:h,theme:v},{left:p,top:g,width:b,height:O}=a.getCellOverflowButtonPosition(m);return p==null||b==null||g==null||O==null?null:{left:p,top:g,width:b,height:O}}isHoveringOverflowButton(e){var r,{x:n,y:i}=e,{left:o,top:a,width:s,height:l}=(r=this.getButtonPosition(e))!==null&&r!==void 0?r:{};if(o==null||s==null||a==null||l==null)return!1;var{renderer:u,grid:c,state:h,props:f}=this.irisGrid;if(!c)return!1;var{metrics:v}=h,{model:m}=f,{canvasContext:p}=c,g=c.getTheme(),b={context:p,mouseX:n,mouseY:i,metrics:v,model:m,theme:g};return u.shouldRenderOverflowButton(b)&&n>=o&&n<=o+s&&i>=a&&i<=a+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:r}=this.irisGrid.state,n=this.getButtonPosition(e);Sr(r,n)||this.irisGrid.setState({overflowButtonTooltipProps:n})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:r,row:n}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(r,n)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const uu=Qa;function qa(t,e,r){return e=Ya(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ya(t){var e=Xa(t,"string");return typeof e=="symbol"?e:String(e)}function Xa(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Za extends de{constructor(e){super(),qa(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}isActive(){var{isSelectingColumn:e}=this.irisGrid.props;return e}isValidColumn(e){if(e==null||e.isProxy===!0)return!1;var{columnSelectionValidator:r}=this.irisGrid.props;return r!=null?r(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e?.(null)}getTableColumn(e){if(e==null)return null;var{model:r}=this.irisGrid.props,n=this.irisGrid.getModelColumn(e);return n==null?null:r.columns[n]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:r,columnNotAllowedCursor:n}=this.irisGrid.props,{column:i}=e,o=this.getTableColumn(i);return this.isValidColumn(o)?(this.cursor=r,this.irisGrid.setState({hoverSelectColumn:i})):(this.cursor=n,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:r,columnNotAllowedCursor:n}=this.irisGrid.props,{column:i}=e,o=this.getTableColumn(i);return this.isValidColumn(o)?(this.cursor=r,this.irisGrid.setState({hoverSelectColumn:i})):(this.cursor=n,this.irisGrid.setState({hoverSelectColumn:null})),{preventDefault:!1,stopPropagation:!1}}onLeave(){return this.isActive()&&this.irisGrid.setState({hoverSelectColumn:null}),this.updateColumnSelectionStatus(),!1}onDown(){return this.isActive()}onClick(e){if(!this.isActive())return!1;var{column:r}=e,n=this.getTableColumn(r);return n!=null&&this.isValidColumn(n)&&this.irisGrid.selectColumn(n),!0}}const du=Za;function Ja(t,e,r){return e=es(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function es(t){var e=rs(t,"string");return typeof e=="symbol"?e:String(e)}function rs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ts extends de{constructor(e){super(),Ja(this,"irisGrid",void 0),this.irisGrid=e}hideColumnTooltip(){var{tooltip:e}=this.irisGrid;e&&(e.stopTimer(),e.hide())}onDown(){return this.hideColumnTooltip(),!1}onContextMenu(){return this.hideColumnTooltip(),!1}onWheel(){return this.hideColumnTooltip(),!1}onLeave(e,r,n){var{relatedTarget:i}=n instanceof MouseEvent?n:n.nativeEvent,{tooltip:o}=this.irisGrid;if(!o)return!1;var a=o.popper.current;return a&&i instanceof Element&&a.element.contains(i)||this.hideColumnTooltip(),!1}onMove(e){var{column:r,row:n,columnHeaderDepth:i}=e,{shownColumnTooltip:o}=this.irisGrid.state,a=null;return r!==null&&n===null&&i===0&&(a=r),a!==o&&this.irisGrid.setState({shownColumnTooltip:a}),!1}}const cu=ts;function mn(t,e,r){return e=ns(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ns(t){var e=is(t,"string");return typeof e=="symbol"?e:String(e)}function is(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class tr extends S.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tr.defaultProps;super(e),mn(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=dr.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:r}=e;r(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=Zn.getClosestByClassName(this.inputRef.current,"context-menu-container");e instanceof HTMLElement&&e.focus()}handleKeyDown(e){switch(e.key){case"Enter":e.stopPropagation(),this.closeContextMenu();break;case"Escape":e.stopPropagation(),this.revertToDefault(),this.closeContextMenu();break;case"ArrowRight":case"ArrowLeft":e.stopPropagation();break;case"ArrowUp":case"ArrowDown":this.returnFocusToContextMenu();break;default:e.stopPropagation()}}render(){var{formatString:e,forwardedProps:r,placeholder:n,title:i}=this.props,{menuItem:{description:o},iconElement:a}=r;return d.jsxs("div",{className:"form-group flex-grow mb-0",children:[d.jsxs("div",{className:"custom-format-title",children:[d.jsx("span",{className:"icon",children:a}),d.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[i,o!=null&&d.jsx(Xe,{children:o})]})]}),d.jsx("div",{className:"pl-2 pr-2 pb-2",children:d.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:n,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}mn(tr,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(t){},iconElement:null},placeholder:"",title:"",onChange(t){}});const os=tr;class as{static isDefaultSelected(e){return!e||![qe.TYPE_CONTEXT_CUSTOM,qe.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===qe.TYPE_CONTEXT_CUSTOM}static makeOption(e,r,n,i){return{title:e,description:e,group:n,format:r,isSelected:i}}static makeCustomFormatOption(e,r,n,i,o){var a;return{title:e.label,description:e.label,format:e,group:r,isSelected:i,menuElement:d.jsx(os,{formatString:(a=e.formatString)!==null&&a!==void 0?a:void 0,title:e.label,placeholder:n,onChange:o})}}}const ie=as;function Pr(t,e,r){return e=ss(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ss(t){var e=ls(t,"string");return typeof e=="symbol"?e:String(e)}function ls(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Y{static getOptions(e,r){var n=new Date,i=[{group:Y.dateGroup,formatString:"yyyy-MM-dd"},{group:Y.dateGroup,formatString:"MM-dd-yyyy"},{group:Y.timeGroup,formatString:"HH:mm:ss"},{group:Y.timeGroup,formatString:"HH:mm:ss.SSS"},{group:Y.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:Y.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:Y.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:Y.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],o=i.map(s=>{var l=Re.makeFormat("",s.formatString,Re.TYPE_CONTEXT_PRESET),u=e.getFormattedString(n,M.dataType.DATETIME,"",l);return ie.makeOption(u,l,s.group,Re.isSameFormat(l,r))}),a=ie.makeOption("Default",null,Y.dateGroup,ie.isDefaultSelected(r));return[a,...o]}}Pr(Y,"dateGroup",10);Pr(Y,"timeGroup",20);Pr(Y,"dateTimeGroup",30);const us=Y;function nr(t,e,r){return e=ds(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ds(t){var e=cs(t,"string");return typeof e=="symbol"?e:String(e)}function cs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Q{static getOptions(e,r,n){var i=[{format:Z.FORMAT_PERCENT,group:Q.presetGroup},{format:Z.FORMAT_BASIS_POINTS,group:Q.presetGroup},{format:Z.FORMAT_THOUSANDS,group:Q.presetGroup},{format:Z.FORMAT_MILLIONS,group:Q.presetGroup},{format:Z.FORMAT_SCIENTIFIC_NOTATION,group:Q.presetGroup},{format:Z.FORMAT_ROUND,group:Q.presetRoundGroup},{format:Z.FORMAT_ROUND_TWO_DECIMALS,group:Q.presetRoundGroup},{format:Z.FORMAT_ROUND_FOUR_DECIMALS,group:Q.presetRoundGroup}],o=ie.makeOption("Default",null,Q.defaultGroup,ie.isDefaultSelected(r)),a=i.map(c=>ie.makeOption(c.format.label,c.format,c.group,Z.isSameFormat(c.format,r))),s=ie.isCustomSelected(r),l=s?r:Z.makeCustomFormat(),u=ie.makeCustomFormatOption(l,Q.customGroup,Z.DEFAULT_FORMAT_STRING,s,c=>{if(c!=null){var h=Z.makeCustomFormat(c);Z.isValid(e,h)&&n(h)}else n(null)});return[o,...a,u]}}nr(Q,"defaultGroup",10);nr(Q,"presetGroup",20);nr(Q,"presetRoundGroup",30);nr(Q,"customGroup",40);const hs=Q;function xr(t,e,r){return e=vs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vs(t){var e=ms(t,"string");return typeof e=="symbol"?e:String(e)}function ms(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ce{static getOptions(e,r,n){var i=[{format:pe.FORMAT_THOUSANDS,group:ce.presetGroup},{format:pe.FORMAT_MILLIONS,group:ce.presetGroup},{format:pe.FORMAT_SCIENTIFIC_NOTATION,group:ce.presetGroup}],o=ie.makeOption("Default",null,ce.defaultGroup,ie.isDefaultSelected(r)),a=i.map(c=>ie.makeOption(c.format.label,c.format,c.group,pe.isSameFormat(c.format,r))),s=ie.isCustomSelected(r),l=s?r:pe.makeCustomFormat(),u=ie.makeCustomFormatOption(l,ce.customGroup,pe.DEFAULT_FORMAT_STRING,s,c=>{if(c!=null){var h=pe.makeCustomFormat(c);pe.isValid(e,h)&&n(h)}else n(null)});return[o,...a,u]}}xr(ce,"defaultGroup",10);xr(ce,"presetGroup",20);xr(ce,"customGroup",30);const fs=ce;function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Pt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(r),!0).forEach(function(n){X(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xt(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(u){r(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function gs(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(l){xt(o,n,i,a,s,"next",l)}function s(l){xt(o,n,i,a,s,"throw",l)}a(void 0)})}}function X(t,e,r){return e=ps(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ps(t){var e=bs(t,"string");return typeof e=="symbol"?e:String(e)}function bs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Et=ue.module("IrisGridContextMenuHandler"),Cs=150,Nt="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",ar=1e3;class w extends de{static getQuickFilterCondition(e,r,n){return e&&n==="&&"?e.and(r):e&&n==="||"?e.or(r):r}static getQuickFilterText(e,r,n){return n&&e!=null?"".concat(e," ").concat(n," ").concat(r):r}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(Jt.truncate(r,n-e.length-3),'"')}constructor(e,r){super(),X(this,"irisGrid",void 0),X(this,"debouncedUpdateCustomFormat",void 0),X(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=Cr(e.handleFormatSelection,Cs),this.dh=r,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,r){var{irisGrid:n}=this,{column:i}=r;R(i);var{model:o}=n.props,{columns:a}=o,s=a[e],l=[],{metrics:u,reverseType:c,quickFilters:h,advancedFilters:f,searchFilter:v}=n.state,m=n.getTheme();R(u);var{filterIconColor:p,filterBarActiveColor:g,contextMenuSortIconColor:b,contextMenuReverseIconColor:O}=m,C=o.sort,y=M.getSortForColumn(C,s.name),T=c!==M.REVERSE_TYPE.NONE,{userColumnWidths:P}=u,j=[...P.values()].some(E=>E===0),D=o.getColumnHeaderParentGroup(e,0)===void 0&&!(Ae(o)&&o.hasExpandableRows),x=o.isColumnFrozen(e),I=o.isColumnSortable(e);if(l.push({title:"Hide Column",group:w.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(i)}}),l.push({title:x?"Unfreeze Column":"Freeze Column",group:w.GROUP_HIDE_COLUMNS,disabled:!D,action:()=>{x?this.irisGrid.unFreezeColumnByColumnName(s.name):this.irisGrid.freezeColumnByColumnName(s.name)},order:10}),l.push({title:"Show All Columns",group:w.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!j}),l.push({title:"Quick Filters",icon:me,iconColor:g,shortcut:Le.TABLE.TOGGLE_QUICK_FILTER,group:w.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(i)}}),l.push({title:"Advanced Filters",icon:f.get(e)?Jn:ei,iconColor:p,group:w.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(i)}}),l.push({title:"Clear Table Filters",group:w.GROUP_FILTER,order:40,shortcut:Le.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(h.size>0||f.size>0||v!=null)}),l.push({title:"Sort by",icon:me,iconColor:b,group:w.GROUP_SORT,order:10,actions:this.sortByActions(s,e,y),disabled:!I}),l.push({title:"Add Additional Sort",disabled:y&&C.length===1||T&&C.length===1||y&&T&&C.length===2||C.length===0||!I,group:w.GROUP_SORT,order:20,actions:this.additionalSortActions(s,e)}),l.push({title:"Clear Table Sorting",disabled:C.length===0||T&&C.length===1,group:w.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(i,w.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:c===M.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:me,iconColor:O,group:w.GROUP_SORT,order:40,disabled:!o.isReversible,shortcut:Le.TABLE.REVERSE,action:()=>{c===M.REVERSE_TYPE.NONE?this.irisGrid.reverse(M.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(M.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:w.GROUP_COPY,shortcutText:Ie.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var E;Ei((E=o.textForColumnHeader(e))!==null&&E!==void 0?E:"").catch(k=>Et.error("Unable to copy header",k))}}),M.isDateType(s.type))l.push({title:"Date/Time Format",group:w.GROUP_FORMAT,actions:this.dateFormatActions(s)});else if(M.isNumberType(s.type)){var N;l.push({title:"Number Format",group:w.GROUP_FORMAT,actions:(N=this.numberFormatActions(s))!==null&&N!==void 0?N:void 0})}return l}getCellActions(e,r,n){var{irisGrid:i}=this,{column:o,row:a}=n,{model:s,canCopy:l}=i.props,{columns:u}=s,c=i.getModelRow(a);R(c);var h=s.sourceForCell(e,c),{column:f,row:v}=h,m=s.valueForCell(f,v),p=u[f],g=[],b=i.getTheme(),{filterIconColor:O}=b;if(p==null||a==null)return g;if(Ae(s)&&s.isRowExpandable(v)){var C=0,y=s.valueForCell(C,v),T=y==null?"null":s.textForCell(C,v);g.push({title:w.getRowOptionFormatted(s.isRowExpanded(v)?"Collapse":"Expand",T),group:w.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{s.setRowExpanded(v,!s.isRowExpanded(v))}}),s.isExpandAllAvailable===!0&&g.push({title:w.getRowOptionFormatted("Expand All in",T),group:w.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{s.setRowExpanded(v,!0,!0)}})}Ae(s)&&s.hasExpandableRows&&s.isExpandAllAvailable===!0&&(g.push({title:"Expand Entire Table",group:w.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{s.expandAll()}}),g.push({title:"Collapse Entire Table",group:w.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{s.collapseAll()}}));var P={title:"Go to",iconColor:O,shortcut:Le.TABLE.GOTO_ROW,group:w.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(a+1),"".concat(m),p.name)};return g.push(P),l&&(g.push({title:"Copy Cell",group:w.GROUP_COPY,shortcutText:Ie.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{i.copyCell(o,a)}}),g.push({title:"Copy Cell Unformatted",group:w.GROUP_COPY,order:20,action:()=>{i.copyCell(o,a,!0)}})),g.push({title:"View Cell Contents",group:w.GROUP_VIEW_CONTENTS,order:10,action:()=>{i.setState({showOverflowModal:!0,overflowText:i.getValueForCell(o,a)})}}),g}getCellFilterActions(e,r,n){var i=this;return gs(function*(){var{dh:o,irisGrid:a}=i,{row:s}=n,{model:l}=a.props,{columns:u}=l,c=a.getModelRow(s),{getSelectedRanges:h}=r;R(c);var f=l.sourceForCell(e,c),{column:v,row:m}=f,p=u[v];if(p==null||s==null)return[];if(!l.isFilterable(v))return[];var{quickFilters:g}=a.state,b=a.getTheme(),{filterIconColor:O}=b,{settings:C}=a.props,y=[...h()];if(y.length===0&&y.push(new ne(v,m,v,m)),ne.containsCell(y,v,m))for(var T=ne.rowCount(y);T>ar;){var P=y.pop();R(P,"Selected ranges should not be empty");var j=ne.rowCount([P]);if(ri(j,"Selected ranges should not be unbounded"),T-j<ar){var D;y.push(new ne(P.startColumn,P.startRow,P.endColumn,((D=P.endRow)!==null&&D!==void 0?D:0)-(T-ar)));break}T-=j}else y=[new ne(v,m,v,m)];ti(y);for(var x=yield l.snapshot(y),I=new Set,N=0;N<x.length;N+=1)x[N].length===1?x[N][0]!=null&&I.add(x[N][0]):x[N][v]!=null&&I.add(x[N][v]);var E={title:"Filter by Value".concat(I.size>1?"s":""),icon:me,iconColor:O,group:w.GROUP_FILTER,order:10,actions:[]};if(I.size===0)g.get(v)&&E.actions.push({title:"And",actions:i.nullFilterActions(p,g.get(v),"&&"),order:2,group:A.groups.high}),E.actions.push(...i.nullFilterActions(p));else if(I.size===1&&I.has(""))g.get(v)&&E.actions.push({title:"And",actions:i.emptyStringFilterActions(p,g.get(v),"&&"),order:2,group:A.groups.high}),E.actions.push(...i.emptyStringFilterActions(p));else if(M.isBooleanType(p.type))g.get(v)&&E.actions.push({title:"Or",actions:i.booleanFilterActions(p,l.textForCell(v,m),g.get(v),"||"),order:2,group:A.groups.high}),E.actions.push(...i.booleanFilterActions(p,l.textForCell(v,m)));else if(M.isNumberType(p.type)||M.isCharType(p.type))R(v),g.get(v)&&E.actions.push({title:"And",actions:i.numberFilterActions(p,I,g.get(v),"&&"),order:2,group:A.groups.high}),E.actions.push(...i.numberFilterActions(p,I,g.get(v)));else if(M.isDateType(p.type)){var k=new Re(o,{timeZone:C?.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Nt}),F=new Re(o,{timeZone:C?.timeZone,showTimeZone:C?.showTimeZone,showTSeparator:C?.showTSeparator,defaultDateTimeFormatString:Nt});g.get(v)&&E.actions.push({title:"And",actions:i.dateFilterActions(p,I,k,F,g.get(v),"&&"),order:2,group:A.groups.high}),E.actions.push(...i.dateFilterActions(p,I,k,F,g.get(v)))}else g.get(v)&&E.actions.push({title:"And",actions:i.stringFilterActions(p,I,g.get(v),"&&"),order:2,group:A.groups.high}),E.actions.push(...i.stringFilterActions(p,I));return[E]})()}getNumberValueEqualsFilter(e,r){var{dh:n}=this,i=e.filter();if(r===Number.POSITIVE_INFINITY)return n.FilterCondition.invoke("isInf",i).and(i.greaterThan(n.FilterValue.ofNumber(0)));if(r===Number.NEGATIVE_INFINITY)return n.FilterCondition.invoke("isInf",i).and(i.lessThan(n.FilterValue.ofNumber(0)));if(Number.isNaN(r))return n.FilterCondition.invoke("isNaN",i);var o=this.getFilterValueForNumberOrChar(e.type,r);return i.eq(o)}getFilterValueForNumberOrChar(e,r){var{dh:n}=this;return M.isCharType(e)?n.FilterValue.ofString(String.fromCharCode(r)):n.FilterValue.ofNumber(r)}onContextMenu(e,r,n){var{irisGrid:i}=this,{y:o,column:a,row:s,columnHeaderDepth:l}=e,u=i.getModelColumn(a),c=i.getModelRow(s),{model:h,canCopy:f}=i.props,{columns:v}=h,{metrics:m,isFilterBarShown:p,quickFilters:g,advancedFilters:b,selectedRanges:O}=i.state;R(m);var{columnHeaderHeight:C,gridY:y,columnHeaderMaxDepth:T}=m,P=[];if(u!=null&&c!=null){var j=h.sourceForCell(u,c??0),{column:D,row:x}=j,I=h.valueForCell(D,x),N=h.textForCell(D,x),E=v[D],{onContextMenu:k}=i.props;E!=null&&P.push(...k({model:h,value:I,valueText:N,column:E,rowIndex:s,columnIndex:a,modelRow:c,modelColumn:u}))}if(u!=null){var F=h.getClearFilterRange(u);F!=null&&F.length>0&&P.push({title:F[1]-F[0]>0?"Clear Group Filter":"Clear Column Filter",group:w.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(F)},disabled:!Array.from(g.keys()).some(G=>G>=F[0]&&G<=F[1])&&!Array.from(b.keys()).some(G=>G>=F[0]&&G<=F[1])})}return(p?o<=y:o<=C*T&&l===0)?u!=null&&P.push(...this.getHeaderActions(u,e)):(u!=null&&c!=null&&(P.push(...this.getCellActions(u,r,e)),P.push(this.getCellFilterActions(u,r,e))),f&&O.length>0&&(P.push({title:"Copy Selection",shortcut:Ni.COPY,group:w.GROUP_COPY,order:30,action:()=>{i.copyRanges(O)}}),P.push({title:"Copy Selection w/ Headers",group:w.GROUP_COPY,order:40,action:()=>{i.copyRanges(O,!0)}})),en(h)&&h.isEditable&&O.length>0&&jo(h)&&h.isDeletable&&P.push({title:"Delete Selected Rows",group:w.GROUP_EDIT,disabled:!h.isDeletableRanges(O),order:50,action:()=>{this.irisGrid.deleteRanges(O)}})),P.length===0?!1:(R(i.gridWrapper),A.triggerMenu(i.gridWrapper,n.clientX,n.clientY,P),!0)}dateFormatActions(e){for(var r=this,{model:n}=this.irisGrid.props,{formatter:i}=n,o=i.getColumnFormat(e.type,e.name),a=us.getOptions(i,o),s=[],l=function(){var{description:h,format:f,group:v,isSelected:m,title:p}=a[u];s.push({title:p,description:h,icon:m?vr:void 0,group:v,order:u,action:()=>{var g=n.getColumnIndexByName(e.name);R(g),r.irisGrid.handleFormatSelection(g,f)}})},u=0;u<a.length;u+=1)l();return s}numberFormatActions(e){var r=this,{model:n}=this.irisGrid.props,{formatter:i}=n,{dh:o}=this,a=i.getColumnFormat(e.type,e.name),s,l=n.getColumnIndexByName(e.name);if(M.isDecimalType(e.type))s=hs.getOptions(o,a,f=>{R(l),this.debouncedUpdateCustomFormat(l,f)});else if(M.isIntegerType(e.type))s=fs.getOptions(o,a,f=>{R(l),this.debouncedUpdateCustomFormat(l,f)});else return Et.error("Invalid column type in numberFormatActions"),null;for(var u=[],c=function(){var{format:v,isSelected:m}=s[h];u.push(Pt(Pt({},s[h]),{},{icon:m?vr:void 0,order:h,action:()=>{l===void 0&&v&&v.type===qe.TYPE_CONTEXT_CUSTOM||(R(l),r.irisGrid.handleFormatSelection(l,v))}}))},h=0;h<s.length;h+=1)c();return u}stringFilterActions(e,r,n,i){var{dh:o}=this,a=Array.from(r.keys()),s=a.map(g=>o.FilterValue.ofString(g)),l=s.length===1?s[0]:"the selected values",u=n;u||(u={filter:null,text:null});var{filter:c,text:h}=u,f=[],{model:v}=this.irisGrid.props,m=v.getColumnIndexByName(e.name),p=g=>{var b;return(b=M.escapeQuickTextFilter(g))!==null&&b!==void 0?b:""};return R(m),f.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?w.getOperatorAsText(i):""," ",Qe.join(a.slice(0,20).map(g=>'"'.concat(p(g),'"'))),a.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:A.groups.high}),f.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,s.map(g=>e.filter().eq(g)).reduce((g,b)=>g.or(b)),i),w.getQuickFilterText(h,a.map(p).join(" || "),i))},order:10,group:A.groups.low}),f.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,s.map(g=>e.filter().notEq(g)).reduce((g,b)=>g.and(b)),i),w.getQuickFilterText(h,a.map(g=>"!=".concat(p(g))).join(" && "),i))},order:20,group:A.groups.low}),f.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(l),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,e.filter().isNull().not().and(s.map(g=>e.filter().contains(g)).reduce((g,b)=>g.or(b))),i),w.getQuickFilterText(h,a.map(g=>"~".concat(p(g))).join(" || "),i))},order:30,group:A.groups.low}),f.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(l),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,e.filter().isNull().or(s.map(g=>e.filter().contains(g).not()).reduce((g,b)=>g.and(b))),i),w.getQuickFilterText(h,a.map(g=>"!~".concat(p(g))).join(" && "),i))},order:40,group:A.groups.low}),f.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,e.filter().isNull().not().and(s.map(g=>e.filter().invoke("startsWith",g)).reduce((g,b)=>g.or(b))),i),w.getQuickFilterText(h,a.map(g=>"".concat(p(g),"*")).join(" || "),i))},order:50,group:A.groups.low}),f.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(m,w.getQuickFilterCondition(c,e.filter().isNull().not().and(s.map(g=>e.filter().invoke("endsWith",g)).reduce((g,b)=>g.or(b))),i),w.getQuickFilterText(h,a.map(g=>"*".concat(p(g))).join(" || "),i))},order:60,group:A.groups.low}),f}numberFilterActions(e,r,n,i){var o=Array.from(r.keys()),a=o.length===1?"".concat(o):"the selected values",s=C=>M.isCharType(e.type)?String.fromCharCode(C):"".concat(C),l=null,u=null;n&&(l=n.filter,u=n.text);var c=[],{model:h}=this.irisGrid.props,f=h.getColumnIndexByName(e.name);if(R(f),c.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?w.getOperatorAsText(i):""," ",Qe.join(o.slice(0,20).map(C=>'"'.concat(s(C),'"'))),o.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:A.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(a),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,o.map(C=>this.getNumberValueEqualsFilter(e,C)).reduce((C,y)=>C.or(y)),i),w.getQuickFilterText(u,o.map(C=>"=".concat(s(C))).join(" || "),i))},order:10,group:A.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(a),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,o.map(C=>this.getNumberValueEqualsFilter(e,C).not()).reduce((C,y)=>C.and(y)),i),w.getQuickFilterText(u,o.map(C=>"!=".concat(s(C))).join(" && "),i))},order:20,group:A.groups.low}),!r.has(Number.NaN)&&!r.has(Number.POSITIVE_INFINITY)&&!r.has(Number.NEGATIVE_INFINITY)&&!M.isCharType(e.type)){var v=o.reduce((C,y)=>C>y?C:y),m=o.reduce((C,y)=>C<y?C:y),p=this.getFilterValueForNumberOrChar(e.type,v),g=this.getFilterValueForNumberOrChar(e.type,m),b="".concat(p),O="".concat(g);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(b),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,e.filter().greaterThan(p),i),w.getQuickFilterText(u,">".concat(s(v)),i))},order:30,group:A.groups.low}),c.push({title:"greater than or equal to",description:"Show only rows where ".concat(e.name," is greater than or equal to ").concat(b),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,e.filter().greaterThanOrEqualTo(p),i),w.getQuickFilterText(u,">=".concat(s(v)),i))},order:40,group:A.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(O),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,e.filter().lessThan(g),i),w.getQuickFilterText(u,"<".concat(s(m)),i))},order:50,group:A.groups.low}),c.push({title:"less than or equal to",description:"Show only rows where ".concat(e.name," is less than or equal to ").concat(O),action:()=>{this.irisGrid.setQuickFilter(f,w.getQuickFilterCondition(l,e.filter().lessThanOrEqualTo(g),i),w.getQuickFilterText(u,"<=".concat(s(m)),i))},order:60,group:A.groups.low})}return c}booleanFilterActions(e,r,n,i){var o=[],{model:a}=this.irisGrid.props,{filter:s,text:l}=n||{},u=a.getColumnIndexByName(e.name);return R(u),o.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?w.getOperatorAsText(i):""," ",'"',r??"null",'"']}),order:1,group:A.groups.high}),o.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(u,w.getQuickFilterCondition(s,e.filter().isTrue(),i),w.getQuickFilterText(l,"true",i))},order:10,group:A.groups.low}),o.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(u,w.getQuickFilterCondition(s,e.filter().isFalse(),i),w.getQuickFilterText(l,"false",i))},order:20,group:A.groups.low}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(u,w.getQuickFilterCondition(s,e.filter().isNull(),i),w.getQuickFilterText(l,"null",i))},order:30,group:A.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(u,w.getQuickFilterCondition(s,e.filter().isNull().not(),i),w.getQuickFilterText(l,"!null",i))},order:40,group:A.groups.low}),o}dateFilterActions(e,r,n,i,o,a){var{dh:s}=this,l=Array.from(r.keys()),u=l.map(D=>s.FilterValue.ofNumber(D)),c=u.length===1?i.format(l[0]):"the selected values",h=l.reduce((D,x)=>D>x?D:x),f=l.reduce((D,x)=>D<x?D:x),v=s.FilterValue.ofNumber(h),m=s.FilterValue.ofNumber(f),p=n.format(h),g=n.format(f),b=i.format(h),O=i.format(f),C=null,y=null;o&&(C=o.filter,y=o.text);var{model:T}=this.irisGrid.props,P=T.getColumnIndexByName(e.name);R(P);var j=[];return j.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[a?w.getOperatorAsText(a):""," ",Qe.join(l.slice(0,20).map(D=>'"'.concat(i.format(D),'"'))),l.length>1&&d.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",l.length," values selected)"]})]}),order:1,group:A.groups.high}),j.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,u.map(D=>e.filter().eq(D)).reduce((D,x)=>D.or(x)),a),w.getQuickFilterText(y,l.map(D=>"=".concat(n.format(D))).join(" || "),a))},order:10,group:A.groups.low}),j.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,u.map(D=>e.filter().notEq(D)).reduce((D,x)=>D.and(x)),a),w.getQuickFilterText(y,l.map(D=>"!=".concat(n.format(D))).join(" && "),a))},order:20,group:A.groups.low}),j.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(O),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,e.filter().lessThan(m),a),w.getQuickFilterText(y,"<".concat(g),a))},order:30,group:A.groups.low}),j.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(O),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,e.filter().lessThanOrEqualTo(m),a),w.getQuickFilterText(y,"<=".concat(g),a))},order:40,group:A.groups.low}),j.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(b),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,e.filter().greaterThan(v),a),w.getQuickFilterText(y,">".concat(p),a))},order:50,group:A.groups.low}),j.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(b),action:()=>{this.irisGrid.setQuickFilter(P,w.getQuickFilterCondition(C,e.filter().greaterThanOrEqualTo(v),a),w.getQuickFilterText(y,">=".concat(p),a))},order:60,group:A.groups.low}),j}emptyStringFilterActions(e,r,n){var{dh:i}=this,o=i.FilterValue.ofString(""),a=r;a||(a={filter:null,text:null});var{filter:s,text:l}=a,u=[],{model:c}=this.irisGrid.props,h=c.getColumnIndexByName(e.name);return R(h),u.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?w.getOperatorAsText(n):""," ",d.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:A.groups.high}),u.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(h,w.getQuickFilterCondition(s,e.filter().eq(o),n),w.getQuickFilterText(l,"=",n))},order:10,group:A.groups.low}),u.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(h,w.getQuickFilterCondition(s,e.filter().notEq(o),n),w.getQuickFilterText(l,"!=",n))},order:20,group:A.groups.low}),u}nullFilterActions(e,r,n){var i=null,o=null;r&&(i=r.filter,o=r.text);var a=[],{model:s}=this.irisGrid.props,l=s.getColumnIndexByName(e.name);return R(l),a.push({menuElement:d.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?w.getOperatorAsText(n):""," ",d.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:A.groups.high}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,w.getQuickFilterCondition(i,e.filter().isNull(),n),w.getQuickFilterText(o,"null",n))},order:10,group:A.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,w.getQuickFilterCondition(i,e.filter().isNull().not(),n),w.getQuickFilterText(o,"!null",n))},order:20,group:A.groups.low}),a}sortByActions(e,r,n){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:o}=i,a=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(n,w.COLUMN_SORT_DIRECTION.ascending)?me:void 0,iconColor:o},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(n,w.COLUMN_SORT_DIRECTION.descending)?me:void 0,iconColor:o},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!n}];return M.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(n,w.COLUMN_SORT_DIRECTION.ascending,!0)?me:void 0,iconColor:o}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(n,w.COLUMN_SORT_DIRECTION.descending,!0)?me:void 0,iconColor:o})),a}additionalSortActions(e,r){var n=this.irisGrid.getTheme(),{contextMenuSortIconColor:i}=n,o=[{title:"Add Sort By",menuElement:d.jsxs("div",{className:"btn-context-menu menu-title",children:[d.jsx("span",{className:"icon",children:d.jsx(K,{icon:me,style:{color:i??void 0}})}),d.jsx("span",{className:"title",children:"Add Additional Sort"}),d.jsx("span",{className:"shortcut",children:Ie.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return M.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(r,w.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),o}checkColumnSort(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===r&&e.isAbs===n:!1}}X(w,"GROUP_EDIT",A.groups.high+10);X(w,"GROUP_HIDE_COLUMNS",A.groups.high+25);X(w,"GROUP_FILTER",A.groups.high+50);X(w,"GROUP_EXPAND_COLLAPSE",A.groups.high+55);X(w,"GROUP_GOTO",A.groups.high+60);X(w,"GROUP_SORT",A.groups.high+75);X(w,"GROUP_COPY",A.groups.high+100);X(w,"GROUP_FORMAT",A.groups.high+150);X(w,"GROUP_VIEW_CONTENTS",A.groups.high+175);X(w,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const hu=w;function Ss(t,e,r){return e=ws(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ws(t){var e=Os(t,"string");return typeof e=="symbol"?e:String(e)}function Os(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ys extends de{constructor(e){super(250),Ss(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,r,n){return n.altKey&&!Ie.isModifierKeyDown(n)&&!n.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([ne.makeCell(e.column,e.row)]),!0):!1}onMove(e,r,n){return n.altKey&&!Ie.isModifierKeyDown(n)&&!n.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const vu=ys;function Ts(t,e,r){return e=Ps(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ps(t){var e=xs(t,"string");return typeof e=="symbol"?e:String(e)}function xs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Es extends de{constructor(e){super(880),Ts(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,r){var{column:n,row:i}=e;return i==null||n==null||this.irisGrid.selectData(n,i),!1}}const mu=Es;function Ns(t,e,r){return e=Ds(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ds(t){var e=Is(t,"string");return typeof e=="symbol"?e:String(e)}function Is(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class js extends de{constructor(e){super(),Ns(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:r,column:n,row:i}=e;if(n!==null&&i===null){var{isFilterBarShown:o,metrics:a}=this.irisGrid.state;if(!a)throw new Error("Metrics not set");var{columnHeaderMaxDepth:s}=a,l=this.irisGrid.getTheme();if(o&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&r>l.columnHeaderHeight*s&&r<=l.columnHeaderHeight*s+l.filterBarHeight)return this.irisGrid.focusFilterBar(n),!0}return!1}onMove(e){var{y:r,column:n}=e,{isFilterBarShown:i,hoverAdvancedFilter:o,metrics:a}=this.irisGrid.state;if(!a)throw new Error("Metrics not set");var{columnHeaderMaxDepth:s}=a,l=this.irisGrid.getTheme(),u=null;return i&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&n!==null&&r>=l.columnHeaderHeight*s&&r<=l.columnHeaderHeight*s+l.filterBarHeight&&(u=n),u!==o&&this.irisGrid.setState({hoverAdvancedFilter:u}),!1}onLeave(e){var{column:r}=e,{hoverAdvancedFilter:n}=this.irisGrid.state;return n!==null&&r!==n&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const fu=js;function Rs(t,e,r){return e=As(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function As(t){var e=Fs(t,"string");return typeof e=="symbol"?e:String(e)}function Fs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class ks extends de{constructor(e){super(750),Rs(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,r){return Ar.isInTreeBox(e,r)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:r,y:n,column:i,row:o}=e;if(i==null||o==null)return null;var{renderer:a,grid:s,state:l,props:u}=this.irisGrid;if(!s)return null;var{metrics:c}=l,{model:h}=u,{canvasContext:f}=s,v=s.getTheme(),m={context:f,mouseX:r,mouseY:n,metrics:c,model:h,theme:v},p=Ae(h)?h.depthForRow(o):null,{left:g,top:b,width:O,height:C}=a.getExpandButtonPosition(m,p);return g==null||O==null||b==null||C==null?null:{left:g,top:b,width:O,height:C}}onMove(e,r){if(Ar.isInTreeBox(e,r)){var{expandCellTooltipProps:n}=this.irisGrid.state,{model:i}=this.irisGrid.props,o=this.getButtonPosition(e),{row:a}=e;R(a);var s=Ae(i)&&i.isRowExpanded(a);Sr(n,o)||this.irisGrid.setState({expandCellTooltipProps:o,expandTooltipDisplayValue:s?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,r)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const gu=ks;function Dt(t,e,r){return e=Gs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gs(t){var e=Ms(t,"string");return typeof e=="symbol"?e:String(e)}function Ms(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class _s extends de{constructor(e){super(),Dt(this,"irisGrid",void 0),Dt(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:r,row:n,columnHeaderDepth:i}=e;return r!==null&&n===null&&i===0?r:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,r,n){var i=this.getColumnFromGridPoint(e);if(i!=null&&i===this.column){var o=Ie.isModifierKeyDown(n);return this.irisGrid.toggleSort(i,o),!0}return!1}}const pu=_s;class Ls extends de{constructor(e){super(),this.irisGrid=e}onWheel(e,r,n){var{irisGrid:i}=this,{model:o}=i.props,{metrics:a,pendingRowCount:s}=i.state;R(a);var{bottom:l,rowCount:u,rowHeight:c}=a,{deltaY:h}=$.getScrollDelta(n);return en(o)&&o.isEditable&&l>=u-1&&h>0&&i.setState({pendingRowCount:s+Math.ceil(h/c)}),!1}}const bu=Ls;function It(t,e,r){return e=$s(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $s(t){var e=Us(t,"string");return typeof e=="symbol"?e:String(e)}function Us(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}class Bs extends de{constructor(e){super(),It(this,"irisGrid",void 0),It(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,r){var{column:n,row:i,x:o,y:a}=e,{renderer:s,metrics:l,props:u}=r,{model:c}=u;if(n==null||i==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:h,modelColumns:f}=l,v=re(h,i),m=re(f,n),p=c.renderTypeForCell(m,v),g=s.getCellRenderer(p);if(!gi(g))return!1;if(this.currentLinkBox!=null){var{x1:b,y1:O,x2:C,y2:y}=this.currentLinkBox;if(o>=b&&o<=C&&a>=O&&a<=y)return!0}for(var T=r.updateRenderState(),P=g.getTokenBoxesForVisibleCell(n,i,T),j=0;j<P.length;j+=1)if(Gr(P[j].token)){var D=$.translateTokenBox(P[j],l),{x1:x,x2:I,y1:N,y2:E}=D;if(o>=x&&o<=I&&a>=N&&a<=E)return this.currentLinkBox=D,!0}return this.currentLinkBox=void 0,!1}setCursor(e,r){return this.isHoveringLink(e,r)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,r){var n=this.isHoveringLink(e,r);if(n&&this.currentLinkBox!=null&&Gr(this.currentLinkBox.token)){var{linkHoverTooltipProps:i}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:o,y1:a,x2:s,y2:l}=this.currentLinkBox,{href:u}=this.currentLinkBox.token,c=s-o,h=l-a,f={left:o,top:a+1,width:c,height:h};Sr(i,f)||this.irisGrid.setState({linkHoverTooltipProps:f,linkHoverDisplayValue:u})}else this.destroyTooltip();return this.setCursor(e,r)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Cu=Bs;class Su extends pi{getGridY(e){var r=super.getGridY(e),{isFilterBarShown:n,theme:i,advancedFilters:o,quickFilters:a,sorts:s,reverseType:l}=e;return n?r+=i.filterBarHeight:(a!=null&&a.size>0||o!=null&&o.size>0)&&(r+=i.filterBarCollapsedHeight),l!==M.REVERSE_TYPE.NONE&&s!=null&&s.length>0&&(r+=i.reverseHeaderBarHeight),r}getUserColumnWidths(){return this.userColumnWidths}}var Hs=new Map([["sortUp",ni],["sortDown",Rr],["caretDown",Rr],["caretRight",ii],["cellOverflow",oi]]),Ws=an((t,e)=>{var r=Hs.get(t);if(r===void 0)throw new Error("Icon is undefined");var n=Array.isArray(r.icon[4])?r.icon[4][0]:r.icon[4],i=new Path2D(n),o=new Path2D,a={a:e/r.icon[0],d:e/r.icon[1]};return o.addPath(i,a),o},{max:1e3});function Fe(t,e){return Ws(t,e)}class Vs{static drawTreeMarker(e,r,n,i,o,a,s){e.save();var{theme:l}=r,{iconSize:u}=l,{x1:c,x2:h,y1:f,y2:v}=o,m=Fe(s?"caretDown":"caretRight",u),p=n+(c+h)/2-u/2,g=i+(v-f-u)/2;e.fillStyle=a,e.textAlign="center",e.translate(p,g),e.fill(m),e.restore()}}const fn=Vs;class zs extends bi{drawCellContent(e,r,n,i){var o,{metrics:a,model:s}=r,{modelColumns:l,modelRows:u}=a,c=re(u,i),h=l.get(n);if(h!==void 0){var f=s.valueForCell(h,c);if(M.isTextType((o=s.columns[h])===null||o===void 0?void 0:o.type)&&(f===null||f==="")){var v=e.font;e.font="italic ".concat(v),super.drawCellContent(e,r,n,i),e.font=v;return}super.drawCellContent(e,r,n,i)}}getTextRenderMetrics(e,r,n){var i=$.getTextRenderMetrics(e,r,n),{mouseX:o,mouseY:a,metrics:s,theme:l}=e;if(o==null||a==null)return i;var{column:u,row:c}=$.getGridPointFromXY(o,a,s);if(r===u&&n===c){var{left:h}=this.getCellOverflowButtonPosition(o,a,s,l);this.shouldRenderOverflowButton(e)&&h!=null&&(i.width=h-s.gridX-i.x)}return i}getCellOverflowButtonPosition(e,r,n,i){var o={left:null,top:null,width:null,height:null};if(e==null||r==null||n==null)return o;var{rowHeight:a,columnWidth:s,left:l,top:u}=$.getCellInfoFromXY(e,r,n);if(l==null||s==null||u==null)return o;var{width:c,verticalBarWidth:h}=n,{cellHorizontalPadding:f,iconSize:v}=i,m=v+2*f,p=a,g=Math.min(n.gridX+l+s,c-h),b=g-m,O=n.gridY+u;return{left:b,top:O,width:m,height:p}}shouldRenderOverflowButton(e){var r,n,{context:i,mouseX:o,mouseY:a,metrics:s,model:l,theme:u}=e;if(o==null||a==null)return!1;var{row:c,column:h,modelRow:f,modelColumn:v}=$.getCellInfoFromXY(o,a,s);if(c==null||h==null||f==null||v==null||!M.isStringType(l.columns[v].type))return!1;var m=(r=l.textForCell(v,f))!==null&&r!==void 0?r:"",{width:p}=$.getTextRenderMetrics(e,h,c),g=(n=s.fontWidths.get(u.font))!==null&&n!==void 0?n:rn;i.save(),i.font=u.font;var b=this.getCachedTruncatedString(i,m,p,g,l.truncationCharForCell(v,f));return i.restore(),m!==""&&b!==m}drawTreeMarker(e,r,n,i,o,a,s){fn.drawTreeMarker(e,r,n,i,o,a,s)}}const Ks=zs;class Qs extends Ci{drawTreeMarker(e,r,n,i,o,a,s){fn.drawTreeMarker(e,r,n,i,o,a,s)}}const qs=Qs;function jt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Rt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jt(Object(r),!0).forEach(function(n){fr(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function fr(t,e,r){return e=Ys(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ys(t){var e=Xs(t,"string");return typeof e=="symbol"?e:String(e)}function Xs(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var sr=Object.freeze({SORT_UP:"sortUp",SORT_DOWN:"sortDown",CARET_DOWN:"caretDown",CARET_RIGHT:"caretRight",CELL_OVERFLOW:"cellOverflow"}),At=10;class gr extends Jt{constructor(){super(...arguments),fr(this,"textCellRenderer",new Ks),fr(this,"dataBarCellRenderer",new qs)}static isFilterValid(e,r){var n=e==null||e.filter!=null,i=r==null||r.filter!=null;return n&&i}getSortIcon(e,r){return e?e.direction===M.sortDirection.ascending?Fe(sr.SORT_UP,r):e.direction===M.sortDirection.descending?Fe(sr.SORT_DOWN,r):null:null}drawCanvas(e){super.drawCanvas(e),this.drawScrim(e)}drawGrid(e,r){super.drawGrid(e,r),this.drawCellOverflowButton(r)}drawGridLines(e,r){super.drawGridLines(e,r),this.drawGroupedColumnLine(e,r),this.drawPendingRowLine(e,r)}drawCellContent(e,r,n,i){var{metrics:o,model:a}=r,{modelColumns:s,modelRows:l}=o,u=s.get(n),c=re(l,i);if(u!==void 0){var h=a.renderTypeForCell(u,c),f=this.getCellRenderer(h);f.drawCellContent(e,r,n,i)}}getCellOverflowButtonPosition(e){var{mouseX:r,mouseY:n,metrics:i,theme:o}=e;return this.textCellRenderer.getCellOverflowButtonPosition(r,n,i,o)}shouldRenderOverflowButton(e){return this.textCellRenderer.shouldRenderOverflowButton(e)}drawCellOverflowButton(e){var{context:r,mouseX:n,mouseY:i,theme:o}=e;if(!(n==null||i==null)&&this.shouldRenderOverflowButton(e)){var{left:a,top:s,width:l,height:u}=this.getCellOverflowButtonPosition(e),{cellHorizontalPadding:c,overflowButtonColor:h,overflowButtonHoverColor:f,iconSize:v}=o;r.save(),f!=null&&a!=null&&l!=null&&s!=null&&u!=null&&n>=a&&n<=a+l&&i>=s&&i<=s+u?r.fillStyle=f:h!=null&&(r.fillStyle=h);var m=Fe(sr.CELL_OVERFLOW,v);a!=null&&s!=null&&u!=null&&r.translate(a+c,s+(u-v)/2),r.fill(m),r.restore()}}drawGroupedColumnLine(e,r){var{metrics:n,model:i,theme:o}=r,{groupedColumns:a}=i,{maxY:s,allColumnWidths:l,allColumnXs:u}=n;if(!(a.length===0||o.groupedColumnDividerColor==null)){var c=a.length-1,h=u.get(c),f=l.get(c);if(!(h==null||f==null)){var v=h+f+.5;e.strokeStyle=o.groupedColumnDividerColor,e.lineWidth=1,e.beginPath(),e.moveTo(v,0),e.lineTo(v,s),e.stroke()}}}drawPendingRowLine(e,r){var{metrics:n,model:i,theme:o}=r,{allRowYs:a,maxX:s}=n,{pendingRowCount:l}=i;if(!(l<=0)){var u=i.rowCount-i.pendingRowCount-i.floatingBottomRowCount,c=a.get(u);c!=null&&(c-=.5,e.save(),e.setLineDash([4,2]),e.strokeStyle=o.pendingTextColor,e.lineWidth=1,e.beginPath(),e.moveTo(0,c),e.lineTo(s,c),e.stroke(),e.restore())}}drawMouseColumnHover(e,r){var{theme:n,metrics:i,hoverSelectColumn:o}=r;if(!(o==null||n.linkerColumnHoverBackgroundColor==null)){var{allColumnWidths:a,allColumnXs:s,maxY:l}=i,u=re(s,o),c=re(a,o);e.fillStyle=n.linkerColumnHoverBackgroundColor,e.fillRect(u,0,c,l)}}drawMouseRowHover(e,r){var{isSelectingColumn:n}=r;n||super.drawMouseRowHover(e,r)}drawScrim(e){var{context:r,loadingScrimProgress:n,metrics:i,theme:o}=e;if(n!=null){var{width:a,height:s,gridY:l}=i,{scrimBlurSize:u,scrimColor:c}=o;r.save(),r.globalCompositeOperation="color",r.filter="blur(".concat(u,"px)"),c!=null&&(r.fillStyle=c),r.beginPath(),r.rect(0,l,a,s-l),r.clip(),r.fillRect(-u,-u+l,u*2+a,(u*2+(s-l))*n),r.globalCompositeOperation="source-over",r.filter="blur(".concat(u,"px) opacity(15%)"),r.fillRect(-u,-u+l,u*2+a,(u*2+(s-l))*n),r.restore()}}drawColumnHeaders(e,r){super.drawColumnHeaders(e,r);var{theme:n,metrics:i,model:o,reverseType:a}=r,{columnHeaderHeight:s}=i;if(this.drawFilterHeaders(e,r),!(s<=0)){var{sort:l}=o;if(l.length===1){var u=a!==M.REVERSE_TYPE.NONE,c;u?c=n.headerReverseBarColor:c=n.headerSortBarColor,this.drawHeaderBar(e,r,c,u?n.reverseHeaderBarHeight:n.sortHeaderBarHeight)}else l.length>1&&(a!==M.REVERSE_TYPE.NONE&&this.drawHeaderBar(e,r,n.headerReverseBarColor,n.reverseHeaderBarHeight,!1),this.drawHeaderBar(e,r,n.headerSortBarColor,n.sortHeaderBarHeight))}}drawHeaderBar(e,r,n,i){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,{theme:a,metrics:s,model:l}=r,{columnHeaderHeight:u,width:c}=s,h=0;o||(h=i),e.fillStyle=a.headerBarCasingColor,e.fillRect(0,l.columnHeaderMaxDepth*u-i-2+h,c,i+2),e.fillStyle=n,e.fillRect(0,l.columnHeaderMaxDepth*u-i-1+h,c,i)}drawColumnHeadersAtDepth(e,r,n,i,o){var{metrics:a,model:s,isMenuShown:l,theme:u}=r,{columnHeaderMaxDepth:c}=s,{width:h}=a,{columnHeaderHeight:f}=u,v=Rt(Rt({},i),{},{maxX:o===c-1&&i.maxX===h?h-(l?0:f):i.maxX});super.drawColumnHeadersAtDepth(e,r,n,v,o)}drawColumnHeaderAtIndex(e,r,n,i){var o,a;super.drawColumnHeaderAtIndex(e,r,n,i);var{metrics:s,model:l,theme:u}=r,{modelColumns:c,allColumnWidths:h,allColumnXs:f,gridX:v,columnHeaderHeight:m,fontWidths:p}=s,{headerHorizontalPadding:g,iconSize:b}=u,O=Math.round(b*.75),C=re(h,n,0),y=re(f,n)+v,T=c.get(n);if(T!=null){var P=(o=l.columns[T])===null||o===void 0?void 0:o.name;if(P!=null){var j=M.getSortForColumn(l.sort,P);if(j){var D=this.getSortIcon(j,O);if(D){var x=l.textForColumnHeader(T);if(x!==void 0){var I=(a=p.get(e.font))!==null&&a!==void 0?a:rn;R(I);var N=x.length*I,E=v+y+N+g,{maxX:k}=i;k-=g;var F=v+y+C-O,G=E>k?E+1:Math.min(k,F),H=(m-O)*.5;e.save(),e.beginPath(),e.rect(y,0,C,m),e.clip(),e.fillStyle=u.headerSortBarColor,e.translate(G,H),e.fill(D),e.restore()}}}}}}drawFilterHeaders(e,r){var{isFilterBarShown:n,quickFilters:i,advancedFilters:o}=r;n?this.drawExpandedFilterHeaders(e,r):(i!=null&&i.size>0||o!=null&&o.size>0)&&this.drawCollapsedFilterHeaders(e,r)}drawExpandedFilterHeaders(e,r){var{metrics:n,model:i,theme:o,quickFilters:a,advancedFilters:s}=r,{filterBarHeight:l}=o;if(!(l<=0)){var{gridX:u,gridY:c,maxX:h,modelColumns:f,visibleColumns:v,allColumnWidths:m,allColumnXs:p}=n,g=c-l;e.save(),e.font=o.filterBarFont,e.textAlign="left",a!=null&&a.size>0||s!=null&&s.size>0?e.fillStyle=o.filterBarExpandedActiveBackgroundColor:e.fillStyle=o.filterBarExpandedBackgroundColor,e.fillRect(u,g,h,l-1),e.fillStyle=o.headerBarCasingColor,e.fillRect(u,g+l-1,h,1);var b=g;e.strokeStyle=o.filterBarSeparatorColor,e.beginPath();for(var O=0;O<v.length;O+=1){var C=v[O],y=re(f,C),T=re(p,C),P=re(m,C);if(i.isFilterable(y)&&P>0){var j=u+(T??0);e.rect(j+.5,b+.5,P,l-2)}}e.stroke();for(var D=0;D<v.length;D+=1){var x=v[D],I=re(m,x),N=re(p,x),E=N+u;this.drawExpandedFilterHeader(e,r,x,E,I)}e.restore()}}drawExpandedFilterHeader(e,r,n,i,o){if(!(o<=0)){var{metrics:a,theme:s,quickFilters:l,advancedFilters:u}=r,{modelColumns:c,gridY:h}=a,{filterBarHeight:f,filterBarExpandedActiveCellBackgroundColor:v,filterBarErrorColor:m,filterBarHorizontalPadding:p,headerColor:g}=s,b=h-f,O=c.get(n);if(O!==void 0){var C=l.get(O),y=u.get(O);if(!(C==null&&y==null)){var T=null;if(C!=null){var{text:P}=C;if(T=P,T||(T=M.getFilterText(C.filter)),T!=null){var{fontWidths:j}=a,D=j.get(e.font);(D==null||D===0)&&(D=e.measureText("8").width,D||(D=10));var x=(o-p*2)/D;x<=0?T="":T.length>x&&(T="".concat(T.substring(0,x-1),"…"))}}e.save();var I=gr.isFilterValid(y,C);if(I&&v!=null)e.fillStyle=v,e.fillRect(i+1,b+1,o-1,f-3);else if(m!=null){e.fillStyle=m,e.lineWidth=2,e.strokeStyle=m;var N=i+2,E=b+2,k=o-3,F=f-5;e.strokeRect(N,E,k,F)}if(T!=null&&T!==""){var G=i+p,H=b+f*.5+1;e.fillStyle=g,e.fillText(T,G,H)}e.restore()}}}}drawCollapsedFilterHeaders(e,r){var{metrics:n,theme:i}=r,{headerSeparatorColor:o,filterBarCollapsedHeight:a}=i;if(!(a<=0)){var{gridX:s,gridY:l,maxX:u,visibleColumns:c,allColumnWidths:h,allColumnXs:f}=n,v=l-a;e.save(),e.fillStyle=o,e.fillRect(s,v,u,a);for(var m=0;m<c.length;m+=1){var p=c[m],g=h.get(p),b=f.get(p);if(b!=null&&g!=null){var O=b+s;this.drawCollapsedFilterHeader(e,r,p,O,g)}}e.restore()}}drawCollapsedFilterHeader(e,r,n,i,o){if(!(o<=0)){var{metrics:a,theme:s,quickFilters:l,advancedFilters:u}=r,{modelColumns:c,gridY:h}=a,f=c.get(n);if(f!==void 0){var v=l.get(f),m=u.get(f),{filterBarCollapsedHeight:p,filterBarActiveColor:g,filterBarActiveBackgroundColor:b,filterBarErrorColor:O}=s;e.save();var C=gr.isFilterValid(m,v);b!=null&&v==null&&m==null?e.fillStyle=b:g!=null&&C?e.fillStyle=g:O!=null&&(e.fillStyle=O);var y=i+1,T=h-p,P=o-1,j=p-1;e.fillRect(y,T,P,j),e.restore()}}}drawRowFooters(e,r){var{metrics:n,model:i,mouseX:o,mouseY:a,theme:s}=r,{gridY:l,gridX:u,maxX:c,modelRows:h,floatingTopHeight:f,floatingBottomHeight:v,floatingRows:m,rowFooterWidth:p,height:g,horizontalBarHeight:b,verticalBarWidth:O,allRowHeights:C,allRowYs:y,width:T}=n;if(!(p<=0||m.length===0)){var{cellHorizontalPadding:P,floatingGridRowColor:j,floatingRowBackgroundColors:D,headerColor:x,rowHoverBackgroundColor:I}=s;e.translate(u,l),e.beginPath();var N=Math.min(c,T-p-O-u);e.fillStyle=D,f>0&&e.rect(N,0,p,f),v>0&&e.rect(N,g-l-b-v,p,v),e.fill();var E=o!=null&&a!=null&&o>=u&&o<=c+p?$.getRowAtY(a,n):null;if(I!=null&&E!==null&&m.includes(E)){e.fillStyle=I;var k=y.get(E),F=C.get(E);R(k),R(F),e.fillRect(N,k,p,F)}if(e.beginPath(),j!=null&&(e.strokeStyle=j),f>0&&(e.moveTo(N+.5,.5),e.lineTo(N+.5,f-.5)),v>0){var G=g-l-b-v;e.moveTo(N-.5,G+.5),e.lineTo(N-.5,G+v-.5)}e.stroke(),e.fillStyle=x,e.textAlign="left";for(var H=N+P,B=0;B<m.length;B+=1){var z=m[B],ve=C.get(z),Me=y.get(z),_e=h.get(z);if(Me!=null&&ve!=null&&_e!=null){var wn=Me+ve*.5;e.fillText(i.textForRowFooter(_e),H,wn)}}e.translate(-u,-l)}}getExpandButtonPosition(e,r){var{mouseX:n,mouseY:i,metrics:o,theme:a}=e,s={left:null,top:null,width:null,height:null};if(n==null||i==null||r==null||!o)return s;var{rowHeight:l,left:u,top:c}=$.getCellInfoFromXY(n,i,o);R(u),R(l),R(c);var{cellHorizontalPadding:h}=a,f=At+2*h,v=Math.max(u+At*r,o.gridX),m=o.gridY+c;return{left:v,top:m,width:f,height:l}}}const Zs="12px Fira Sans, sans-serif",Js="var(--dh-color-white)",el="var(--dh-color-black)",Ft={"grid-bg":"var(--dh-color-grid-bg)",font:Zs,white:Js,black:el,"header-bg":"var(--dh-color-grid-header-bg)","header-color":"var(--dh-color-grid-header-text)","header-height":"30px","header-separator-color":"var(--dh-color-grid-header-separator)","header-separator-hover-color":"var(--dh-color-grid-header-separator-hover)","header-hidden-separator-hover-color":"var(--dh-color-grid-header-separator-hidden-hover)","header-sort-bar-color":"var(--dh-color-grid-header-sort-bar)","header-reverse-bar-color":"var(--dh-color-grid-header-reverse-bar)","header-bar-casing-color":"var(--dh-color-grid-header-bar-casing)","header-font":"600 12px Fira Sans, sans-serif","row-height":"19px","row-background-colors":"var(--dh-color-grid-row-0-bg) var(--dh-color-grid-row-1-bg)","active-cell-selection-border-width":"2px","selection-color":"var(--dh-color-grid-selection)","selection-outline-color":"var(--dh-color-grid-selection-outline)","selection-outline-casing-color":"var(--dh-color-grid-selection-outline-casing)","row-hover-bg":"var(--dh-color-grid-row-hover-bg)","row-shadow-alpha":"var(--dh-color-grid-row-shadow-alpha)","selected-row-hover-bg":"var(--dh-color-grid-row-hover-bg-selected)","scroll-bar-active-selection-tick-color":"var(--dh-color-grid-scroll-bar-active-selection-tick)","scroll-bar-bg":"var(--dh-color-grid-scroll-bar-bg)","scroll-bar-hover-bg":"var(--dh-color-grid-scroll-bar-hover-bg)","scroll-bar-casing-color":"var(--dh-color-grid-scroll-bar-casing)","scroll-bar-corner-color":"var(--dh-color-grid-scroll-bar-corner)","scroll-bar-color":"var(--dh-color-grid-scroll-bar)","scroll-bar-hover-color":"var(--dh-color-grid-scroll-bar-hover)","scroll-bar-active-color":"var(--dh-color-grid-scroll-bar-active)","text-color":"var(--dh-color-grid-text)","hyperlink-color":"var(--dh-color-grid-text-hyperlink)","positive-number-color":"var(--dh-color-grid-number-positive)","negative-number-color":"var(--dh-color-grid-number-negative)","zero-number-color":"var(--dh-color-grid-number-zero)","date-color":"var(--dh-color-grid-date)","pending-text-color":"var(--dh-color-grid-text-pending)","error-text-color":"var(--dh-color-grid-text-error)","null-string-color":"var(--dh-color-grid-string-null)","filter-bar-active-bg":"var(--dh-color-grid-filter-bar-active-bg)","filter-bar-active-color":"var(--dh-color-grid-filter-bar-active)","filter-bar-expanded-bg":"var(--dh-color-grid-filter-bar-expanded-bg)","filter-bar-expanded-active-bg":"var(--dh-color-grid-filter-bar-expanded-active-bg)","filter-bar-expanded-active-cell-bg":"var(--dh-color-grid-filter-bar-expanded-active-cell-bg)","filter-bar-separator-color":"var(--dh-color-grid-filter-bar-separator)","filter-bar-error-color":"var(--dh-color-grid-filter-bar-error)","filter-icon-color":"var(--dh-color-grid-filter-icon)","scrim-color":"var(--dh-color-grid-scrim)","context-menu-sort-icon-color":"var(--dh-color-grid-context-menu-sort-icon)","context-menu-reverse-icon-color":"var(--dh-color-grid-context-menu-reverse-icon)","linker-column-hover-bg":"var(--dh-color-grid-column-linker-hover-bg)","tree-line-color":"var(--dh-color-grid-tree-line)","tree-marker-color":"var(--dh-color-grid-tree-marker)","tree-marker-hover-color":"var(--dh-color-grid-tree-marker-hover)","grouped-column-divider-color":"var(--dh-color-grid-column-grouped-divider)","floating-grid-row-color":"var(--dh-color-grid-floating-row)","floating-row-background-colors":"var(--dh-color-grid-floating-row-bg)","floating-divider-inner-color":"var(--dh-color-grid-floating-divider-inner)","floating-divider-outer-color":"var(--dh-color-grid-floating-divider-outer)","overflow-button-color":"var(--dh-color-grid-overflow-button)","overflow-button-hover-color":"var(--dh-color-grid-overflow-button-hover)","zero-line-color":"var(--dh-color-grid-data-bar-zero-line)","positive-bar-color":"var(--dh-color-grid-data-bar-positive)","negative-bar-color":"var(--dh-color-grid-data-bar-negative)","marker-bar-color":"var(--dh-color-grid-data-bar-marker)"};function kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Gt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?kt(Object(r),!0).forEach(function(n){rl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):kt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function rl(t,e,r){return e=tl(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tl(t){var e=nl(t,"string");return typeof e=="symbol"?e:String(e)}function nl(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Mt=ue.module("IrisGridTheme");function il(){var t,e=ai(Ft);return e["row-background-colors"]=si((t=e["row-background-colors"])!==null&&t!==void 0?t:"").map(r=>{var[n,i]=r;return li.normalizeCssColor(e["row-background-colors"].substring(n,i+1))}).join(" "),Mt.debug2("Iris grid theme:",Ft),Mt.debug2("Iris grid theme derived:",e),Object.freeze(Gt(Gt({},Si),{},{backgroundColor:e["grid-bg"],white:e.white,black:e.black,font:e.font,filterBarFont:e.font,headerBackgroundColor:e["header-bg"],headerColor:e["header-color"],headerSeparatorColor:e["header-separator-color"],headerSeparatorHoverColor:e["header-separator-hover-color"],headerHiddenSeparatorHoverColor:e["header-hidden-separator-hover-color"],headerSortBarColor:e["header-sort-bar-color"],headerReverseBarColor:e["header-reverse-bar-color"],headerBarCasingColor:e["header-bar-casing-color"],headerFont:e["header-font"],rowBackgroundColors:e["row-background-colors"],rowHoverBackgroundColor:e["row-hover-bg"],selectionColor:e["selection-color"],selectionOutlineColor:e["selection-outline-color"],selectionOutlineCasingColor:e["selection-outline-casing-color"],selectedRowHoverBackgroundColor:e["selected-row-hover-bg"],scrollBarBackgroundColor:e["scroll-bar-bg"],scrollBarHoverBackgroundColor:e["scroll-bar-hover-bg"],scrollBarCasingColor:e["scroll-bar-casing-color"],scrollBarCornerColor:e["scroll-bar-corner-color"],scrollBarColor:e["scroll-bar-color"],scrollBarHoverColor:e["scroll-bar-hover-color"],scrollBarActiveColor:e["scroll-bar-active-color"],scrollBarSelectionTickColor:e["selected-row-hover-bg"],scrollBarActiveSelectionTickColor:e["scroll-bar-active-selection-tick-color"],textColor:e["text-color"],hyperlinkColor:e["hyperlink-color"],positiveNumberColor:e["positive-number-color"],negativeNumberColor:e["negative-number-color"],zeroNumberColor:e["zero-number-color"],dateColor:e["date-color"],pendingTextColor:e["pending-text-color"],errorTextColor:e["error-text-color"],nullStringColor:e["null-string-color"],filterBarActiveBackgroundColor:e["filter-bar-active-bg"],filterBarExpandedBackgroundColor:e["filter-bar-expanded-bg"],filterBarExpandedActiveBackgroundColor:e["filter-bar-expanded-active-bg"],filterBarExpandedActiveCellBackgroundColor:e["filter-bar-expanded-active-cell-bg"],filterBarSeparatorColor:e["filter-bar-separator-color"],filterBarActiveColor:e["filter-bar-active-color"],filterBarErrorColor:e["filter-bar-error-color"],filterIconColor:e["filter-icon-color"],scrimColor:e["scrim-color"],contextMenuSortIconColor:e["context-menu-sort-icon-color"],contextMenuReverseIconColor:e["context-menu-reverse-icon-color"],allowRowResize:!1,autoSelectRow:!0,gridColumnColor:null,gridRowColor:null,groupedColumnDividerColor:e["grouped-column-divider-color"],columnHoverBackgroundColor:null,headerHorizontalPadding:12,scrollBarSize:13,scrollBarHoverSize:16,minScrollHandleSize:24,rowHeight:parseInt(e["row-height"],10)||19,columnWidth:100,rowHeaderWidth:0,rowFooterWidth:60,columnHeaderHeight:parseInt(e["header-height"],10)||30,filterBarHeight:30,filterBarCollapsedHeight:5,sortHeaderBarHeight:2,reverseHeaderBarHeight:4,filterBarHorizontalPadding:4,iconSize:16,activeCellSelectionBorderWidth:parseInt(e["active-cell-selection-border-width"],10)||2,shadowAlpha:parseFloat(e["row-shadow-alpha"])||.15,scrimBlurSize:25,minScrimTransitionTime:150,maxScrimTransitionTime:350,scrollSnapToRow:!0,linkerColumnHoverBackgroundColor:e["linker-column-hover-bg"],treeLineColor:e["tree-line-color"],treeMarkerColor:e["tree-marker-color"],treeMarkerHoverColor:e["tree-marker-hover-color"],floatingGridColumnColor:null,floatingGridRowColor:e["floating-grid-row-color"],floatingRowBackgroundColors:e["floating-row-background-colors"],floatingDividerInnerColor:e["floating-divider-inner-color"],floatingDividerOuterColor:e["floating-divider-outer-color"],overflowButtonColor:e["overflow-button-color"],overflowButtonHoverColor:e["overflow-button-hover-color"],zeroLineColor:e["zero-line-color"],positiveBarColor:e["positive-bar-color"],negativeBarColor:e["negative-bar-color"],markerBarColor:e["marker-bar-color"],density:{compact:{cellHorizontalPadding:5,headerHorizontalPadding:10,minColumnWidth:10,rowHeight:16,font:"11px Fira Sans, sans-serif",iconSize:14,columnHeaderHeight:26},spacious:{cellHorizontalPadding:7,headerHorizontalPadding:15,rowHeight:28}}}))}var _t=ue.module("useTableListener"),ol=(t,e,r)=>S.useEffect(function(){if(t==null){_t.debug2("Emitter undefined, skipping addEventListener",e);return}return _t.debug2("Adding listener",e),t.addEventListener(e,r)},[t,e,r]);const gn=ol;function pn(t,e){return e==null?t.columns[0]:t.findColumn(e)}function bn(t,e,r){return r==null?e:t.findColumn(r)}function al(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"?t:String(t)}function sl(t,e){return String(t)}function ll(t){var{table:e,descriptionColumnName:r,iconColumnName:n,keyColumnName:i,labelColumnName:o,formatValue:a=sl}=t,s=S.useMemo(()=>e==null?null:pn(e,i),[i,e]),l=S.useMemo(()=>e==null||s==null?null:bn(e,s,o),[s,o,e]),u=S.useMemo(()=>e==null||r==null?null:e.findColumn(r),[r,e]),c=S.useMemo(()=>e==null||n==null?null:e.findColumn(n),[n,e]),h=S.useCallback(f=>{R(s,"keyColumn cannot be null."),R(l,"labelColumn cannot be null.");var v=al(f.get(s)),m=a(f.get(l),l.type),p=u==null?void 0:a(f.get(u),u.type),g=c==null?void 0:f.get(c);return{key:v,content:m,textValue:m,description:p,icon:g}},[u,a,c,s,l]);return h}function ul(t){var e=rr(),r=S.useMemo(()=>{var s=Mi(e,t);return tn(s),s},[e,t]),{getColumnFormat:n,getColumnFormatMapForType:i,getColumnTypeFormatter:o,getFormattedString:a}=r;return{getColumnFormat:n,getColumnFormatMapForType:i,getColumnTypeFormatter:o,getFormattedString:a,timeZone:r.timeZone}}function Cn(){var t=rr();return S.useMemo(()=>new M(t),[t])}function Lt(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(u){r(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function dl(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(l){Lt(o,n,i,a,s,"next",l)}function s(l){Lt(o,n,i,a,s,"throw",l)}a(void 0)})}}function cl(t){var{columnName:e,value:r,table:n}=t,i=Cn();return S.useCallback(dl(function*(){if(n==null||r==null||e==null)return null;var o=n.findColumn(e),a=i.getValueType(o.type),s=yield n.seekRow(0,o,a,r);return s===-1?null:s}),[e,n,i,r])}function Sn(t){var[,e]=S.useState(0),r=rr(),n=S.useCallback(()=>{e(i=>i+1)},[]);return gn(t,r.Table.EVENT_SIZECHANGED,n),on(t)}var hl=ue.module("useInitializeViewportData");function vl(t){var{items:e,targetSize:r,reuseExistingItems:n}=t,i=e.length;return i===r?e:(hl.debug("size changed:",{currentSize:i,targetSize:r}),n?i>r?e.slice(0,r):[...e,...Fr(i,r-1)]:Array.from(Fr(0,r-1)))}function ml(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=Ui({}),n=Math.max(0,Sn(t));return S.useEffect(()=>{r.setItems(vl({items:r.items,targetSize:n,reuseExistingItems:e}))},[n,t]),r}function fl(t,e,r){return S.useCallback(function(i){var[o,a]=Di(i,e,r,on(t));t?.setViewport(o,a)},[t,r,e])}var gl=150,pl=200,bl=250,Cl=500,lr=ue.module("useViewportData");function Sl(t){var{table:e,itemHeight:r=1,scrollDebounce:n=gl,viewportSize:i=10,viewportPadding:o=50,deserializeRow:a=ji,reuseItemsOnTableResize:s=!1}=t,l=S.useRef(0),u=ml(e,s),c=fl(e,i,o),h=S.useCallback(O=>{l.current=O,e&&!kr(e)?c(O):lr.debug("setViewport called on closed table.",e)},[e,c]),f=S.useCallback(O=>{e&&!kr(e)?(e.applyFilter(O),h(0)):lr.debug("applyFiltersAndRefresh called on closed table.",e)},[h,e]),v=rr(),m=S.useRef();m.current=S.useMemo(()=>Ii(u,a),[a,u]);var p=S.useCallback(O=>{var C;(C=m.current)===null||C===void 0||C.call(m,O)},[]);gn(e,v.Table.EVENT_UPDATED,p);var g=Sn(e);S.useEffect(()=>{lr.debug("Initializing viewport"),h(0)},[e,h]),S.useEffect(()=>{h(l.current)},[h,g]);var b=$i(r,h,n);return S.useMemo(()=>({viewportData:u,size:g,table:e,applyFiltersAndRefresh:f,setViewport:h,onScroll:b}),[f,b,h,g,e,u])}function wl(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];return S.useMemo(()=>Ri(...r.map(i=>i(t))),[t,...r])}function Ol(t,e){var{applyFiltersAndRefresh:r}=t;S.useEffect(()=>{r(e)},[r,e])}var yl=["additionalFilterConditionFactories","searchColumnNames","timeZone"];function $t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function ur(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$t(Object(r),!0).forEach(function(n){Tl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tl(t,e,r){return e=Pl(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Pl(t){var e=xl(t,"string");return typeof e=="symbol"?e:String(e)}function xl(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function El(t,e){if(t==null)return{};var r=Nl(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Nl(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}function Dl(t){var{additionalFilterConditionFactories:e=[],searchColumnNames:r,timeZone:n}=t,i=El(t,yl),o=Cn(),[a,s]=S.useState(""),l=S.useMemo(()=>Ai(o,r,a,n),[r,a,o,n]),u=wi(s,pl),c=Sl(ur({itemHeight:hi,viewportSize:Cl,viewportPadding:bl},i)),h=wl(c.table,l,...e);return Ol(c,h),ur(ur({},c),{},{onSearchTextChange:u})}var Il=["table","keyColumn","labelColumn","iconColumn","settings","onChange","onSelectionChange"];function Ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ut(Object(r),!0).forEach(function(n){jl(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ut(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jl(t,e,r){return e=Rl(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rl(t){var e=Al(t,"string");return typeof e=="symbol"?e:String(e)}function Al(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ht(t,e,r,n,i,o,a){try{var s=t[o](a),l=s.value}catch(u){r(u);return}s.done?e(l):Promise.resolve(l).then(n,i)}function Fl(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function a(l){Ht(o,n,i,a,s,"next",l)}function s(l){Ht(o,n,i,a,s,"throw",l)}a(void 0)})}}function kl(t,e){if(t==null)return{};var r=Gl(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Gl(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var Ml=ue.module("jsapi-components.usePickerProps");function _l(t){var e,{table:r,keyColumn:n,labelColumn:i,iconColumn:o,settings:a,onChange:s,onSelectionChange:l}=t,u=kl(t,Il),{itemHeight:c}=vi(),{getFormattedString:h,timeZone:f}=ul(a),v=u.selectedKey===void 0,[m,p]=S.useState(u.defaultSelectedKey),{data:g}=Li(M.copyTableAndApplyFilters,[r]),b=S.useMemo(()=>g==null?null:pn(g,n),[n,g]),O=S.useMemo(()=>g==null||b==null?null:bn(g,b,i),[b,i,g]),C=S.useMemo(()=>O==null?[]:[O.name],[O]),y=ll({table:g,iconColumnName:o,keyColumnName:n,labelColumnName:i,formatValue:h}),T=cl({table:g,columnName:(e=b?.name)!==null&&e!==void 0?e:null,value:v?m:u.selectedKey}),P=S.useCallback(Fl(function*(){var E=yield T();return E==null?null:E*c+mi}),[T,c]),{onScroll:j,onSearchTextChange:D,setViewport:x,viewportData:I}=Dl({reuseItemsOnTableResize:!0,table:g,itemHeight:c,deserializeRow:y,searchColumnNames:C,timeZone:f});S.useEffect(function(){var k=!1;return T().then(F=>{F==null||k||x(F)}).catch(F=>{Ml.error("Error setting viewport from selected key",F)}),()=>{k=!0}},[T,a,x]);var N=S.useCallback(E=>{var k;v&&p(E),(k=s??l)===null||k===void 0||k(E)},[v,s,l]);return Bt(Bt({},u),{},{normalizedItems:I.items,showItemIcons:o!=null,getInitialScrollPosition:P,onChange:N,onScroll:j,onSearchTextChange:D})}function Wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ll(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Wt(Object(r),!0).forEach(function(n){$l(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Wt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $l(t,e,r){return e=Ul(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ul(t){var e=Bl(t,"string");return typeof e=="symbol"?e:String(e)}function Bl(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wu(t){var e=_l(t);return d.jsx(Oi,Ll({},e))}var Hl=S.createContext({theme:null,density:"regular"});function Ou(t){var{children:e,density:r="regular"}=t,{activeThemes:n}=Fi(),i=S.useMemo(()=>il(),[n]),o=S.useMemo(()=>({theme:i,density:r}),[i,r]);return d.jsx(Hl.Provider,{value:o,children:e})}export{il as $,eu as A,hu as B,nu as C,vu as D,mu as E,ru as F,fu as G,Su as H,sn as I,gr as J,gu as K,pu as L,Hl as M,Ou as N,Cu as O,wu as P,so as Q,ou as R,pl as S,bu as T,ho as U,Cl as V,au as W,go as X,su as Y,te as Z,lu as _,Li as a,jo as a0,Ui as b,gn as c,Bi as d,_l as e,ul as f,ll as g,Sl as h,Cn as i,wl as j,Ol as k,bl as l,cl as m,ml as n,Dl as o,fl as p,Sn as q,Jl as r,Ji as s,iu as t,$i as u,tu as v,no as w,uu as x,du as y,cu as z};
|
|
11
|
-
//# sourceMappingURL=IrisGridThemeProvider-1dfd5be9.js.map
|