@deephaven/code-studio 0.77.1-beta.2 → 0.77.1-beta.5

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.
Files changed (48) hide show
  1. package/build/assets/{AppRoot-280e670c.js → AppRoot-731f2be3.js} +3 -3
  2. package/build/assets/{AppRoot-280e670c.js.map → AppRoot-731f2be3.js.map} +1 -1
  3. package/build/assets/{Chart-ebd8c605.js → Chart-014140d1.js} +2 -2
  4. package/build/assets/{Chart-ebd8c605.js.map → Chart-014140d1.js.map} +1 -1
  5. package/build/assets/{ControlType-f1bb8293.js → ControlType-bc4c99a5.js} +3 -3
  6. package/build/assets/{ControlType-f1bb8293.js.map → ControlType-bc4c99a5.js.map} +1 -1
  7. package/build/assets/FontBootstrap-301270dd.css +1 -0
  8. package/build/assets/{FontBootstrap-753901ab.js → FontBootstrap-c53b2074.js} +2 -2
  9. package/build/assets/{FontBootstrap-753901ab.js.map → FontBootstrap-c53b2074.js.map} +1 -1
  10. package/build/assets/{FormatterUtils-29aa8e1a.js → FormatterUtils-80d69a67.js} +2 -2
  11. package/build/assets/{FormatterUtils-29aa8e1a.js.map → FormatterUtils-80d69a67.js.map} +1 -1
  12. package/build/assets/{Grid-e1236296.js → Grid-852bd41d.js} +2 -2
  13. package/build/assets/{Grid-e1236296.js.map → Grid-852bd41d.js.map} +1 -1
  14. package/build/assets/{GridRenderer-ed7dbad4.js → GridRenderer-a0eb99f6.js} +2 -2
  15. package/build/assets/{GridRenderer-ed7dbad4.js.map → GridRenderer-a0eb99f6.js.map} +1 -1
  16. package/build/assets/{IrisGrid-105d172d.js → IrisGrid-2abddbb9.js} +2 -2
  17. package/build/assets/{IrisGrid-105d172d.js.map → IrisGrid-2abddbb9.js.map} +1 -1
  18. package/build/assets/{IrisGridModel-61ddc43e.js → IrisGridModel-5e676159.js} +2 -2
  19. package/build/assets/{IrisGridModel-61ddc43e.js.map → IrisGridModel-5e676159.js.map} +1 -1
  20. package/build/assets/{IrisGridShortcuts-d4875242.js → IrisGridShortcuts-e8e5a936.js} +2 -2
  21. package/build/assets/{IrisGridShortcuts-d4875242.js.map → IrisGridShortcuts-e8e5a936.js.map} +1 -1
  22. package/build/assets/{IrisGridThemeProvider-47181f2a.css → IrisGridThemeProvider-3984e29a.css} +1 -1
  23. package/build/assets/{IrisGridThemeProvider-b7f4c598.js → IrisGridThemeProvider-ac44d4e8.js} +2 -2
  24. package/build/assets/{IrisGridThemeProvider-b7f4c598.js.map → IrisGridThemeProvider-ac44d4e8.js.map} +1 -1
  25. package/build/assets/{MarkdownEditor-f869507d.js → MarkdownEditor-ae519af0.js} +2 -2
  26. package/build/assets/{MarkdownEditor-f869507d.js.map → MarkdownEditor-ae519af0.js.map} +1 -1
  27. package/build/assets/{MarkdownNotebook-d2c01a48.js → MarkdownNotebook-25c4457d.js} +2 -2
  28. package/build/assets/{MarkdownNotebook-d2c01a48.js.map → MarkdownNotebook-25c4457d.js.map} +1 -1
  29. package/build/assets/{MissingPartitionError-bd4a06dd.js → MissingPartitionError-a843549f.js} +2 -2
  30. package/build/assets/{MissingPartitionError-bd4a06dd.js.map → MissingPartitionError-a843549f.js.map} +1 -1
  31. package/build/assets/{StyleGuideRoot-773a2aaf.js → StyleGuideRoot-f281479f.js} +2 -2
  32. package/build/assets/{StyleGuideRoot-773a2aaf.js.map → StyleGuideRoot-f281479f.js.map} +1 -1
  33. package/build/assets/{index-470b8a54.css → index-13e1b819.css} +1 -1
  34. package/build/assets/{index-f720412a.js → index-170c3e27.js} +3 -3
  35. package/build/assets/{index-f720412a.js.map → index-170c3e27.js.map} +1 -1
  36. package/build/assets/{index-d7716c14.js → index-2cecc484.js} +2 -2
  37. package/build/assets/{index-d7716c14.js.map → index-2cecc484.js.map} +1 -1
  38. package/build/assets/index-3a104f6a.css +1 -0
  39. package/build/assets/index-c8de27d0.js +2 -0
  40. package/build/assets/index-c8de27d0.js.map +1 -0
  41. package/build/assets/{useUser-01f40e41.js → useUser-44ab9c75.js} +2 -2
  42. package/build/assets/{useUser-01f40e41.js.map → useUser-44ab9c75.js.map} +1 -1
  43. package/build/index.html +2 -2
  44. package/package.json +30 -30
  45. package/build/assets/FontBootstrap-832a937c.css +0 -1
  46. package/build/assets/index-3ad3aa8a.js +0 -2
  47. package/build/assets/index-3ad3aa8a.js.map +0 -1
  48. package/build/assets/index-e500652d.css +0 -1
@@ -1,3 +1,3 @@
1
- import{r as y,_ as $r,I as s,K as Y,Z as bi,M as ke,L as Z,J as Ei,T as rt,be as De,U as J,bb as na,bc as aa,ba as oa,$ as hr,af as di,V as At}from"./vendor-2ad5ff96.js";import{L as ce,f as Ai,I as kt,e as L,g as Ri,br as mr,T as yi,ai as sa,aj as la,bs as _i,bt as Pt,bu as ua,bv as Ue,bw as da,bx as ca,aF as wi,aV as Fi,by as ha,bz as ma,bA as pa,an as va,bB as pr,F as vr,bC as ci,bD as ga,ao as fa,bE as Ca,ah as Sa,bF as Ta,bG as ba,ar as Ea,aL as ya,M as wa,b as Fa,bH as Na,bI as Oa,c as Aa,j as Qr,A as Ra,bJ as _a,bK as xa,bg as Da,am as Ia,bL as Pa,r as La,bM as Ua,bN as ja,bO as ka,bP as Ga,av as Ma,bQ as Va,b3 as Ba}from"./index-d7716c14.js";import{c as T,S as nt,B as W,x as xi,P as Oe,O as ht,cJ as $a,t as Ae,b8 as Di,aM as Hr,aa as Ii,ao as Qa,s as Xe,bb as Dt,b as Ct,a as we,I as Ke,G as Ha,al as U,ck as hi,ai as de,ci as Ve,A as Wr,Q as Wa,aj as Kr,C as Ka,cm as Yr,J as Ya,cF as qa,T as Te,F as mi,cK as za,bq as Xa}from"./ControlType-f1bb8293.js";import{j as Za,k as Ja,l as eo,n as to,I as ie,d as Ni,a as Lt,b as Rt,g as io,h as ro}from"./MissingPartitionError-bd4a06dd.js";import{d as Fe,G as ge,i as $e,e as Be,h as gr,c as xe}from"./IrisGridModel-61ddc43e.js";import{T as no,c as ao,F as oo,O as K,n as so,l as Ye,f as lo,e as uo,A as co,a as ho,R as mo,b as po,V as vo,C as go,m as fo,g as Co}from"./IrisGridThemeProvider-b7f4c598.js";import{S as So,l as Re,k as To,c as qr,C as zr,a as bo,e as Eo,P as fr}from"./GridRenderer-ed7dbad4.js";import{I as Ne,a as Cr,S as yo,D as wo}from"./IrisGridShortcuts-d4875242.js";import{K as Gt,a as Sr,i as Fo,G as No}from"./Grid-e1236296.js";import{F as Tr}from"./FormatterUtils-29aa8e1a.js";import"./helpers-de833af9.js";import"./monaco-b5248072.js";function br(r,e,t){return e=Oo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Oo(r){var e=Ao(r,"string");return typeof e=="symbol"?e:String(e)}function Ao(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _t=ce.module("AdvancedFilterCreatorFilterItem");class Pi extends y.PureComponent{static getLabelForFilter(e,t){try{if(T.isNumberType(e)||T.isCharType(e))return Za(t);if(T.isTextType(e))return Ja(t);if(T.isDateType(e))return eo(t);if(T.isBooleanType(e))return to(t);throw new Error("Unrecognized column type: ".concat(e))}catch(i){return _t.warn(i),""}}constructor(e){super(e),br(this,"typeDropdown",void 0),br(this,"getCachedIsValid",$r((a,o,u,l,d)=>{try{return!u||d.makeAdvancedValueFilter(a,o,u,l)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var{value:t="",filterTypes:i,selectedType:n=i[0]}=e;this.state={selectedType:n,value:t}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var{value:t,selectedType:i}=this.props;i!==void 0&&e.selectedType!==i&&this.setState({selectedType:i}),t!==void 0&&e.value!==t&&this.setState({value:t})}handleTypeChange(e){var t=e;_t.debug2("typeChange",t),this.setState({selectedType:t});var{onChange:i}=this.props,{value:n}=this.state;n!=null&&n.length>0&&i(t,n)}handleValueChange(e){_t.debug2("valueChange");var{value:t}=e.target;this.setState({value:t});var{onChange:i}=this.props,{selectedType:n}=this.state;n!=null&&i(n,t)}handleDelete(){_t.debug("delete");var{onDelete:e}=this.props;e()}render(){for(var{column:e,filterTypes:t,formatter:i,tableUtils:n}=this.props,{selectedType:a,value:o}=this.state,u=!T.isBooleanType(e.type),l=[],d=this.getCachedIsValid(e,a,o,i.timeZone,n),c=0;c<t.length;c+=1){var h=t[c],p=Pi.getLabelForFilter(e.type,h),m=s.jsx("option",{value:h,children:p},h);l.push(m)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(nt,{className:"form-control",value:a,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:l})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:Y("form-control",{error:!d}),placeholder:"Enter value",value:o,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(W,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Ai,tooltip:"Remove Filter"})})]})})}}const Ro=Pi;function Oi(r,e,t){return e=_o(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _o(r){var e=xo(r,"string");return typeof e=="symbol"?e:String(e)}function xo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Er=ce.module("AdvancedFilterCreatorSelectValueList");class bt extends y.PureComponent{static indexOf(e,t){for(var i=0;i<t.length;i+=1){var n=t[i];if(n===e||n!=null&&n.valueOf!=null&&e!=null&&e.valueOf!=null&&n.valueOf()===e.valueOf())return i}return-1}constructor(e){super(e),Oi(this,"dh",void 0),Oi(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var{selectedValues:t,dh:i}=this.props;this.dh=i,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:t,isLoading:!0}}componentDidMount(){var{table:e}=this.props;e&&this.startListening(e)}componentDidUpdate(e){var{filters:t,invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&(e.table&&this.stopListening(e.table),a&&this.startListening(a),this.resetViewport()),e.invertSelection!==i&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==n&&this.setState({selectedValues:n},this.handleSelectionUpdate),e.filters!==t&&(a?.applyFilter(t),this.resetViewport())}componentWillUnmount(){var{table:e}=this.props;e&&this.stopListening(e)}handleSelect(e,t){var{invertSelection:i}=this.props,{selectedValues:n}=this.state;n=[...n];var a=bt.indexOf(t,n);a>=0?n.splice(a,1):n.push(t);var o=a<0;i&&(o=!o);var{offset:u}=this.state,{items:l}=this.state;l=[...l];var d=e-u;d>=0&&d<l.length&&(l[d].isSelected=o),this.setState({items:l,selectedValues:n});var{onChange:c}=this.props;c(n,i)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var{table:t,formatter:i}=this.props;if(t){for(var n=e.detail,{offset:a}=n,o=[],u=t.columns[0],l=0;l<n.rows.length;l+=1){var d=n.rows[l],c=d.get(u),h=void 0;c==null?h=s.jsx("i",{className:"text-muted",children:"null"}):c===""?h=s.jsx("i",{className:"text-muted",children:"empty"}):h=i.getFormattedString(c,u.type,u.name);var p=this.isValueSelected(c);o.push({displayValue:h,value:c,isSelected:p})}Er.debug2("Received table update:",a,o.length);var m=t.size;this.setState({itemCount:m,items:o,offset:a,isLoading:!1})}}isValueSelected(e){var{invertSelection:t}=this.props,{selectedValues:i}=this.state,n=bt.indexOf(e,i);return t?n<0:n>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var{items:e}=this.state;e=[...e];for(var t=0;t<e.length;t+=1){var i=e[t],{value:n}=i;i.isSelected=this.isValueSelected(n)}this.setState({items:e})}updateViewport(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{table:n}=this.props;if(n!=null){i&&this.setState({isLoading:!0});var a=t-e+1,o=Math.max(0,e-a*3),u=Math.max(o,t+a*3);Er.debug2("Setting viewport",o,",",u),n.setViewport(o,u)}}render(){var{offset:e,isLoading:t,items:i,itemCount:n}=this.state;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(So,{itemCount:n,items:i,offset:e,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:a=>{this.list=a}}),s.jsx(xi,{in:t,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(kt,{className:"loading-spinner-large"})})})]})}}Oi(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});const Do=bt;function St(r,e,t){return e=Io(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Io(r){var e=Po(r,"string");return typeof e=="symbol"?e:String(e)}function Po(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt extends y.PureComponent{constructor(e){super(e),St(this,"searchTablePromise",void 0),St(this,"tableUtils",void 0),St(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var{dh:t,invertSelection:i,selectedValues:n}=e;this.tableUtils=new T(t),this.state={filters:[],invertSelection:i,selectedValues:n,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var{invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&this.initSearchTable(),e.invertSelection!==i&&this.setState({invertSelection:i}),e.selectedValues!==n&&this.setState({selectedValues:n});var{table:o,searchText:u}=this.state;o!==t.table&&(t.table!=null&&t.table.close(),o!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var{table:e}=this.state;e?.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var{table:e}=this.props;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var{invertSelection:e,selectedValues:t,table:i}=this.state;return i==null?null:e?i.totalSize-t.length:t.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),{table:t}=this.state,{formatter:i}=this.props;if(e!=null&&t!=null){var n=i.getFormattedString(e,"long"),a=i.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(n," of ").concat(a)}return null}initSearchTable(){var{table:e}=this.props;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(i=>{this.searchTablePromise===t?(this.setState({table:i}),this.searchTablePromise=void 0):i.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var{onChange:i}=this.props;i(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var{onChange:i}=this.props;i(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,yt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var{table:e,searchText:t}=this.state,{timeZone:i}=this.props,{tableUtils:n}=this,a=e?.columns[0],o=[];if(a!=null){var u;if(t.length>0){var l=null;T.isCharType(a.type)?l=n.makeQuickFilter(a,t):T.isTextType(a.type)?l=n.makeQuickFilter(a,"~".concat(t),i):l=n.makeQuickFilter(a,">=".concat(t),i),l!=null?o.push(l):u="Invalid search text"}this.setState({filters:o,error:u})}}render(){var{error:e,filters:t,invertSelection:i,selectedValues:n,searchText:a,table:o}=this.state,{dh:u,formatter:l,showSearch:d}=this.props,c=this.getColumnName(),h=this.getDisplayedValueText(),p=c?"Find ".concat(c,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:d?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),d&&s.jsx("input",{type:"text",className:Y("form-control",{"is-invalid":e!=null}),id:"advanced-filter-creator-select-value-input",placeholder:p,value:a,onChange:this.handleSearchChange})]}),s.jsx(Do,{dh:u,table:o,filters:t,invertSelection:i,selectedValues:n,formatter:l,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(W,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(W,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(xi,{in:h!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:h})})]})]})}}St(yt,"searchDebounceTime",250);St(yt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});const Lo=yt;function it(r,e,t){return e=Uo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uo(r){var e=jo(r,"string");return typeof e=="symbol"?e:String(e)}function jo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mt=ce.module("AdvancedFilterCreator");class Ie extends y.PureComponent{static makeFilterItem(){return{key:bi()}}constructor(e){var t,i;super(e),it(this,"focusTrapContainer",void 0),it(this,"debounceTimeout",void 0),it(this,"valuesTablePromise",void 0),it(this,"getFilterTypes",$r(m=>T.getFilterTypes(m))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=ke.createRef();var{model:n,column:a,options:o}=e,{filterOperators:u,invertSelection:l,selectedValues:d}=o,c=(t=(i=o.filterItems)===null||i===void 0?void 0:i.map(m=>{var{selectedType:f,value:C}=m;return{selectedType:f,value:C,key:bi()}}))!==null&&t!==void 0?t:[];c.length===0&&c.push(Ie.makeFilterItem()),u==null&&(u=[]),l==null&&(l=!0),d==null&&(d=[]);var h=n.getColumnIndexByName(a.name);L(h);var p=n.isColumnSortable(h);this.state={filterItems:c,filterOperators:u,invertSelection:l,selectedValues:d,valuesTableError:null,valuesTable:void 0,isSortable:p}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var{model:e,column:t}=this.props;if(!e.isValuesTableAvailable){mt.debug("No values table for this model, just ignore");return}this.valuesTablePromise=T.makeCancelableTablePromise(e.valuesTable(t)),this.valuesTablePromise.then(i=>{var n;if(!((n=i.columns[0].isSortable)!==null&&n!==void 0)||n){var a=i.columns[0].sort().asc();i.applySort([a])}this.setState({valuesTable:i})}).catch(i=>{Oe.isCanceled(i)||(mt.error("Unable to open values table",i),this.setState({valuesTableError:i}))})}handleFocusTrapEnd(){var e,t;((e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t,i=(e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelectorAll("button,select,input,textarea");if(i&&i.length>0){var n=i[i.length-1];n.focus()}}handleAddAnd(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.and),this.setState({filterItems:e,filterOperators:t})}handleAddOr(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.or),this.setState({filterItems:e,filterOperators:t})}handleChangeFilterOperator(e,t){var{filterOperators:i}=this.state;i=[...i],$a(t),i[e]=t,this.setState({filterOperators:i}),this.startUpdateTimer()}handleFilterChange(e,t,i){var{filterItems:n}=this.state;n=[...n];var{key:a}=n[e];n[e]={key:a,selectedType:t,value:i},this.setState({filterItems:n}),this.startUpdateTimer()}handleFilterDelete(e){var{filterItems:t,filterOperators:i}=this.state;t=[...t],i=[...i],e<t.length&&t.splice(e,1),e<i.length?i.splice(e,1):e===i.length&&i.splice(i.length-1,1),t.length===0&&t.push(Ie.makeFilterItem()),this.setState({filterItems:t,filterOperators:i}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){mt.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ie.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.descending,t)}handleSortUp(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.ascending,t)}handleSubmit(e){mt.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){mt.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var{onDone:t}=this.props;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var{filterItems:e}=this.state;if(e.length===0)return!1;var t=e[e.length-1],{selectedType:i,value:n}=t;return i!=null&&i.length>0&&n!=null&&n.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{column:i,onSortChange:n}=this.props,{isSortable:a}=this.state;a&&n(i,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ie.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var{filterItems:e,filterOperators:t,invertSelection:i,selectedValues:n}=this.state,{column:a,onFilterChange:o,model:u,tableUtils:l}=this.props,{formatter:d}=u,c=e.filter(f=>{var{selectedType:C,value:v}=f;return C!=null&&v!=null&&v!==""}),h=t.filter((f,C)=>f!=null&&e[C].selectedType!=null&&e[C].value!=null&&e[C].value!=="").slice(0,c.length-1),p={filterItems:c,filterOperators:h,invertSelection:i,selectedValues:n},m=l.makeAdvancedFilter(a,p,d.timeZone);o(a,m,p)}render(){var e=this,{column:t,model:i,sortDirection:n,formatter:a,tableUtils:o}=this.props,{filterItems:u,filterOperators:l,invertSelection:d,selectedValues:c,valuesTable:h,valuesTableError:p,isSortable:m}=this.state,{dh:f,isValuesTableAvailable:C}=i,v=T.isBooleanType(t.type),F=T.isDateType(t.type),w=this.getFilterTypes(t.type),g=t.type.substring(t.type.lastIndexOf(".")+1),N=[];if(!v&&w.length)for(var A=function(G){var z=u[G],{key:M,selectedType:oe,value:X}=z,le=s.jsx(Ro,{column:t,filterTypes:w,onChange:e.getFilterChangeHandler(G),onDelete:e.getFilterDeleteHandler(G),selectedType:oe,value:X,formatter:a,tableUtils:o},M);if(N.push(le),G<l.length){var _e=l[G],Le=_e===ht.and,Ge=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.and),children:"AND"}),s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:!Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.or),children:"OR"})]},"filterOperator".concat(M));N.push(Ge)}},E=0;E<u.length;E+=1)A(E);var O=this.shouldShowAddFilter(),D=s.jsxs("div",{className:Y("form-row justify-content-end add-filter-item",{hidden:!O}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(Z,{icon:Ri})}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!O,tooltip:"Add filter with AND",children:"AND"}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!O,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return N.push(D),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.descending}),onClick:this.handleSortDown,icon:mr,tooltip:m?"Sort ".concat(t.name," Descending"):"Not sortable",disabled:!m}),s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(Z,{icon:mr,rotation:180}),tooltip:m?"Sort ".concat(t.name," Ascending"):"Not sortable",disabled:!m})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[t.name," ",s.jsxs("span",{className:"column-type",children:["(",g,")"]})]}),N,C&&p==null&&s.jsxs(s.Fragment,{children:[!v&&s.jsx("hr",{}),s.jsx("div",{className:"form-group",children:s.jsx(Lo,{dh:f,table:h,onChange:this.handleSelectValueChange,invertSelection:d,selectedValues:c,formatter:a,showSearch:!F,timeZone:a.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(W,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(W,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}it(Ie,"debounceFilterUpdate",250);it(Ie,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});const ko=Ie;function Go(r,e){var t=Bo(r);if(t!==void 0){var i=Yo(r);return"".concat(i," ? ").concat(t," : ").concat(e)}}function Mo(r,e){return r.Column.formatRowColor(e)}function Vo(r,e){return r.formatColor(e)}var Tt=ce.module("ConditionalFormattingUtils"),Ce;(function(r){r.CONDITIONAL="conditional",r.ROWS="rows"})(Ce||(Ce={}));var P;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_BETWEEN="is-between",r.GREATER_THAN="greater-than",r.GREATER_THAN_OR_EQUAL="greater-than-or-equal",r.LESS_THAN="less-than",r.LESS_THAN_OR_EQUAL="less-than-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(P||(P={}));var B;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.CONTAINS="contains",r.DOES_NOT_CONTAIN="does-not-contain",r.STARTS_WITH="starts-with",r.ENDS_WITH="ends-with",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(B||(B={}));var k;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.IS_BEFORE="is-before",r.IS_BEFORE_OR_EQUAL="is-before-or-equal",r.IS_AFTER="is-after",r.IS_AFTER_OR_EQUAL="is-after-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(k||(k={}));var ne;(function(r){r.IS_TRUE="is-true",r.IS_FALSE="is-false",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ne||(ne={}));var ee;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ee||(ee={}));var $;(function(r){r.NO_FORMATTING="no-formatting",r.POSITIVE="positive",r.NEGATIVE="negative",r.WARN="warn",r.NEUTRAL="neutral",r.ACCENT_1="accent-1",r.ACCENT_2="accent-2",r.CUSTOM="custom"})($||($={}));function yr(r){switch(r){case $.NO_FORMATTING:return"No formatting";case $.POSITIVE:return"Positive";case $.NEGATIVE:return"Negative";case $.WARN:return"Warn";case $.NEUTRAL:return"Neutral";case $.ACCENT_1:return"Accent 1";case $.ACCENT_2:return"Accent 2";case $.CUSTOM:return"Custom..."}}function Ut(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#9fde6f";case $.NEGATIVE:return"#ff6087";case $.WARN:return"#f67f40";case $.NEUTRAL:return"#ffd95c";case $.ACCENT_1:return"#78dce8";case $.ACCENT_2:return"#ab9bf5";case $.CUSTOM:return t?.background;default:return}}function jt(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#526a3f";case $.NEGATIVE:return"#802f44";case $.WARN:return"#663318";case $.NEUTRAL:return"#63562b";case $.ACCENT_1:return"#3f6469";case $.ACCENT_2:return"#554d72";case $.CUSTOM:return t?.color;default:return}}function Bo(r){var e=jt(r.style),t=Ut(r.style);if(!(e===void 0||t===void 0))return"bgfg(`".concat(t,"`, `").concat(e,"`)")}function $o(r){var{column:e,value:t,start:i,end:n}=r;return as(e.name,r.condition,t,i,n)}function Qo(r){var{column:e,value:t}=r;return os(e.name,r.condition,t)}function Ho(r){var{column:e,value:t}=r;return ss(e.name,r.condition,t)}function Wo(r){var{column:e}=r;return ls(e.name,r.condition)}function Ko(r){var{column:e,value:t}=r;return us(e.name,r.condition,t)}function Yo(r){var{column:e}=r;if(T.isNumberType(e.type))return $o(r);if(T.isCharType(e.type))return Ko(r);if(T.isStringType(e.type))return Qo(r);if(T.isDateType(e.type))return Ho(r);if(T.isBooleanType(e.type))return Wo(r);throw new Error("Invalid column type")}function qo(r){switch(r){case P.IS_EQUAL:return"is equal to";case P.IS_NOT_EQUAL:return"is not equal to";case P.IS_BETWEEN:return"is between";case P.GREATER_THAN:return"greater than";case P.GREATER_THAN_OR_EQUAL:return"greater than or equal to";case P.LESS_THAN:return"less than";case P.LESS_THAN_OR_EQUAL:return"less than or equal to";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function zo(r){switch(r){case B.IS_EXACTLY:return"is exactly";case B.IS_NOT_EXACTLY:return"is not exactly";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function Xo(r){switch(r){case k.IS_EXACTLY:return"is";case k.IS_NOT_EXACTLY:return"is not";case k.IS_BEFORE:return"is before";case k.IS_BEFORE_OR_EQUAL:return"is before or equal";case k.IS_AFTER:return"is after";case k.IS_AFTER_OR_EQUAL:return"is after or equal";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function Zo(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function Jo(r){switch(r){case ee.IS_EQUAL:return"is";case ee.IS_NOT_EQUAL:return"is not";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function Xr(r){if(T.isNumberType(r))return P.IS_EQUAL;if(T.isCharType(r))return ee.IS_EQUAL;if(T.isStringType(r))return B.IS_EXACTLY;if(T.isDateType(r))return k.IS_EXACTLY;if(T.isBooleanType(r))return ne.IS_TRUE;throw new Error("Invalid column type")}function Zr(r){if(T.isCharType(r)||T.isStringType(r))return""}function Jr(r){var{condition:e,value:t,start:i,end:n}=r;return{condition:e,value:t,start:i,end:n}}function Mt(r){return{condition:Xr(r),value:Zr(r),start:void 0,end:void 0}}function en(){return{type:$.NO_FORMATTING}}function es(r){switch(r){case B.IS_EXACTLY:return"==";case B.IS_NOT_EXACTLY:return"!=";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function ts(r){switch(r){case k.IS_EXACTLY:return"==";case k.IS_NOT_EXACTLY:return"!=";case k.IS_BEFORE:return"<";case k.IS_BEFORE_OR_EQUAL:return"<=";case k.IS_AFTER:return">";case k.IS_AFTER_OR_EQUAL:return">=";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function is(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function rs(r){switch(r){case ee.IS_EQUAL:return"==";case ee.IS_NOT_EQUAL:return"!=";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function ns(r){switch(r){case P.IS_EQUAL:return"==";case P.IS_NOT_EQUAL:return"!=";case P.IS_BETWEEN:return"==";case P.GREATER_THAN:return">";case P.GREATER_THAN_OR_EQUAL:return">=";case P.LESS_THAN:return"<";case P.LESS_THAN_OR_EQUAL:return"<=";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function as(r,e,t,i,n){switch(e){case P.IS_EQUAL:return"".concat(r," == ").concat(t);case P.IS_NOT_EQUAL:return"".concat(r," != ").concat(t);case P.IS_BETWEEN:return"".concat(r," > ").concat(i," && ").concat(r," < ").concat(n);case P.GREATER_THAN:return"".concat(r," > ").concat(t);case P.GREATER_THAN_OR_EQUAL:return"".concat(r," >= ").concat(t);case P.LESS_THAN:return"".concat(r," < ").concat(t);case P.LESS_THAN_OR_EQUAL:return"".concat(r," <= ").concat(t);case P.IS_NULL:return"".concat(r," == null");case P.IS_NOT_NULL:return"".concat(r," != null")}}function os(r,e,t){switch(e){case B.IS_EXACTLY:return"".concat(r,' == "').concat(t,'"');case B.IS_NOT_EXACTLY:return"".concat(r,' != "').concat(t,'"');case B.CONTAINS:return"".concat(r," != null && ").concat(r,'.contains("').concat(t,'")');case B.DOES_NOT_CONTAIN:return"".concat(r," != null && !").concat(r,'.contains("').concat(t,'")');case B.STARTS_WITH:return"".concat(r," != null && ").concat(r,'.startsWith("').concat(t,'")');case B.ENDS_WITH:return"".concat(r," != null && ").concat(r,'.endsWith("').concat(t,'")');case B.IS_NULL:return"".concat(r," == null");case B.IS_NOT_NULL:return"".concat(r," != null")}}function ss(r,e,t){switch(e){case k.IS_EXACTLY:return"".concat(r,' == convertDateTime("').concat(t,'")');case k.IS_NOT_EXACTLY:return"".concat(r," != convertDateTime(`").concat(t,"`)");case k.IS_BEFORE:return"".concat(r," < convertDateTime(`").concat(t,"`)");case k.IS_BEFORE_OR_EQUAL:return"".concat(r,' <= convertDateTime("').concat(t,'")');case k.IS_AFTER:return"".concat(r," > convertDateTime(`").concat(t,"`)");case k.IS_AFTER_OR_EQUAL:return"".concat(r," >= convertDateTime(`").concat(t,"`)");case k.IS_NULL:return"".concat(r," == null");case k.IS_NOT_NULL:return"".concat(r," != null")}}function ls(r,e){switch(e){case ne.IS_TRUE:return"".concat(r," == true");case ne.IS_FALSE:return"".concat(r," == false");case ne.IS_NULL:return"".concat(r," == null");case ne.IS_NOT_NULL:return"".concat(r," != null")}}function us(r,e,t){switch(e){case ee.IS_EQUAL:return"".concat(r," == '").concat(t,"'");case ee.IS_NOT_EQUAL:return"".concat(r," != '").concat(t,"'");case ee.IS_NULL:return"isNull(".concat(r,")");case ee.IS_NOT_NULL:return"!isNull(".concat(r,")")}}function ds(r,e){if(T.isNumberType(r))return ns(e);if(T.isCharType(r))return rs(e);if(T.isStringType(r))return es(e);if(T.isDateType(r))return ts(e);if(T.isBooleanType(r))return is(e);throw new Error("Invalid column type")}function cs(r,e,t){if(t===void 0)return Tt.debug("no rules passed."),[];var i=[],n,a=new Map;return t.forEach(o=>{var u,{config:l,type:d}=o,{column:c}=l,h=e.find(F=>{var{name:w,type:g}=F;return w===c.name&&g===c.type});if(h===void 0){Tt.debug("Column ".concat(c.name,":").concat(c.type," not found. Ignoring format rule."),l);return}var[p,m]=(u=d===Ce.CONDITIONAL?a.get(h.name):n)!==null&&u!==void 0?u:["null",void 0],f=Go(l,p);if(f===void 0){Tt.debug("Ignoring format rule.",l);return}var C=m===void 0?-1:i.indexOf(m);C>-1&&i.splice(C,1);var v=d===Ce.CONDITIONAL?Vo(h,f):Mo(r,f);i.push(v),d===Ce.CONDITIONAL?a.set(h.name,[f,v]):n=[f,v]}),i}function hs(r,e,t){switch(e){case k.IS_NULL:case k.IS_NOT_NULL:return!0;default:{var[i,...n]=(t??"").split(" "),a=n.join(" ");try{Di.parseDateTimeString(i)}catch{return Tt.debug("Invalid datetime string",i),!1}try{r.i18n.TimeZone.getTimeZone(a)}catch{return Tt.debug("Invalid timezone string",a),!1}return!0}}}function ms(r){var{type:e}=r;return T.isNumberType(e)||T.isCharType(e)||T.isStringType(e)||T.isDateType(e)||T.isBooleanType(e)}function Vt(r){var{animation:e="iris-grid-bottom-bar-slide-up",children:t,className:i,isShown:n,onClick:a,onEntering:o,onEntered:u,onExiting:l,onExited:d}=r;return s.jsx(Ei,{in:n,timeout:yi.transitionMs,classNames:e,onEntering:o,onEntered:u,onExiting:l,onExited:d,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:Y("iris-grid-bottom-bar",i),role:"presentation",onClick:a,onKeyPress:a,children:t})})}var ps=3e3,vs=5;function gs(r){var{isSaving:e=!1,onSave:t,onDiscard:i,discardTooltip:n,saveTooltip:a,error:o,pendingDataErrors:u,pendingDataMap:l,onEntering:d,onEntered:c,onExiting:h,onExited:p}=r,[m,f]=y.useState(!1),[C,v]=y.useState(!1),F=y.useRef(),w=Hr(e),g=y.useMemo(()=>u.size===0?o:u.size<=vs?"Key can't be empty (on pending row".concat(u.size>1?"s":""," ").concat(Array.from(u.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(u.size," rows)"),[o,u]);y.useEffect(function(){w!=null&&w&&!e&&g==null&&(f(!0),v(!0),F.current=setTimeout(()=>{f(!1)},ps))},[g,e,w]),y.useEffect(function(){F.current&&l.size>0&&(clearTimeout(F.current),f(!1),v(!1))},[l]),y.useEffect(function(){return()=>F.current?clearTimeout(F.current):void 0},[]);var N=l.size,A;return e?A=s.jsx(kt,{className:"loading-spinner-vertical-align"}):C&&(A=la),s.jsxs(Vt,{className:"pending-data-bottom-bar",isShown:N>0||m||g!=null,onEntering:d,onEntered:c,onExiting:h,onExited:()=>{v(!1),p&&p()},children:[g!=null&&g!==""&&s.jsxs("div",{className:"error-message",children:[s.jsx(Z,{icon:sa}),s.jsx("span",{children:"".concat(g)})]}),(g==null||g==="")&&s.jsx("div",{className:"status-message",children:N>0&&s.jsx("span",{children:"".concat(N," row").concat(N>1?"s":""," pending")})}),s.jsxs("div",{className:"buttons-container",children:[!e&&!C&&s.jsx(W,{kind:"secondary",onClick:i,tooltip:n,children:"Discard"}),s.jsxs(W,{kind:C?"success":"primary",onClick:t,icon:A,disabled:e||C||g!=null,tooltip:a,children:[e&&"Committing...",!e&&C&&"Success",!e&&!C&&"Commit"]})]})]})}function wr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){wr(a,i,n,o,u,"next",l)}function u(l){wr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Qe(r,e,t){return e=fs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fs(r){var e=Cs(r,"string");return typeof e=="symbol"?e:String(e)}function Cs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var me=ce.module("IrisGridCopyHandler");function Ss(r){return r.ranges!=null}function Ts(r){return r.columnIndex!=null}class V extends y.Component{static getStatusMessageText(e,t){switch(e){case V.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case V.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case V.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case V.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case V.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case V.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case V.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case V.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case V.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),Qe(this,"textData",void 0),Qe(this,"hideTimer",void 0),Qe(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:V.COPY_STATES.IDLE,buttonState:V.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var{copyOperation:e}=this.props;e!=null&&this.startCopy()}componentDidUpdate(e){var{copyOperation:t}=this.props;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){me.debug2("startCopy"),this.stopCopy();var{copyOperation:e}=this.props;if(e==null){me.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var{error:t}=e;if(t!=null){me.debug("Showing copy error",t),this.setState({isShown:!0,copyState:V.COPY_STATES.DONE,error:t}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),Ss(e)){var{ranges:i}=e,n=Fe.rowCount(i);if(this.setState({rowCount:n}),n>V.NO_PROMPT_THRESHOLD){this.setState({buttonState:V.BUTTON_STATES.COPY,copyState:V.COPY_STATES.CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){me.debug2("handleBackgroundClick");var{copyState:e}=this.state;e===V.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){me.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return pi(function*(){if(me.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){me.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){me.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return pi(function*(){me.debug2("copyText",e),t.textData=e,yield Ii(e)})()}showCopyDone(){this.setState({copyState:V.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return pi(function*(){e.stopFetch();var{model:t,copyOperation:i}=e.props;if(Ts(i)){var{columnIndex:n,columnDepth:a,movedColumns:o}=i;me.debug("startFetch copyHeader",n,a),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var u=ge.getModelIndex(n,o),l=t.textForColumnHeader(u,a);if(l===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:V.COPY_STATES.DONE});return}e.fetchPromise=Oe.makeCancelable(l)}else{var{ranges:d,includeHeaders:c,userColumnWidths:h,movedColumns:p,formatValues:m}=i;me.debug("startFetch copyRanges",d),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=ie.getHiddenColumns(h),C=ge.getModelRanges(d,p);if(f.length>0){var v=f.map(Fe.makeColumn);C=Fe.subtractRangesFromRanges(C,v)}var F=m!=null&&m?(g,N)=>t.displayString(g,N.type,N.name):g=>"".concat(g);e.fetchPromise=Oe.makeCancelable(t.textSnapshot(C,c,F))}try{var w=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(w),e.showCopyDone()}catch(g){me.error("Error copying text",g),e.setState({buttonState:V.BUTTON_STATES.CLICK_TO_COPY,copyState:V.COPY_STATES.CLICK_REQUIRED})}}catch(g){g instanceof Qa?me.debug("User cancelled copy."):(me.error("Error fetching contents",g),e.fetchPromise=void 0,e.setState({buttonState:V.BUTTON_STATES.RETRY,copyState:V.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(me.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,V.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var{onEntering:e,onEntered:t,onExiting:i,onExited:n}=this.props,{buttonState:a,copyState:o,isShown:u,rowCount:l,error:d}=this.state,c=o===V.COPY_STATES.DONE?"fade":"copy-slide-up",h=V.getCopyButtonText(a),p=d??V.getStatusMessageText(o,l),m=o!==V.COPY_STATES.DONE,f=a===V.BUTTON_STATES.FETCH_IN_PROGRESS,C=o===V.COPY_STATES.DONE;return s.jsxs(Vt,{animation:c,isShown:u,className:Y("iris-grid-copy-handler",{"copy-done":C}),onClick:this.handleBackgroundClick,onEntering:e,onEntered:t,onExiting:i,onExited:n,children:[s.jsx("div",{className:"status-message",children:s.jsx("span",{children:p})}),s.jsx(xi,{in:m,mountOnEnter:!0,unmountOnExit:!0,children:s.jsxs("div",{className:"buttons-container",children:[s.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),s.jsxs(W,{kind:f?"tertiary":"primary",className:Y("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&s.jsx(kt,{className:"loading-spinner-vertical-align"}),h]})]})})]})}}Qe(V,"NO_PROMPT_THRESHOLD",1e4);Qe(V,"HIDE_TIMEOUT",3e3);Qe(V,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});Qe(V,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});Qe(V,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});const bs=V;function It(r,e,t){return e=Es(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Es(r){var e=ys(r,"string");return typeof e=="symbol"?e:String(e)}function ys(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class tn extends y.PureComponent{constructor(e){super(e),It(this,"inputField",void 0),It(this,"initialValue",void 0),It(this,"debouncedSendUpdate",void 0);var{debounceMs:t}=e;this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var{value:i}=e;this.initialValue=i,this.state={isChanged:!1,value:i}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var{debounceMs:t}=this.props;e.debounceMs!==t&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var{value:t}=e.target;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var{initialValue:e}=this,{isChanged:t}=this.state;t&&this.sendUpdate(e);var{onDone:i}=this.props;i()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var{onDone:i}=this.props;i(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var{relatedTarget:t}=e;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var{onTab:t}=this.props;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var{onContextMenu:t}=this.props;t(e)}sendUpdate(e){var{onChange:t}=this.props;t(e)}render(){var{className:e,style:t,isAdvancedFilterSet:i,onAdvancedFiltersTriggered:n}=this.props,{value:a}=this.state;return s.jsxs("div",{style:t,className:"iris-grid-input-autosized-wrapper","data-value":a,children:[s.jsx("input",{ref:o=>{this.inputField=o},className:Y("iris-grid-input-field",e),type:"text",value:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),s.jsx("div",{className:"advanced-filter-button-container",children:s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":i}),onClick:n,onContextMenu:this.handleContextMenu,children:s.jsxs("div",{className:"fa-layers ",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})})]})}}It(tn,"defaultProps",{style:{},className:"",value:"",isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});const ws=tn;function Fs(r,e,t){return e=Ns(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ns(r){var e=Os(r,"string");return typeof e=="symbol"?e:String(e)}function Os(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class As extends Gt{constructor(e){super(),Fs(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onDown(e,t){if(e.altKey&&!Ae.isModifierKeyDown(e)&&!e.shiftKey){var{mouseX:i,mouseY:n}=t.state;if(i==null||n==null)return!1;var a=t.getGridPointFromXY(i,n);if(a.column!=null&&a.row!=null)return this.cursor=this.irisGrid.props.copyCursor,!0}return!1}onUp(e,t){return this.cursor===this.irisGrid.props.copyCursor?(this.cursor=null,!0):!1}}const Rs=As;function _s(r,e,t){return e=xs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xs(r){var e=Ds(r,"string");return typeof e=="symbol"?e:String(e)}function Ds(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Is extends Gt{constructor(e){super(),_s(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{selectedRanges:t}=this.irisGrid.state;return e.key==="c"&&Ae.isModifierKeyDown(e)?(ie.isValidSnapshotRanges(t)?this.irisGrid.copyRanges(t):this.irisGrid.copyRanges(t,!1,!1,"Invalid copy ranges"),!0):!1}}const Ps=Is;function Ls(r,e,t){return e=Us(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Us(r){var e=js(r,"string");return typeof e=="symbol"?e:String(e)}function js(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ks extends Gt{constructor(e){super(),Ls(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Ne.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var{reverseType:t}=this.irisGrid.state;return t===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE),!0}return!1}}const Gs=ks;function Ms(r,e,t){return e=Vs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vs(r){var e=Bs(r,"string");return typeof e=="symbol"?e:String(e)}function Bs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $s extends Gt{constructor(e){super(),Ms(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Ne.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}const Qs=$s;function Hs(r,e,t){return e=Ws(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ws(r){var e=Ks(r,"string");return typeof e=="symbol"?e:String(e)}function Ks(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ys extends Re{constructor(e){super(850),Hs(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:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:h}=d,{canvasContext:p}=u,m=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:h,theme:m},{left:C,top:v,width:F,height:w}=o.getCellOverflowButtonPosition(f);return C==null||F==null||v==null||w==null?null:{left:C,top:v,width:F,height:w}}isHoveringOverflowButton(e){var t,{x:i,y:n}=e,{left:a,top:o,width:u,height:l}=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{};if(a==null||u==null||o==null||l==null)return!1;var{renderer:d,grid:c,state:h,props:p}=this.irisGrid;if(!c)return!1;var{metrics:m}=h,{model:f}=p,{canvasContext:C}=c,v=c.getTheme(),F={context:C,mouseX:i,mouseY:n,metrics:m,model:f,theme:v};return d.shouldRenderOverflowButton(F)&&i>=a&&i<=a+u&&n>=o&&n<=o+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:t}=this.irisGrid.state,i=this.getButtonPosition(e);De(t,i)||this.irisGrid.setState({overflowButtonTooltipProps:i})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:t,row:i}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,i)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const qs=Ys;function zs(r,e,t){return e=Xs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xs(r){var e=Zs(r,"string");return typeof e=="symbol"?e:String(e)}function Zs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Js extends Re{constructor(e){super(),zs(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:t}=this.irisGrid.props;return t!=null?t(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e?.(null)}getTableColumn(e){if(e==null)return null;var{model:t}=this.irisGrid.props,i=this.irisGrid.getModelColumn(e);return i==null?null:t.columns[i]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,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:t}=e,i=this.getTableColumn(t);return i!=null&&this.isValidColumn(i)&&this.irisGrid.selectColumn(i),!0}}const el=Js;function tl(r,e,t){return e=il(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function il(r){var e=rl(r,"string");return typeof e=="symbol"?e:String(e)}function rl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class nl extends Re{constructor(e){super(),tl(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,t,i){var{relatedTarget:n}=i instanceof MouseEvent?i:i.nativeEvent,{tooltip:a}=this.irisGrid;if(!a)return!1;var o=a.popper.current;return o&&n instanceof Element&&o.element.contains(n)||this.hideColumnTooltip(),!1}onMove(e){var{column:t,row:i,columnHeaderDepth:n}=e,{shownColumnTooltip:a}=this.irisGrid.state,o=null;return t!==null&&i===null&&n===0&&(o=t),o!==a&&this.irisGrid.setState({shownColumnTooltip:o}),!1}}const al=nl;function rn(r,e,t){return e=ol(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ol(r){var e=sl(r,"string");return typeof e=="symbol"?e:String(e)}function sl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bt extends y.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt.defaultProps;super(e),rn(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=ke.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:t}=e;t(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=ua.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:t,placeholder:i,title:n}=this.props,{menuItem:{description:a},iconElement:o}=t;return s.jsxs("div",{className:"form-group flex-grow mb-0",children:[s.jsxs("div",{className:"custom-format-title",children:[s.jsx("span",{className:"icon",children:o}),s.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[n,a!=null&&s.jsx(Xe,{children:a})]})]}),s.jsx("div",{className:"pl-2 pr-2 pb-2",children:s.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:i,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}rn(Bt,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(r){},iconElement:null},placeholder:"",title:"",onChange(r){}});const ll=Bt;class ul{static isDefaultSelected(e){return!e||![Dt.TYPE_CONTEXT_CUSTOM,Dt.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===Dt.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,i,n){return{title:e,description:e,group:i,format:t,isSelected:n}}static makeCustomFormatOption(e,t,i,n,a){var o;return{title:e.label,description:e.label,format:e,group:t,isSelected:n,menuElement:s.jsx(ll,{formatString:(o=e.formatString)!==null&&o!==void 0?o:void 0,title:e.label,placeholder:i,onChange:a})}}}const be=ul;function Li(r,e,t){return e=dl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dl(r){var e=cl(r,"string");return typeof e=="symbol"?e:String(e)}function cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fe{static getOptions(e,t){var i=new Date,n=[{group:fe.dateGroup,formatString:"yyyy-MM-dd"},{group:fe.dateGroup,formatString:"MM-dd-yyyy"},{group:fe.timeGroup,formatString:"HH:mm:ss"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSS"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],a=n.map(u=>{var l=Ct.makeFormat("",u.formatString,Ct.TYPE_CONTEXT_PRESET),d=e.getFormattedString(i,T.dataType.DATETIME,"",l);return be.makeOption(d,l,u.group,Ct.isSameFormat(l,t))}),o=be.makeOption("Default",null,fe.dateGroup,be.isDefaultSelected(t));return[o,...a]}}Li(fe,"dateGroup",10);Li(fe,"timeGroup",20);Li(fe,"dateTimeGroup",30);const hl=fe;function $t(r,e,t){return e=ml(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ml(r){var e=pl(r,"string");return typeof e=="symbol"?e:String(e)}function pl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pe{static getOptions(e,t,i){var n=[{format:we.FORMAT_PERCENT,group:pe.presetGroup},{format:we.FORMAT_BASIS_POINTS,group:pe.presetGroup},{format:we.FORMAT_MILLIONS,group:pe.presetGroup},{format:we.FORMAT_SCIENTIFIC_NOTATION,group:pe.presetGroup},{format:we.FORMAT_ROUND,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_TWO_DECIMALS,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_FOUR_DECIMALS,group:pe.presetRoundGroup}],a=be.makeOption("Default",null,pe.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,we.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:we.makeCustomFormat(),d=be.makeCustomFormatOption(l,pe.customGroup,we.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var h=we.makeCustomFormat(c);we.isValid(e,h)&&i(h)}else i(null)});return[a,...o,d]}}$t(pe,"defaultGroup",10);$t(pe,"presetGroup",20);$t(pe,"presetRoundGroup",30);$t(pe,"customGroup",40);const vl=pe;function Ui(r,e,t){return e=gl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gl(r){var e=fl(r,"string");return typeof e=="symbol"?e:String(e)}function fl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class je{static getOptions(e,t,i){var n=[{format:Ke.FORMAT_MILLIONS,group:je.presetGroup},{format:Ke.FORMAT_SCIENTIFIC_NOTATION,group:je.presetGroup}],a=be.makeOption("Default",null,je.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,Ke.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:Ke.makeCustomFormat(),d=be.makeCustomFormatOption(l,je.customGroup,Ke.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var h=Ke.makeCustomFormat(c);Ke.isValid(e,h)&&i(h)}else i(null)});return[a,...o,d]}}Ui(je,"defaultGroup",10);Ui(je,"presetGroup",20);Ui(je,"customGroup",30);const Cl=je;function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){Se(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Or(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function Sl(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Or(a,i,n,o,u,"next",l)}function u(l){Or(a,i,n,o,u,"throw",l)}o(void 0)})}}function Se(r,e,t){return e=Tl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tl(r){var e=bl(r,"string");return typeof e=="symbol"?e:String(e)}function bl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ar=ce.module("IrisGridContextMenuHandler"),El=150,Rr="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",vi=1e3;class b extends Re{static getQuickFilterCondition(e,t,i){return e&&i==="&&"?e.and(t):e&&i==="||"?e.or(t):t}static getQuickFilterText(e,t,i){return i&&e!=null?"".concat(e," ").concat(i," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(To.truncate(t,i-e.length-3),'"')}constructor(e,t){super(),Se(this,"irisGrid",void 0),Se(this,"debouncedUpdateCustomFormat",void 0),Se(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=rt(e.handleFormatSelection,El),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var{irisGrid:i}=this,{column:n}=t;L(n);var{model:a}=i.props,{columns:o}=a,u=o[e],l=[],{metrics:d,reverseType:c,quickFilters:h,advancedFilters:p,searchFilter:m}=i.state,f=i.getTheme();L(d);var{filterIconColor:C,filterBarActiveColor:v,contextMenuSortIconColor:F,contextMenuReverseIconColor:w}=f,g=a.sort,N=T.getSortForColumn(g,u.name),A=c!==T.REVERSE_TYPE.NONE,{userColumnWidths:E}=d,O=[...E.values()].some(M=>M===0),D=a.getColumnHeaderParentGroup(e,0)===void 0&&!($e(a)&&a.hasExpandableRows),x=a.isColumnFrozen(e),G=a.isColumnSortable(e);if(l.push({title:"Hide Column",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(n)}}),l.push({title:x?"Unfreeze Column":"Freeze Column",group:b.GROUP_HIDE_COLUMNS,disabled:!D,action:()=>{x?this.irisGrid.unFreezeColumnByColumnName(u.name):this.irisGrid.freezeColumnByColumnName(u.name)},order:10}),l.push({title:"Show All Columns",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!O}),l.push({title:"Quick Filters",icon:Ue,iconColor:v,shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER,group:b.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(n)}}),l.push({title:"Advanced Filters",icon:p.get(e)?_i:Pt,iconColor:C,group:b.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(n)}}),l.push({title:"Clear Table Filters",group:b.GROUP_FILTER,order:40,shortcut:Ne.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(h.size>0||p.size>0||m!=null)}),l.push({title:"Sort by",icon:Ue,iconColor:F,group:b.GROUP_SORT,order:10,actions:this.sortByActions(u,e,N),disabled:!G}),l.push({title:"Add Additional Sort",disabled:N&&g.length===1||A&&g.length===1||N&&A&&g.length===2||g.length===0||!G,group:b.GROUP_SORT,order:20,actions:this.additionalSortActions(u,e)}),l.push({title:"Clear Table Sorting",disabled:g.length===0||A&&g.length===1,group:b.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(n,b.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:c===T.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:Ue,iconColor:w,group:b.GROUP_SORT,order:40,disabled:!a.isReversible,shortcut:Ne.TABLE.REVERSE,action:()=>{c===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var M;Ii((M=a.textForColumnHeader(e))!==null&&M!==void 0?M:"").catch(oe=>Ar.error("Unable to copy header",oe))}}),T.isDateType(u.type))l.push({title:"Date/Time Format",group:b.GROUP_FORMAT,actions:this.dateFormatActions(u)});else if(T.isNumberType(u.type)){var z;l.push({title:"Number Format",group:b.GROUP_FORMAT,actions:(z=this.numberFormatActions(u))!==null&&z!==void 0?z:void 0})}return l}getCellActions(e,t,i){var{irisGrid:n}=this,{column:a,row:o}=i,{model:u,canCopy:l}=n.props,{columns:d}=u,c=n.getModelRow(o);L(c);var h=u.sourceForCell(e,c),{column:p,row:m}=h,f=u.valueForCell(p,m),C=d[p],v=[],F=n.getTheme(),{filterIconColor:w}=F;if(C==null||o==null)return v;if($e(u)&&u.isRowExpandable(m)){var g=0,N=u.valueForCell(g,m),A=N==null?"null":u.textForCell(g,m);v.push({title:b.getRowOptionFormatted(u.isRowExpanded(m)?"Collapse":"Expand",A),group:b.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{u.setRowExpanded(m,!u.isRowExpanded(m))}}),u.isExpandAllAvailable===!0&&v.push({title:b.getRowOptionFormatted("Expand All in",A),group:b.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{u.setRowExpanded(m,!0,!0)}})}$e(u)&&u.hasExpandableRows&&u.isExpandAllAvailable===!0&&(v.push({title:"Expand Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{u.expandAll()}}),v.push({title:"Collapse Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{u.collapseAll()}}));var E={title:"Go to",iconColor:w,shortcut:Ne.TABLE.GOTO_ROW,group:b.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(o+1),"".concat(f),C.name)};return v.push(E),l&&(v.push({title:"Copy Cell",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{n.copyCell(a,o)}}),v.push({title:"Copy Cell Unformatted",group:b.GROUP_COPY,order:20,action:()=>{n.copyCell(a,o,!0)}})),v.push({title:"View Cell Contents",group:b.GROUP_VIEW_CONTENTS,order:10,action:()=>{n.setState({showOverflowModal:!0,overflowText:n.getValueForCell(a,o)})}}),v}getCellFilterActions(e,t,i){var n=this;return Sl(function*(){var{dh:a,irisGrid:o}=n,{row:u}=i,{model:l}=o.props,{columns:d}=l,c=o.getModelRow(u),{getSelectedRanges:h}=t;L(c);var p=l.sourceForCell(e,c),{column:m,row:f}=p,C=d[m];if(C==null||u==null)return[];if(!l.isFilterable(m))return[];var{quickFilters:v}=o.state,F=o.getTheme(),{filterIconColor:w}=F,{settings:g}=o.props,N=[...h()];if(N.length===0&&N.push(new Fe(m,f,m,f)),Fe.containsCell(N,m,f))for(var A=Fe.rowCount(N);A>vi;){var E=N.pop();L(E,"Selected ranges should not be empty");var O=Fe.rowCount([E]);if(da(O,"Selected ranges should not be unbounded"),A-O<vi){var D;N.push(new Fe(E.startColumn,E.startRow,E.endColumn,((D=E.endRow)!==null&&D!==void 0?D:0)-(A-vi)));break}A-=O}else N=[new Fe(m,f,m,f)];ca(N);for(var x=yield l.snapshot(N),G=new Set,z=0;z<x.length;z+=1)x[z].length===1?x[z][0]!=null&&G.add(x[z][0]):x[z][m]!=null&&G.add(x[z][m]);var M={title:"Filter by Value".concat(G.size>1?"s":""),icon:Ue,iconColor:w,group:b.GROUP_FILTER,order:10,actions:[]};if(G.size===0)v.get(m)&&M.actions.push({title:"And",actions:n.nullFilterActions(C,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.nullFilterActions(C));else if(G.size===1&&G.has(""))v.get(m)&&M.actions.push({title:"And",actions:n.emptyStringFilterActions(C,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.emptyStringFilterActions(C));else if(T.isBooleanType(C.type))v.get(m)&&M.actions.push({title:"Or",actions:n.booleanFilterActions(C,l.textForCell(m,f),v.get(m),"||"),order:2,group:U.groups.high}),M.actions.push(...n.booleanFilterActions(C,l.textForCell(m,f)));else if(T.isNumberType(C.type)||T.isCharType(C.type))L(m),v.get(m)&&M.actions.push({title:"And",actions:n.numberFilterActions(C,G,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.numberFilterActions(C,G,v.get(m)));else if(T.isDateType(C.type)){var oe=new Ct(a,{timeZone:g?.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Rr}),X=new Ct(a,{timeZone:g?.timeZone,showTimeZone:g?.showTimeZone,showTSeparator:g?.showTSeparator,defaultDateTimeFormatString:Rr});v.get(m)&&M.actions.push({title:"And",actions:n.dateFilterActions(C,G,oe,X,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.dateFilterActions(C,G,oe,X,v.get(m)))}else v.get(m)&&M.actions.push({title:"And",actions:n.stringFilterActions(C,G,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.stringFilterActions(C,G));return[M]})()}getNumberValueEqualsFilter(e,t){var{dh:i}=this,n=e.filter();if(t===Number.POSITIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.greaterThan(i.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0)));if(Number.isNaN(t))return i.FilterCondition.invoke("isNaN",n);var a=this.getFilterValueForNumberOrChar(e.type,t);return n.eq(a)}getFilterValueForNumberOrChar(e,t){var{dh:i}=this;return T.isCharType(e)?i.FilterValue.ofString(String.fromCharCode(t)):i.FilterValue.ofNumber(t)}onContextMenu(e,t,i){var{irisGrid:n}=this,{y:a,column:o,row:u,columnHeaderDepth:l}=e,d=n.getModelColumn(o),c=n.getModelRow(u),{model:h,canCopy:p}=n.props,{columns:m}=h,{metrics:f,isFilterBarShown:C,quickFilters:v,advancedFilters:F,selectedRanges:w}=n.state;L(f);var{columnHeaderHeight:g,gridY:N,columnHeaderMaxDepth:A}=f,E=[];if(d!=null&&c!=null){var O=h.sourceForCell(d,c??0),{column:D,row:x}=O,G=h.valueForCell(D,x),z=h.textForCell(D,x),M=m[D],{onContextMenu:oe}=n.props;M!=null&&E.push(...oe({model:h,value:G,valueText:z,column:M,rowIndex:u,columnIndex:o,modelRow:c,modelColumn:d}))}if(d!=null){var X=h.getClearFilterRange(d);X!=null&&X.length>0&&E.push({title:X[1]-X[0]>0?"Clear Group Filter":"Clear Column Filter",group:b.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(X)},disabled:!Array.from(v.keys()).some(le=>le>=X[0]&&le<=X[1])&&!Array.from(F.keys()).some(le=>le>=X[0]&&le<=X[1])})}return(C?a<=N:a<=g*A&&l===0)?d!=null&&E.push(...this.getHeaderActions(d,e)):(d!=null&&c!=null&&(E.push(...this.getCellActions(d,t,e)),E.push(this.getCellFilterActions(d,t,e))),p&&w.length>0&&(E.push({title:"Copy Selection",shortcut:Ha.COPY,group:b.GROUP_COPY,order:30,action:()=>{n.copyRanges(w)}}),E.push({title:"Copy Selection w/ Headers",group:b.GROUP_COPY,order:40,action:()=>{n.copyRanges(w,!0)}})),Be(h)&&h.isEditable&&w.length>0&&E.push({title:"Delete Selected Rows",group:b.GROUP_EDIT,order:50,action:()=>{this.irisGrid.deleteRanges(w)}})),E.length===0?!1:(L(n.gridWrapper),U.triggerMenu(n.gridWrapper,i.clientX,i.clientY,E),!0)}dateFormatActions(e){for(var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,a=n.getColumnFormat(e.type,e.name),o=hl.getOptions(n,a),u=[],l=function(){var{description:h,format:p,group:m,isSelected:f,title:C}=o[d];u.push({title:C,description:h,icon:f?wi:void 0,group:m,order:d,action:()=>{var v=i.getColumnIndexByName(e.name);L(v),t.irisGrid.handleFormatSelection(v,p)}})},d=0;d<o.length;d+=1)l();return u}numberFormatActions(e){var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,{dh:a}=this,o=n.getColumnFormat(e.type,e.name),u,l=i.getColumnIndexByName(e.name);if(T.isDecimalType(e.type))u=vl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else if(T.isIntegerType(e.type))u=Cl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else return Ar.error("Invalid column type in numberFormatActions"),null;for(var d=[],c=function(){var{format:m,isSelected:f}=u[h];d.push(Nr(Nr({},u[h]),{},{icon:f?wi:void 0,order:h,action:()=>{l===void 0&&m&&m.type===Dt.TYPE_CONTEXT_CUSTOM||(L(l),t.irisGrid.handleFormatSelection(l,m))}}))},h=0;h<u.length;h+=1)c();return d}stringFilterActions(e,t,i,n){var{dh:a}=this,o=Array.from(t.keys()),u=o.map(v=>a.FilterValue.ofString(v)),l=u.length===1?u[0]:"the selected values",d=i;d||(d={filter:null,text:null});var{filter:c,text:h}=d,p=[],{model:m}=this.irisGrid.props,f=m.getColumnIndexByName(e.name),C=v=>{var F;return(F=T.escapeQuickTextFilter(v))!==null&&F!==void 0?F:""};return L(f),p.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(o.slice(0,20).map(v=>'"'.concat(C(v),'"'))),o.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:U.groups.high}),p.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(v=>e.filter().eq(v)).reduce((v,F)=>v.or(F)),n),b.getQuickFilterText(h,o.map(C).join(" || "),n))},order:10,group:U.groups.low}),p.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(v=>e.filter().notEq(v)).reduce((v,F)=>v.and(F)),n),b.getQuickFilterText(h,o.map(v=>"!=".concat(C(v))).join(" && "),n))},order:20,group:U.groups.low}),p.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().contains(v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"~".concat(C(v))).join(" || "),n))},order:30,group:U.groups.low}),p.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().or(u.map(v=>e.filter().contains(v).not()).reduce((v,F)=>v.and(F))),n),b.getQuickFilterText(h,o.map(v=>"!~".concat(C(v))).join(" && "),n))},order:40,group:U.groups.low}),p.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().invoke("startsWith",v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"".concat(C(v),"*")).join(" || "),n))},order:50,group:U.groups.low}),p.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().invoke("endsWith",v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"*".concat(C(v))).join(" || "),n))},order:60,group:U.groups.low}),p}numberFilterActions(e,t,i,n){var a=Array.from(t.keys()),o=a.length===1?"".concat(a):"the selected values",u=g=>T.isCharType(e.type)?String.fromCharCode(g):"".concat(g),l=null,d=null;i&&(l=i.filter,d=i.text);var c=[],{model:h}=this.irisGrid.props,p=h.getColumnIndexByName(e.name);if(L(p),c.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(a.slice(0,20).map(g=>'"'.concat(u(g),'"'))),a.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:U.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(g=>this.getNumberValueEqualsFilter(e,g)).reduce((g,N)=>g.or(N)),n),b.getQuickFilterText(d,a.map(g=>"=".concat(u(g))).join(" || "),n))},order:10,group:U.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(g=>this.getNumberValueEqualsFilter(e,g).not()).reduce((g,N)=>g.and(N)),n),b.getQuickFilterText(d,a.map(g=>"!=".concat(u(g))).join(" && "),n))},order:20,group:U.groups.low}),!t.has(Number.NaN)&&!t.has(Number.POSITIVE_INFINITY)&&!t.has(Number.NEGATIVE_INFINITY)&&!T.isCharType(e.type)){var m=a.reduce((g,N)=>g>N?g:N),f=a.reduce((g,N)=>g<N?g:N),C=this.getFilterValueForNumberOrChar(e.type,m),v=this.getFilterValueForNumberOrChar(e.type,f),F="".concat(C),w="".concat(v);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThan(C),n),b.getQuickFilterText(d,">".concat(u(m)),n))},order:30,group:U.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(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThanOrEqualTo(C),n),b.getQuickFilterText(d,">=".concat(u(m)),n))},order:40,group:U.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThan(v),n),b.getQuickFilterText(d,"<".concat(u(f)),n))},order:50,group:U.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(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThanOrEqualTo(v),n),b.getQuickFilterText(d,"<=".concat(u(f)),n))},order:60,group:U.groups.low})}return c}booleanFilterActions(e,t,i,n){var a=[],{model:o}=this.irisGrid.props,{filter:u,text:l}=i||{},d=o.getColumnIndexByName(e.name);return L(d),a.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",'"',t??"null",'"']}),order:1,group:U.groups.high}),a.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isTrue(),n),b.getQuickFilterText(l,"true",n))},order:10,group:U.groups.low}),a.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isFalse(),n),b.getQuickFilterText(l,"false",n))},order:20,group:U.groups.low}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull(),n),b.getQuickFilterText(l,"null",n))},order:30,group:U.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull().not(),n),b.getQuickFilterText(l,"!null",n))},order:40,group:U.groups.low}),a}dateFilterActions(e,t,i,n,a,o){var{dh:u}=this,l=Array.from(t.keys()),d=l.map(D=>u.FilterValue.ofNumber(D)),c=d.length===1?n.format(l[0]):"the selected values",h=l.reduce((D,x)=>D>x?D:x),p=l.reduce((D,x)=>D<x?D:x),m=u.FilterValue.ofNumber(h),f=u.FilterValue.ofNumber(p),C=i.format(h),v=i.format(p),F=n.format(h),w=n.format(p),g=null,N=null;a&&(g=a.filter,N=a.text);var{model:A}=this.irisGrid.props,E=A.getColumnIndexByName(e.name);L(E);var O=[];return O.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[o?b.getOperatorAsText(o):""," ",hi.join(l.slice(0,20).map(D=>'"'.concat(n.format(D),'"'))),l.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",l.length," values selected)"]})]}),order:1,group:U.groups.high}),O.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,d.map(D=>e.filter().eq(D)).reduce((D,x)=>D.or(x)),o),b.getQuickFilterText(N,l.map(D=>"=".concat(i.format(D))).join(" || "),o))},order:10,group:U.groups.low}),O.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,d.map(D=>e.filter().notEq(D)).reduce((D,x)=>D.and(x)),o),b.getQuickFilterText(N,l.map(D=>"!=".concat(i.format(D))).join(" && "),o))},order:20,group:U.groups.low}),O.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().lessThan(f),o),b.getQuickFilterText(N,"<".concat(v),o))},order:30,group:U.groups.low}),O.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().lessThanOrEqualTo(f),o),b.getQuickFilterText(N,"<=".concat(v),o))},order:40,group:U.groups.low}),O.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().greaterThan(m),o),b.getQuickFilterText(N,">".concat(C),o))},order:50,group:U.groups.low}),O.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().greaterThanOrEqualTo(m),o),b.getQuickFilterText(N,">=".concat(C),o))},order:60,group:U.groups.low}),O}emptyStringFilterActions(e,t,i){var{dh:n}=this,a=n.FilterValue.ofString(""),o=t;o||(o={filter:null,text:null});var{filter:u,text:l}=o,d=[],{model:c}=this.irisGrid.props,h=c.getColumnIndexByName(e.name);return L(h),d.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:U.groups.high}),d.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(h,b.getQuickFilterCondition(u,e.filter().eq(a),i),b.getQuickFilterText(l,"=",i))},order:10,group:U.groups.low}),d.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(h,b.getQuickFilterCondition(u,e.filter().notEq(a),i),b.getQuickFilterText(l,"!=",i))},order:20,group:U.groups.low}),d}nullFilterActions(e,t,i){var n=null,a=null;t&&(n=t.filter,a=t.text);var o=[],{model:u}=this.irisGrid.props,l=u.getColumnIndexByName(e.name);return L(l),o.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:U.groups.high}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull(),i),b.getQuickFilterText(a,"null",i))},order:10,group:U.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull().not(),i),b.getQuickFilterText(a,"!null",i))},order:20,group:U.groups.low}),o}sortByActions(e,t,i){var n=this.irisGrid.getTheme(),{contextMenuSortIconColor:a}=n,o=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending)?Ue:void 0,iconColor:a},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending)?Ue:void 0,iconColor:a},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!i}];return T.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending,!0)?Ue:void 0,iconColor:a}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending,!0)?Ue:void 0,iconColor:a})),o}additionalSortActions(e,t){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:n}=i,a=[{title:"Add Sort By",menuElement:s.jsxs("div",{className:"btn-context-menu menu-title",children:[s.jsx("span",{className:"icon",children:s.jsx(Z,{icon:Ue,style:{color:n??void 0}})}),s.jsx("span",{className:"title",children:"Add Additional Sort"}),s.jsx("span",{className:"shortcut",children:Ae.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return T.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),a}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===i:!1}}Se(b,"GROUP_EDIT",U.groups.high+10);Se(b,"GROUP_HIDE_COLUMNS",U.groups.high+25);Se(b,"GROUP_FILTER",U.groups.high+50);Se(b,"GROUP_EXPAND_COLLAPSE",U.groups.high+55);Se(b,"GROUP_GOTO",U.groups.high+60);Se(b,"GROUP_SORT",U.groups.high+75);Se(b,"GROUP_COPY",U.groups.high+100);Se(b,"GROUP_FORMAT",U.groups.high+150);Se(b,"GROUP_VIEW_CONTENTS",U.groups.high+175);Se(b,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const yl=b;function wl(r,e,t){return e=Fl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fl(r){var e=Nl(r,"string");return typeof e=="symbol"?e:String(e)}function Nl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ol extends Re{constructor(e){super(250),wl(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Fe.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const Al=Ol;function Rl(r,e,t){return e=_l(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _l(r){var e=xl(r,"string");return typeof e=="symbol"?e:String(e)}function xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Dl extends Re{constructor(e){super(880),Rl(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var{column:i,row:n}=e;return n==null||i==null||this.irisGrid.selectData(i,n),!1}}const Il=Dl;function Pl(r,e,t){return e=Ll(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ll(r){var e=Ul(r,"string");return typeof e=="symbol"?e:String(e)}function Ul(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class jl extends Re{constructor(e){super(),Pl(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:t,column:i,row:n}=e;if(i!==null&&n===null){var{isFilterBarShown:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme();if(a&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&t>l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight)return this.irisGrid.focusFilterBar(i),!0}return!1}onMove(e){var{y:t,column:i}=e,{isFilterBarShown:n,hoverAdvancedFilter:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme(),d=null;return n&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&i!==null&&t>=l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight&&(d=i),d!==a&&this.irisGrid.setState({hoverAdvancedFilter:d}),!1}onLeave(e){var{column:t}=e,{hoverAdvancedFilter:i}=this.irisGrid.state;return i!==null&&t!==i&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const kl=jl;function Gl(r,e,t){return e=Ml(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ml(r){var e=Vl(r,"string");return typeof e=="symbol"?e:String(e)}function Vl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bl extends Re{constructor(e){super(750),Gl(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,t){return Sr.isInTreeBox(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:h}=d,{canvasContext:p}=u,m=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:h,theme:m},C=$e(h)?h.depthForRow(a):null,{left:v,top:F,width:w,height:g}=o.getExpandButtonPosition(f,C);return v==null||w==null||F==null||g==null?null:{left:v,top:F,width:w,height:g}}onMove(e,t){if(Sr.isInTreeBox(e,t)){var{expandCellTooltipProps:i}=this.irisGrid.state,{model:n}=this.irisGrid.props,a=this.getButtonPosition(e),{row:o}=e;L(o);var u=$e(n)&&n.isRowExpanded(o);De(i,a)||this.irisGrid.setState({expandCellTooltipProps:a,expandTooltipDisplayValue:u?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const $l=Bl;function _r(r,e,t){return e=Ql(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ql(r){var e=Hl(r,"string");return typeof e=="symbol"?e:String(e)}function Hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Wl extends Re{constructor(e){super(),_r(this,"irisGrid",void 0),_r(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:t,row:i,columnHeaderDepth:n}=e;return t!==null&&i===null&&n===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,i){var n=this.getColumnFromGridPoint(e);if(n!=null&&n===this.column){var a=Ae.isModifierKeyDown(i);return this.irisGrid.toggleSort(n,a),!0}return!1}}const Kl=Wl;class Yl extends Re{constructor(e){super(),this.irisGrid=e}onWheel(e,t,i){var{irisGrid:n}=this,{model:a}=n.props,{metrics:o,pendingRowCount:u}=n.state;L(o);var{bottom:l,rowCount:d,rowHeight:c}=o,{deltaY:h}=ge.getScrollDelta(i);return Be(a)&&a.isEditable&&l>=d-1&&h>0&&n.setState({pendingRowCount:u+Math.ceil(h/c)}),!1}}const ql=Yl;function xr(r,e,t){return e=zl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zl(r){var e=Xl(r,"string");return typeof e=="symbol"?e:String(e)}function Xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Zl extends Re{constructor(e){super(),xr(this,"irisGrid",void 0),xr(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,t){var{column:i,row:n,x:a,y:o}=e,{renderer:u,metrics:l,props:d}=t,{model:c}=d;if(i==null||n==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:h,modelColumns:p}=l,m=Fi(h,n),f=Fi(p,i),C=c.renderTypeForCell(f,m),v=u.getCellRenderer(C);if(!Fo(v))return!1;if(this.currentLinkBox!=null){var{x1:F,y1:w,x2:g,y2:N}=this.currentLinkBox;if(a>=F&&a<=g&&o>=w&&o<=N)return!0}for(var A=t.updateRenderState(),E=v.getTokenBoxesForVisibleCell(i,n,A),O=0;O<E.length;O+=1)if(gr(E[O].token)){var D=ge.translateTokenBox(E[O],l),{x1:x,x2:G,y1:z,y2:M}=D;if(a>=x&&a<=G&&o>=z&&o<=M)return this.currentLinkBox=D,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var i=this.isHoveringLink(e,t);if(i&&this.currentLinkBox!=null&&gr(this.currentLinkBox.token)){var{linkHoverTooltipProps:n}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:a,y1:o,x2:u,y2:l}=this.currentLinkBox,{href:d}=this.currentLinkBox.token,c=u-a,h=l-o,p={left:a,top:o+1,width:c,height:h};De(n,p)||this.irisGrid.setState({linkHoverTooltipProps:p,linkHoverDisplayValue:d})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Jl=Zl;var eu=3e3;function tu(r){var{children:e=null,onEntering:t,onEntered:i,onExiting:n,onExited:a}=r,[o,u]=y.useState(!1),l=y.useRef(),d=Hr(e),c=y.useCallback(()=>{u(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{u(!1)},eu)},[u,l]);return y.useEffect(()=>{d!==e&&e!=null&&c()},[e,d,u,c]),y.useEffect(()=>()=>l.current?clearTimeout(l.current):void 0,[]),s.jsx(Vt,{className:"toast-bottom-bar",isShown:o,onEntering:t,onEntered:i,onExiting:n,onExited:a,children:e})}var iu=1,nn=ke.memo(r=>{var{model:e,modelColumns:t,top:i,bottom:n,left:a,right:o,filter:u,formatter:l,reverseType:d=T.REVERSE_TYPE.NONE,sorts:c,customColumns:h,movedColumns:p,hiddenColumns:m,alwaysFetchColumns:f,rollupConfig:C=null,totalsConfig:v=null,selectDistinctColumns:F=de,pendingRowCount:w=0,pendingDataMap:g=Ve,frozenColumns:N,formatColumns:A,columnHeaderGroups:E,partitionConfig:O}=r,D=y.useMemo(()=>ie.getModelViewportColumns(t,a,o,p,m,f,iu),[t,a,o,p,m,f]);return y.useEffect(function(){e.filter=u},[e,u]),y.useEffect(function(){var G=[...c];d!==T.REVERSE_TYPE.NONE&&G.push(e.dh.Table.reverse()),e.sort=G},[e,c,d]),y.useEffect(function(){e.formatter=l},[e,l]),y.useEffect(function(){e.isCustomColumnsAvailable&&(e.customColumns=h)},[e,h]),y.useEffect(function(){e.isFormatColumnsAvailable&&(e.formatColumns=A)},[e,A]),y.useEffect(function(){e.setViewport(i,n,D)},[e,i,n,D]),y.useEffect(function(){e.isRollupAvailable&&(e.rollupConfig=C)},[e,e.isRollupAvailable,C]),y.useEffect(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=F)},[e,F]),y.useEffect(function(){e.isTotalsAvailable&&(e.totalsConfig=v)},[e,e.isTotalsAvailable,v]),y.useEffect(function(){e.pendingRowCount=w},[e,w]),y.useEffect(function(){e.pendingDataMap=g},[e,g]),y.useEffect(function(){N&&e.updateFrozenColumns(N)},[e,N]),y.useEffect(function(){e.columnHeaderGroups=E},[e,E]),y.useEffect(function(){O&&Ni(e)&&(e.partitionConfig=O)},[e,O]),null});nn.displayName="IrisGridModelUpdater";const ru=nn;function an(r,e,t){return e=nu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gi=ce.module("ColumnStatistics"),ou={SIZE:"Number of Rows"};class Et extends y.Component{static getStatsLabel(e){var t;return(t=ou[e])!==null&&t!==void 0?t:e.split(" ").map(i=>i[0].toUpperCase()+i.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),an(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var{column:e,model:t}=this.props,i=t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount;this.setState({numRows:i}),!t.isColumnStatisticsAvailable||e.isProxy===!0?this.setState({loading:!1}):i<Et.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var{column:e,model:t}=this.props;this.cancelablePromise=Oe.makeCancelable(t.columnStatistics(e)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){gi.debug("Received statistics",e);var{model:t,onStatistics:i}=this.props,n=[];e.statisticsMap.forEach((a,o)=>{n.push({operation:Et.getStatsLabel(o),value:a,type:e.getType(o)})}),e.uniqueValues.forEach((a,o)=>{n.push({operation:o,className:"column-statistics-unique-value",value:a,type:"long"})}),this.setState({loading:!1,statistics:n,numRows:t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount}),i()}handleError(e){if(e!=null&&Oe.isCanceled(e)){gi.debug("Called handleError on a cancelled promise result");return}gi.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,{column:t,model:i}=this.props,{error:n,loading:a,statistics:o,numRows:u}=this.state,l=!a&&n==null&&o==null&&i.isColumnStatisticsAvailable,d=[],c=t.type.substring(t.type.lastIndexOf(".")+1),h=t.description===null?null:t.description;if(o!=null)for(var p=0;p<o.length;p+=1){var{operation:m,className:f,value:C,type:v}=o[p],F=v?i.displayString(C,v):i.displayString(C,t.type,t.name),w=s.jsxs(ke.Fragment,{children:[s.jsx("div",{className:Y("column-statistic-operation",f),children:m}),s.jsx("div",{className:"column-statistic-value",children:F})]},m);d.push(w)}var g=$e(i)&&i.hasExpandableRows?"Expanded Rows":"Number of Rows",N=i.displayString(u,"long"),A=i.getColumnIndexByName(t.name);return s.jsxs("div",{className:"column-statistics",children:[s.jsxs("div",{className:"column-statistics-title",children:[(e=t.displayName)!==null&&e!==void 0?e:t.name,s.jsxs("span",{className:"column-statistics-type",children:[" (",c,")"]}),s.jsx(Wr,{className:"column-statistics-copy",tooltip:"Copy column name",copy:t.name})]}),h!=null&&s.jsx("div",{className:"column-statistics-description",children:h}),A!=null&&!i.isColumnSortable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:ha,className:"mr-1"}),"Not sortable"]}),A!=null&&!i.isColumnMovable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:i.isColumnFrozen(A)?ma:pa,className:"mr-1"}),i.isColumnFrozen(A)?"Frozen":"Not movable"]}),s.jsxs("div",{className:"column-statistics-grid",children:[o==null&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"column-statistic-operation",children:g}),s.jsx("div",{className:"column-statistic-value",children:N})]}),d]}),l&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),n!=null&&s.jsx("div",{className:"error-message",children:"".concat(n)}),o&&!a&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:va,children:"Refresh"}),a&&s.jsxs("div",{className:"column-statistics-loading",children:[s.jsx(kt,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}an(Et,"AUTO_GENERATE_LIMIT",1e5);const su=Et;function lu(r,e,t){return e=uu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uu(r){var e=du(r,"string");return typeof e=="symbol"?e:String(e)}function du(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cu extends y.PureComponent{static createSearchFilter(e,t,i,n,a){var o=a?n.filter(d=>!i.includes(d.name)).map(d=>d.name):i;if(t&&o.length>0){var u=e.FilterValue.ofString(t),l=o.length===n.length?e.FilterCondition.search(u):e.FilterCondition.search(u,n.filter(d=>o.includes(d.name)).map(d=>d.filter()));return l}}constructor(e){super(e),lu(this,"searchField",void 0),this.handleSearchValueChange=this.handleSearchValueChange.bind(this),this.toggleColumn=this.toggleColumn.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.selectNumbers=this.selectNumbers.bind(this),this.searchField=ke.createRef(),this.state={isConfigureColumnsShown:!1}}focus(){var e;(e=this.searchField.current)===null||e===void 0||e.focus()}handleSearchValueChange(e){var{onChange:t,selectedColumns:i,invertSelection:n}=this.props;t(e.target.value,i,n)}sendColumnChange(e,t){var{onChange:i,value:n}=this.props;i(n,e,t)}setInvertSelection(e){var{onChange:t,value:i}=this.props;t(i,[],e)}toggleColumn(e){var{selectedColumns:t,invertSelection:i}=this.props;if(t.includes(e))this.sendColumnChange(t.filter(a=>a!==e),i);else{var n=t.slice();n.push(e),this.sendColumnChange(n,i)}}selectAll(){this.setInvertSelection(!0)}clear(){this.setInvertSelection(!1)}selectNumbers(){var{columns:e}=this.props;this.sendColumnChange(e.filter(t=>T.isNumberType(t.type)).map(t=>t.name),!1)}render(){var{value:e,selectedColumns:t,invertSelection:i,columns:n}=this.props,{isConfigureColumnsShown:a}=this.state,o=t.length===0&&i===!0||t.length===n.length&&i===!1,u=t.length===0&&i===!1||t.length===n.length&&i===!0,l;return o?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:vr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:ga,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}):u?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:fa,mask:ci,transform:"shrink-1 down-5 right-7"}),s.jsx(Z,{icon:pr,className:"text-danger",transform:"shrink-4 down-5 right-7"})]}):l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:vr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:Ca,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}),s.jsxs("div",{className:"cross-column-container",children:[s.jsx(Wa,{className:"cross-column-search",placeholder:"Search Data...","data-testid":"cross-column-search",value:e,onChange:this.handleSearchValueChange,ref:this.searchField}),s.jsxs("button",{type:"button",className:"btn btn-link btn-link-icon px-2",onClick:()=>{a?this.setState({isConfigureColumnsShown:!1}):this.setState({isConfigureColumnsShown:!0})},children:[s.jsx("div",{className:"fa-layers",children:l}),s.jsx(Xe,{children:"Configure Columns"}),s.jsx(Kr,{isShown:a,className:"cross-column-popper",onExited:()=>{this.setState({isConfigureColumnsShown:!1})},closeOnBlur:!0,interactive:!0,children:s.jsxs("div",{className:"cross-column-popup",children:["Searched Columns",s.jsx("div",{className:"cross-column-scroll",children:n.map(d=>d.isProxy===!0?null:s.jsxs(ke.Fragment,{children:[s.jsx(Ka,{className:"cross-column-checkbox",checked:i?!t.includes(d.name):t.includes(d.name),onChange:()=>this.toggleColumn(d.name),children:d.name}),d.type.substring(d.type.lastIndexOf(".")+1)]},d.name))}),s.jsxs("div",{className:"cross-column-button-bar",children:[s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,children:"Select All"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.clear,children:"Clear"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectNumbers,children:"Numbers Only"})]}),u&&s.jsxs("p",{className:"text-danger",children:[s.jsx(Z,{icon:pr})," Select at least one column to search."]})]})})]})]})}}const xt=cu;function Dr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dr(Object(t),!0).forEach(function(i){ft(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Pr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function fi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Pr(a,i,n,o,u,"next",l)}function u(l){Pr(a,i,n,o,u,"throw",l)}o(void 0)})}}function ft(r,e,t){return e=hu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hu(r){var e=mu(r,"string");return typeof e=="symbol"?e:String(e)}function mu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var qe=ce.module("IrisGridPartitionSelector");class pu extends y.Component{constructor(e){super(e),ft(this,"pending",void 0),ft(this,"tableUtils",void 0),ft(this,"getCachedChangeCallback",J(i=>n=>this.handlePartitionSelect(i,n))),ft(this,"getCachedFormatValueCallback",J(i=>n=>this.getDisplayValue(i,n))),this.handleKeyTableClick=this.handleKeyTableClick.bind(this),this.handleMergeClick=this.handleMergeClick.bind(this),this.handlePartitionSelect=this.handlePartitionSelect.bind(this);var{model:t}=e;this.tableUtils=new T(t.dh),this.pending=new Yr,this.state={isLoading:!0,keysTable:null,partitionFilters:null,partitionTables:null}}componentDidMount(){var e=this;return fi(function*(){var{model:t}=e.props;try{var i=yield e.pending.add(t.partitionKeysTable().then(o=>{var u=t.partitionColumns.map(l=>l.sort().desc());return o.applySort(u),o}),o=>o.close()),n=yield Promise.all(t.partitionColumns.map(function(){var o=fi(function*(u,l){return e.pending.add(i.selectDistinct(t.partitionColumns.slice(0,l+1)),d=>d.close())});return function(u,l){return o.apply(this,arguments)}}())),a=e.getPartitionFilters(n);e.setState({isLoading:!1,keysTable:i,partitionFilters:a,partitionTables:n})}catch(o){if(!Oe.isCanceled(o))throw o}})()}componentDidUpdate(e){var{partitionConfig:t}=e,{partitionConfig:i}=this.props;t!==i&&this.updatePartitionFilters()}componentWillUnmount(){this.pending.cancel();var{keysTable:e,partitionTables:t}=this.state;e?.close(),t?.forEach(i=>i.close())}handleKeyTableClick(){qe.debug2("handleKeyTableClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="keys"?"partition":"keys",this.sendUpdate(t)}handleMergeClick(){qe.debug2("handleMergeClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="merged"?"partition":"merged",this.sendUpdate(t)}handlePartitionSelect(e,t){var i=this;return fi(function*(){var{model:n,partitionConfig:a}=i.props;qe.debug("handlePartitionSelect",e,t,a);var o=[...a.partitions];if(o[e]=t,e===n.partitionColumns.length-1){i.sendUpdate({partitions:o,mode:"partition"});return}var{keysTable:u}=i.state;L(u);try{i.setState({isLoading:!0});var l=yield i.pending.add(u.copy(),p=>p.close()),d=o.slice(0,e+1).map((p,m)=>{var f=l.columns[m];return i.tableUtils.makeNullableEqFilter(f,p)});l.applyFilter(d),l.setViewport(0,0,l.columns);var c=yield i.pending.add(l.getViewportData()),h={partitions:l.columns.map(p=>{var m;return(m=c.rows[0].get(p))!==null&&m!==void 0?m:null}),mode:"partition"};l.close(),i.sendUpdate(h)}catch(p){Oe.isCanceled(p)||qe.error("Unable to get partition tables",p)}finally{i.setState({isLoading:!1})}})()}sendUpdate(e){qe.debug2("sendUpdate",e);var{onChange:t}=this.props;t(e)}getDisplayValue(e,t){var{model:i}=this.props;if(t===null)return"(null)";if(t===void 0||t==="")return"";var n=i.partitionColumns[e];return T.isCharType(n.type)&&t.toString().length>0?String.fromCharCode(parseInt(t.toString(),10)):i.displayString(t,n.type,n.name)}updatePartitionFilters(){var{partitionTables:e}=this.state;L(e);var{partitionConfig:t}=this.props,{mode:i}=t;if(qe.debug("updatePartitionFilters",t),i==="partition"){var n=this.getPartitionFilters(e);this.setState({partitionFilters:n})}}getPartitionFilters(e){var{model:t,partitionConfig:i}=this.props,{partitions:n}=i;if(qe.debug("getPartitionFilters",i),n.length!==e.length)throw new Error("Invalid partition config set. Expected ".concat(e.length," partitions, but got ").concat(n.length));for(var a=[],o=0;o<n.length;o+=1)if(o===0)a.push([]);else{var u=a[o-1],l=n[o-1],d=t.partitionColumns[o-1],c=[...u,this.tableUtils.makeNullableEqFilter(d,l)];a.push(c)}return a}render(){var{model:e,partitionConfig:t}=this.props,{isLoading:i,partitionFilters:n,partitionTables:a}=this.state,{mode:o,partitions:u}=t,l=e.partitionColumns.map((d,c)=>{var h;return s.jsxs("div",{className:"column-selector",children:[s.jsx("div",{className:"column-name",children:d.name}),s.jsx(no,{className:"custom-select-sm",table:a?.[c],column:a==null||(h=a[c])===null||h===void 0?void 0:h.columns[c],filter:n?.[c],onChange:this.getCachedChangeCallback(c),selectedValue:o==="partition"?u[c]:void 0,disabled:c>0&&t.mode!=="partition"||i,formatValue:this.getCachedFormatValueCallback(c)}),e.partitionColumns.length-1===c||s.jsx(Z,{icon:Sa})]},"selector-".concat(d.name))});return s.jsxs("div",{className:"iris-grid-partition-selector",children:[s.jsx("div",{className:"table-name",children:"Partitioned Table"}),s.jsxs("div",{className:"partition-button-group",children:[s.jsx(W,{className:"btn-sm",onClick:this.handleKeyTableClick,kind:"inline",tooltip:"View keys as table",icon:Ta,active:t.mode==="keys",disabled:i,children:"Keys"}),s.jsx(W,{className:"btn-sm",onClick:this.handleMergeClick,kind:"inline",tooltip:"View all partitions as one merged table",icon:s.jsx(Z,{icon:ba,rotation:90}),active:t.mode==="merged",disabled:i,children:"Merge"})]}),l]})}}const vu=pu;function gu(r,e,t){return e=fu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fu(r){var e=Cu(r,"string");return typeof e=="symbol"?e:String(e)}function Cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Su=ce.module("SelectDistinctBuilder");class on extends y.Component{constructor(e){super(e),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleDropdownChanged=this.handleDropdownChanged.bind(this);var{model:t,selectDistinctColumns:i}=this.props;this.state={inputs:i.length>0?[...i]:[""],columns:t.originalColumns}}componentDidUpdate(e,t){var{inputs:i}=this.state,{onChange:n}=this.props;if(t.inputs!==i){var a=i.filter(o=>o!=="");De(t.inputs.filter(o=>o!==""),a)||n(a)}}handleAddColumnClick(){this.setState(e=>{var{inputs:t}=e;return{inputs:[...t,""]}})}handleDeleteColumn(e){this.setState(t=>{var{inputs:i}=t;return{inputs:i.length===1&&e===0?[""]:i.filter((n,a)=>e!==a)}})}handleDropdownChanged(e,t){Su.debug("handleDropdownChanged",e,t),this.setState(i=>{var{inputs:n}=i,a=[...n];return a[e]=t,{inputs:a}})}renderInputs(){var{columns:e,inputs:t}=this.state;return t.map((i,n)=>{var a=e.filter(o=>{var{name:u}=o;return u===i||!t.includes(u)}).map(o=>{var{name:u}=o;return s.jsx("option",{value:u,children:u},u)});return s.jsxs("div",{className:"form-inline px-3 pb-3",children:[s.jsxs(nt,{className:"form-control custom-select col",value:i,onChange:o=>this.handleDropdownChanged(n,o),children:[s.jsx("option",{value:"",children:"Select a column"}),a]}),(t.length>1||i!=="")&&s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{this.handleDeleteColumn(n)},icon:s.jsx(Z,{icon:Ai,transform:"grow-3"}),tooltip:"Delete column"})]},n)})}render(){var{columns:e,inputs:t}=this.state,i=t.length>=e.length;return s.jsxs("div",{role:"presentation",className:"select-distinct-builder-container h-100",children:[s.jsx("div",{className:"select-distinct-title",children:"Display Unique Values From"}),this.renderInputs(),s.jsx("hr",{}),s.jsx("div",{className:"pt-1 px-3",children:s.jsx(W,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,disabled:i,icon:Ri,children:"Add Additional Column"})}),s.jsx("div",{className:"select-distinct-builder-footer",children:s.jsx("div",{className:"select-distinct-builder-hint",children:"Display only unique values from the selected table columns. Note that this will reset any filters and display only the selected columns."})})]})}}gu(on,"defaultProps",{selectDistinctColumns:[],onChange:()=>{}});const Tu=on;function ji(r){var{items:e,onChange:t=()=>{}}=r;return s.jsx(qr,{items:Array.from(e.entries()).map(i=>{var[n,a]=i;return{title:ji.getAdvancedSettingsTitleForKey(n),isOn:a,onChange:o=>t(n,o)}})})}ji.getAdvancedSettingsTitleForKey=r=>{switch(r){case Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from a control";case Lt.LINK_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from an incoming link filter"}};function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){bu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function bu(r,e,t){return e=Eu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Eu(r){var e=yu(r,"string");return typeof e=="symbol"?e:String(e)}function yu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ur=ce.module("ConditionalFormattingMenu"),Ci=()=>{};function wu(r){var{column:{type:e}}=r;if(T.isNumberType(e))return r.condition===P.IS_NULL||r.condition===P.IS_NOT_NULL?"":"".concat(r.value);if(T.isCharType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isStringType(e))return r.condition===B.IS_NULL||r.condition===B.IS_NOT_NULL?"":'"'.concat(r.value,'"');if(T.isDateType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isBooleanType(e))return"";throw new Error("Invalid column type ".concat(e," in getRuleValue"))}function Fu(r){return T.isNumberType(r.column.type)&&r.condition===P.IS_BETWEEN?"".concat(r.start," < ").concat(r.column.name," < ").concat(r.end):"".concat(r.column.name," ").concat(ds(r.column.type,r.condition),`
1
+ import{r as y,_ as $r,I as s,K as Y,Z as bi,M as ke,L as Z,J as Ei,T as rt,be as De,U as J,bb as na,bc as aa,ba as oa,$ as hr,af as di,V as At}from"./vendor-2ad5ff96.js";import{L as ce,f as Ai,I as kt,e as L,g as Ri,br as mr,T as yi,ai as sa,aj as la,bs as _i,bt as Pt,bu as ua,bv as Ue,bw as da,bx as ca,aF as wi,aV as Fi,by as ha,bz as ma,bA as pa,an as va,bB as pr,F as vr,bC as ci,bD as ga,ao as fa,bE as Ca,ah as Sa,bF as Ta,bG as ba,ar as Ea,aL as ya,M as wa,b as Fa,bH as Na,bI as Oa,c as Aa,j as Qr,A as Ra,bJ as _a,bK as xa,bg as Da,am as Ia,bL as Pa,r as La,bM as Ua,bN as ja,bO as ka,bP as Ga,av as Ma,bQ as Va,b3 as Ba}from"./index-2cecc484.js";import{c as T,S as nt,B as W,x as xi,P as Oe,O as ht,cJ as $a,t as Ae,b8 as Di,aM as Hr,aa as Ii,ao as Qa,s as Xe,bb as Dt,b as Ct,a as we,I as Ke,G as Ha,al as U,ck as hi,ai as de,ci as Ve,A as Wr,Q as Wa,aj as Kr,C as Ka,cm as Yr,J as Ya,cF as qa,T as Te,F as mi,cK as za,bq as Xa}from"./ControlType-bc4c99a5.js";import{j as Za,k as Ja,l as eo,n as to,I as ie,d as Ni,a as Lt,b as Rt,g as io,h as ro}from"./MissingPartitionError-a843549f.js";import{d as Fe,G as ge,i as $e,e as Be,h as gr,c as xe}from"./IrisGridModel-5e676159.js";import{T as no,c as ao,F as oo,O as K,n as so,l as Ye,f as lo,e as uo,A as co,a as ho,R as mo,b as po,V as vo,C as go,m as fo,g as Co}from"./IrisGridThemeProvider-ac44d4e8.js";import{S as So,l as Re,k as To,c as qr,C as zr,a as bo,e as Eo,P as fr}from"./GridRenderer-a0eb99f6.js";import{I as Ne,a as Cr,S as yo,D as wo}from"./IrisGridShortcuts-e8e5a936.js";import{K as Gt,a as Sr,i as Fo,G as No}from"./Grid-852bd41d.js";import{F as Tr}from"./FormatterUtils-80d69a67.js";import"./helpers-de833af9.js";import"./monaco-b5248072.js";function br(r,e,t){return e=Oo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Oo(r){var e=Ao(r,"string");return typeof e=="symbol"?e:String(e)}function Ao(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var _t=ce.module("AdvancedFilterCreatorFilterItem");class Pi extends y.PureComponent{static getLabelForFilter(e,t){try{if(T.isNumberType(e)||T.isCharType(e))return Za(t);if(T.isTextType(e))return Ja(t);if(T.isDateType(e))return eo(t);if(T.isBooleanType(e))return to(t);throw new Error("Unrecognized column type: ".concat(e))}catch(i){return _t.warn(i),""}}constructor(e){super(e),br(this,"typeDropdown",void 0),br(this,"getCachedIsValid",$r((a,o,u,l,d)=>{try{return!u||d.makeAdvancedValueFilter(a,o,u,l)!=null}catch{return!1}})),this.handleDelete=this.handleDelete.bind(this),this.handleTypeChange=this.handleTypeChange.bind(this),this.handleValueChange=this.handleValueChange.bind(this),this.typeDropdown=null;var{value:t="",filterTypes:i,selectedType:n=i[0]}=e;this.state={selectedType:n,value:t}}componentDidMount(){var e;(e=this.typeDropdown)===null||e===void 0||e.focus()}componentDidUpdate(e){var{value:t,selectedType:i}=this.props;i!==void 0&&e.selectedType!==i&&this.setState({selectedType:i}),t!==void 0&&e.value!==t&&this.setState({value:t})}handleTypeChange(e){var t=e;_t.debug2("typeChange",t),this.setState({selectedType:t});var{onChange:i}=this.props,{value:n}=this.state;n!=null&&n.length>0&&i(t,n)}handleValueChange(e){_t.debug2("valueChange");var{value:t}=e.target;this.setState({value:t});var{onChange:i}=this.props,{selectedType:n}=this.state;n!=null&&i(n,t)}handleDelete(){_t.debug("delete");var{onDelete:e}=this.props;e()}render(){for(var{column:e,filterTypes:t,formatter:i,tableUtils:n}=this.props,{selectedType:a,value:o}=this.state,u=!T.isBooleanType(e.type),l=[],d=this.getCachedIsValid(e,a,o,i.timeZone,n),c=0;c<t.length;c+=1){var h=t[c],p=Pi.getLabelForFilter(e.type,h),m=s.jsx("option",{value:h,children:p},h);l.push(m)}return s.jsx("div",{className:"advanced-filter-creator-filter-item",children:s.jsxs("div",{className:"form-row",children:[s.jsx("div",{className:"form-group col",children:s.jsx(nt,{className:"form-control",value:a,onChange:this.handleTypeChange,ref:f=>{this.typeDropdown=f},children:l})}),u&&s.jsx("div",{className:"form-group col",children:s.jsx("div",{className:"input-group",children:s.jsx("input",{type:"text",className:Y("form-control",{error:!d}),placeholder:"Enter value",value:o,onChange:this.handleValueChange})})}),s.jsx("div",{className:"form-group col-1 px-0",children:s.jsx(W,{kind:"ghost",className:"w-100 h-100 p-0 m-0",onClick:this.handleDelete,icon:Ai,tooltip:"Remove Filter"})})]})})}}const Ro=Pi;function Oi(r,e,t){return e=_o(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _o(r){var e=xo(r,"string");return typeof e=="symbol"?e:String(e)}function xo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Er=ce.module("AdvancedFilterCreatorSelectValueList");class bt extends y.PureComponent{static indexOf(e,t){for(var i=0;i<t.length;i+=1){var n=t[i];if(n===e||n!=null&&n.valueOf!=null&&e!=null&&e.valueOf!=null&&n.valueOf()===e.valueOf())return i}return-1}constructor(e){super(e),Oi(this,"dh",void 0),Oi(this,"list",void 0),this.handleSelect=this.handleSelect.bind(this),this.handleViewportChange=this.handleViewportChange.bind(this),this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.handleTableUpdate=this.handleTableUpdate.bind(this);var{selectedValues:t,dh:i}=this.props;this.dh=i,this.list=null,this.state={itemCount:0,items:[],offset:0,selectedValues:t,isLoading:!0}}componentDidMount(){var{table:e}=this.props;e&&this.startListening(e)}componentDidUpdate(e){var{filters:t,invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&(e.table&&this.stopListening(e.table),a&&this.startListening(a),this.resetViewport()),e.invertSelection!==i&&this.setState({selectedValues:[]},this.handleSelectionUpdate),e.selectedValues!==n&&this.setState({selectedValues:n},this.handleSelectionUpdate),e.filters!==t&&(a?.applyFilter(t),this.resetViewport())}componentWillUnmount(){var{table:e}=this.props;e&&this.stopListening(e)}handleSelect(e,t){var{invertSelection:i}=this.props,{selectedValues:n}=this.state;n=[...n];var a=bt.indexOf(t,n);a>=0?n.splice(a,1):n.push(t);var o=a<0;i&&(o=!o);var{offset:u}=this.state,{items:l}=this.state;l=[...l];var d=e-u;d>=0&&d<l.length&&(l[d].isSelected=o),this.setState({items:l,selectedValues:n});var{onChange:c}=this.props;c(n,i)}handleViewportChange(e,t){this.updateViewport(e,t)}handleSelectionUpdate(){this.updateItemSelection()}handleTableUpdate(e){var{table:t,formatter:i}=this.props;if(t){for(var n=e.detail,{offset:a}=n,o=[],u=t.columns[0],l=0;l<n.rows.length;l+=1){var d=n.rows[l],c=d.get(u),h=void 0;c==null?h=s.jsx("i",{className:"text-muted",children:"null"}):c===""?h=s.jsx("i",{className:"text-muted",children:"empty"}):h=i.getFormattedString(c,u.type,u.name);var p=this.isValueSelected(c);o.push({displayValue:h,value:c,isSelected:p})}Er.debug2("Received table update:",a,o.length);var m=t.size;this.setState({itemCount:m,items:o,offset:a,isLoading:!1})}}isValueSelected(e){var{invertSelection:t}=this.props,{selectedValues:i}=this.state,n=bt.indexOf(e,i);return t?n<0:n>=0}startListening(e){e.addEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}stopListening(e){e.removeEventListener(this.dh.Table.EVENT_UPDATED,this.handleTableUpdate)}resetViewport(){this.list&&this.list.topRow!=null&&this.list.bottomRow!=null&&this.updateViewport(this.list.topRow,this.list.bottomRow,!0)}updateItemSelection(){var{items:e}=this.state;e=[...e];for(var t=0;t<e.length;t+=1){var i=e[t],{value:n}=i;i.isSelected=this.isValueSelected(n)}this.setState({items:e})}updateViewport(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{table:n}=this.props;if(n!=null){i&&this.setState({isLoading:!0});var a=t-e+1,o=Math.max(0,e-a*3),u=Math.max(o,t+a*3);Er.debug2("Setting viewport",o,",",u),n.setViewport(o,u)}}render(){var{offset:e,isLoading:t,items:i,itemCount:n}=this.state;return s.jsxs("div",{className:"select-value-list-wrapper",children:[s.jsx(So,{itemCount:n,items:i,offset:e,onSelect:this.handleSelect,onViewportChange:this.handleViewportChange,ref:a=>{this.list=a}}),s.jsx(xi,{in:t,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"loading-list",children:s.jsx(kt,{className:"loading-spinner-large"})})})]})}}Oi(bt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{}});const Do=bt;function St(r,e,t){return e=Io(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Io(r){var e=Po(r,"string");return typeof e=="symbol"?e:String(e)}function Po(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class yt extends y.PureComponent{constructor(e){super(e),St(this,"searchTablePromise",void 0),St(this,"tableUtils",void 0),St(this,"updateFilterTimer",void 0),this.handleSelectAllClick=this.handleSelectAllClick.bind(this),this.handleClearAllClick=this.handleClearAllClick.bind(this),this.handleListChange=this.handleListChange.bind(this),this.handleSearchChange=this.handleSearchChange.bind(this),this.handleUpdateFilterTimeout=this.handleUpdateFilterTimeout.bind(this);var{dh:t,invertSelection:i,selectedValues:n}=e;this.tableUtils=new T(t),this.state={filters:[],invertSelection:i,selectedValues:n,searchText:""}}componentDidMount(){this.initSearchTable()}componentDidUpdate(e,t){var{invertSelection:i,selectedValues:n,table:a}=this.props;e.table!==a&&this.initSearchTable(),e.invertSelection!==i&&this.setState({invertSelection:i}),e.selectedValues!==n&&this.setState({selectedValues:n});var{table:o,searchText:u}=this.state;o!==t.table&&(t.table!=null&&t.table.close(),o!=null&&this.startUpdateFilterTimer()),u!==t.searchText&&this.startUpdateFilterTimer()}componentWillUnmount(){var{table:e}=this.state;e?.close(),this.searchTablePromise=void 0,this.stopUpdateFilterTimer()}getColumnName(){var{table:e}=this.props;return e!=null?e.columns[0].name:""}getDisplayedValuesCount(){var{invertSelection:e,selectedValues:t,table:i}=this.state;return i==null?null:e?i.totalSize-t.length:t.length}getDisplayedValueText(){var e=this.getDisplayedValuesCount(),{table:t}=this.state,{formatter:i}=this.props;if(e!=null&&t!=null){var n=i.getFormattedString(e,"long"),a=i.getFormattedString(t.totalSize,"long"),o="";return e<1e6&&(o="Displaying "),"".concat(o).concat(n," of ").concat(a)}return null}initSearchTable(){var{table:e}=this.props;if(e!=null){var t=e.copy();this.searchTablePromise=t,this.searchTablePromise.then(i=>{this.searchTablePromise===t?(this.setState({table:i}),this.searchTablePromise=void 0):i.close()})}}handleListChange(e,t){this.setState({selectedValues:e,invertSelection:t});var{onChange:i}=this.props;i(e,t)}handleSearchChange(e){var t=e.target.value;this.setState({searchText:t})}handleSelectAllClick(){this.resetSelection(!0)}handleClearAllClick(){this.resetSelection(!1)}handleUpdateFilterTimeout(){this.updateFilterTimer=void 0,this.updateTableFilter()}resetSelection(e){var t=[];this.setState({invertSelection:e,selectedValues:t});var{onChange:i}=this.props;i(t,e)}startUpdateFilterTimer(){this.stopUpdateFilterTimer(),this.updateFilterTimer=setTimeout(this.handleUpdateFilterTimeout,yt.searchDebounceTime)}stopUpdateFilterTimer(){this.updateFilterTimer!=null&&(clearTimeout(this.updateFilterTimer),this.updateFilterTimer=void 0)}updateTableFilter(){var{table:e,searchText:t}=this.state,{timeZone:i}=this.props,{tableUtils:n}=this,a=e?.columns[0],o=[];if(a!=null){var u;if(t.length>0){var l=null;T.isCharType(a.type)?l=n.makeQuickFilter(a,t):T.isTextType(a.type)?l=n.makeQuickFilter(a,"~".concat(t),i):l=n.makeQuickFilter(a,">=".concat(t),i),l!=null?o.push(l):u="Invalid search text"}this.setState({filters:o,error:u})}}render(){var{error:e,filters:t,invertSelection:i,selectedValues:n,searchText:a,table:o}=this.state,{dh:u,formatter:l,showSearch:d}=this.props,c=this.getColumnName(),h=this.getDisplayedValueText(),p=c?"Find ".concat(c,"..."):"";return s.jsxs("div",{className:"advanced-filter-creator-select-value",children:[s.jsxs("div",{className:d?"form-group":"",children:[s.jsx("label",{htmlFor:"advanced-filter-creator-select-value-input",children:"Select Values"}),d&&s.jsx("input",{type:"text",className:Y("form-control",{"is-invalid":e!=null}),id:"advanced-filter-creator-select-value-input",placeholder:p,value:a,onChange:this.handleSearchChange})]}),s.jsx(Do,{dh:u,table:o,filters:t,invertSelection:i,selectedValues:n,formatter:l,onChange:this.handleListChange}),s.jsxs("div",{className:"advanced-filter-creator-select-meta-row",children:[s.jsxs("div",{children:[s.jsx(W,{kind:"ghost",onClick:this.handleSelectAllClick,children:"Select All"}),s.jsx(W,{kind:"ghost",onClick:this.handleClearAllClick,children:"Clear"})]}),s.jsx(xi,{in:h!=null,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"row-count-info",children:h})})]})]})}}St(yt,"searchDebounceTime",250);St(yt,"defaultProps",{invertSelection:!0,selectedValues:[],onChange:()=>{},showSearch:!0});const Lo=yt;function it(r,e,t){return e=Uo(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uo(r){var e=jo(r,"string");return typeof e=="symbol"?e:String(e)}function jo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var mt=ce.module("AdvancedFilterCreator");class Ie extends y.PureComponent{static makeFilterItem(){return{key:bi()}}constructor(e){var t,i;super(e),it(this,"focusTrapContainer",void 0),it(this,"debounceTimeout",void 0),it(this,"valuesTablePromise",void 0),it(this,"getFilterTypes",$r(m=>T.getFilterTypes(m))),this.handleAddAnd=this.handleAddAnd.bind(this),this.handleAddOr=this.handleAddOr.bind(this),this.handleChangeFilterOperator=this.handleChangeFilterOperator.bind(this),this.handleDone=this.handleDone.bind(this),this.handleFilterChange=this.handleFilterChange.bind(this),this.handleFilterDelete=this.handleFilterDelete.bind(this),this.handleSelectValueChange=this.handleSelectValueChange.bind(this),this.handleReset=this.handleReset.bind(this),this.handleSortDown=this.handleSortDown.bind(this),this.handleSortUp=this.handleSortUp.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.handleFocusTrapStart=this.handleFocusTrapStart.bind(this),this.handleFocusTrapEnd=this.handleFocusTrapEnd.bind(this),this.handleUpdateTimeout=this.handleUpdateTimeout.bind(this),this.focusTrapContainer=ke.createRef();var{model:n,column:a,options:o}=e,{filterOperators:u,invertSelection:l,selectedValues:d}=o,c=(t=(i=o.filterItems)===null||i===void 0?void 0:i.map(m=>{var{selectedType:f,value:C}=m;return{selectedType:f,value:C,key:bi()}}))!==null&&t!==void 0?t:[];c.length===0&&c.push(Ie.makeFilterItem()),u==null&&(u=[]),l==null&&(l=!0),d==null&&(d=[]);var h=n.getColumnIndexByName(a.name);L(h);var p=n.isColumnSortable(h);this.state={filterItems:c,filterOperators:u,invertSelection:l,selectedValues:d,valuesTableError:null,valuesTable:void 0,isSortable:p}}componentDidMount(){this.initValuesTable()}componentWillUnmount(){this.debounceTimeout!=null&&(clearTimeout(this.debounceTimeout),this.sendUpdate()),this.valuesTablePromise!=null&&this.valuesTablePromise.cancel()}getFilterChangeHandler(e){return this.handleFilterChange.bind(this,e)}getFilterDeleteHandler(e){return this.handleFilterDelete.bind(this,e)}initValuesTable(){var{model:e,column:t}=this.props;if(!e.isValuesTableAvailable){mt.debug("No values table for this model, just ignore");return}this.valuesTablePromise=T.makeCancelableTablePromise(e.valuesTable(t)),this.valuesTablePromise.then(i=>{var n;if(!((n=i.columns[0].isSortable)!==null&&n!==void 0)||n){var a=i.columns[0].sort().asc();i.applySort([a])}this.setState({valuesTable:i})}).catch(i=>{Oe.isCanceled(i)||(mt.error("Unable to open values table",i),this.setState({valuesTableError:i}))})}handleFocusTrapEnd(){var e,t;((e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelector("button,select,input,textarea")).focus()}handleFocusTrapStart(){var e,t,i=(e=this.focusTrapContainer)===null||e===void 0||(t=e.current)===null||t===void 0?void 0:t.querySelectorAll("button,select,input,textarea");if(i&&i.length>0){var n=i[i.length-1];n.focus()}}handleAddAnd(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.and),this.setState({filterItems:e,filterOperators:t})}handleAddOr(){var{filterItems:e,filterOperators:t}=this.state;e=e.concat(Ie.makeFilterItem()),t=t.concat(ht.or),this.setState({filterItems:e,filterOperators:t})}handleChangeFilterOperator(e,t){var{filterOperators:i}=this.state;i=[...i],$a(t),i[e]=t,this.setState({filterOperators:i}),this.startUpdateTimer()}handleFilterChange(e,t,i){var{filterItems:n}=this.state;n=[...n];var{key:a}=n[e];n[e]={key:a,selectedType:t,value:i},this.setState({filterItems:n}),this.startUpdateTimer()}handleFilterDelete(e){var{filterItems:t,filterOperators:i}=this.state;t=[...t],i=[...i],e<t.length&&t.splice(e,1),e<i.length?i.splice(e,1):e===i.length&&i.splice(i.length-1,1),t.length===0&&t.push(Ie.makeFilterItem()),this.setState({filterItems:t,filterOperators:i}),this.startUpdateTimer()}handleSelectValueChange(e,t){this.setState({selectedValues:e,invertSelection:t}),this.startUpdateTimer()}handleReset(){mt.debug("Resetting Advanced Filter"),this.setState({filterItems:[Ie.makeFilterItem()],filterOperators:[],selectedValues:[],invertSelection:!0}),this.startUpdateTimer()}handleSortDown(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.descending,t)}handleSortUp(e){var t=Ae.isModifierKeyDown(e);this.sortTable(T.sortDirection.ascending,t)}handleSubmit(e){mt.debug("Submitting Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate(),e.preventDefault()}handleDone(e){mt.debug("Submitting and Closing Advanced Filter"),this.stopUpdateTimer(),this.sendUpdate();var{onDone:t}=this.props;t(),e.preventDefault()}handleUpdateTimeout(){this.debounceTimeout=void 0,this.sendUpdate()}shouldShowAddFilter(){var{filterItems:e}=this.state;if(e.length===0)return!1;var t=e[e.length-1],{selectedType:i,value:n}=t;return i!=null&&i.length>0&&n!=null&&n.length>0}sortTable(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{column:i,onSortChange:n}=this.props,{isSortable:a}=this.state;a&&n(i,e,t)}startUpdateTimer(){this.stopUpdateTimer(),this.debounceTimeout=setTimeout(this.handleUpdateTimeout,Ie.debounceFilterUpdate)}stopUpdateTimer(){this.debounceTimeout!==void 0&&(clearTimeout(this.debounceTimeout),this.debounceTimeout=void 0)}sendUpdate(){var{filterItems:e,filterOperators:t,invertSelection:i,selectedValues:n}=this.state,{column:a,onFilterChange:o,model:u,tableUtils:l}=this.props,{formatter:d}=u,c=e.filter(f=>{var{selectedType:C,value:v}=f;return C!=null&&v!=null&&v!==""}),h=t.filter((f,C)=>f!=null&&e[C].selectedType!=null&&e[C].value!=null&&e[C].value!=="").slice(0,c.length-1),p={filterItems:c,filterOperators:h,invertSelection:i,selectedValues:n},m=l.makeAdvancedFilter(a,p,d.timeZone);o(a,m,p)}render(){var e=this,{column:t,model:i,sortDirection:n,formatter:a,tableUtils:o}=this.props,{filterItems:u,filterOperators:l,invertSelection:d,selectedValues:c,valuesTable:h,valuesTableError:p,isSortable:m}=this.state,{dh:f,isValuesTableAvailable:C}=i,v=T.isBooleanType(t.type),F=T.isDateType(t.type),w=this.getFilterTypes(t.type),g=t.type.substring(t.type.lastIndexOf(".")+1),N=[];if(!v&&w.length)for(var A=function(G){var z=u[G],{key:M,selectedType:oe,value:X}=z,le=s.jsx(Ro,{column:t,filterTypes:w,onChange:e.getFilterChangeHandler(G),onDelete:e.getFilterDeleteHandler(G),selectedType:oe,value:X,formatter:a,tableUtils:o},M);if(N.push(le),G<l.length){var _e=l[G],Le=_e===ht.and,Ge=s.jsxs("div",{className:"form-row justify-content-end advanced-filter-creator-filter-operator",children:[s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.and),children:"AND"}),s.jsx(W,{kind:"ghost",className:Y("filter-operator",{active:!Le}),onClick:()=>e.handleChangeFilterOperator(G,ht.or),children:"OR"})]},"filterOperator".concat(M));N.push(Ge)}},E=0;E<u.length;E+=1)A(E);var O=this.shouldShowAddFilter(),D=s.jsxs("div",{className:Y("form-row justify-content-end add-filter-item",{hidden:!O}),children:[s.jsx("span",{className:"text-muted",children:s.jsx(Z,{icon:Ri})}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddAnd,disabled:!O,tooltip:"Add filter with AND",children:"AND"}),s.jsx(W,{kind:"ghost",className:"btn-filter-item",onClick:this.handleAddOr,disabled:!O,tooltip:"Add filter with OR",children:"OR"})]},"addFilterItem");return N.push(D),s.jsxs("div",{className:"advanced-filter-creator",role:"presentation",children:[s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapStart}),s.jsxs("form",{onSubmit:this.handleSubmit,ref:this.focusTrapContainer,children:[s.jsxs("div",{className:"title-bar",children:[s.jsx("h6",{className:"advanced-filter-title",children:"Advanced Filters"}),s.jsxs("div",{className:"advanced-filter-menu-buttons",children:[s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.descending}),onClick:this.handleSortDown,icon:mr,tooltip:m?"Sort ".concat(t.name," Descending"):"Not sortable",disabled:!m}),s.jsx(W,{kind:"ghost",className:Y("sort-operator",{active:n===T.sortDirection.ascending}),onClick:this.handleSortUp,icon:s.jsx(Z,{icon:mr,rotation:180}),tooltip:m?"Sort ".concat(t.name," Ascending"):"Not sortable",disabled:!m})]})]}),s.jsx("hr",{}),s.jsxs("div",{className:"advanced-filter-column-name",children:[t.name," ",s.jsxs("span",{className:"column-type",children:["(",g,")"]})]}),N,C&&p==null&&s.jsxs(s.Fragment,{children:[!v&&s.jsx("hr",{}),s.jsx("div",{className:"form-group",children:s.jsx(Lo,{dh:f,table:h,onChange:this.handleSelectValueChange,invertSelection:d,selectedValues:c,formatter:a,showSearch:!F,timeZone:a.timeZone})})]}),s.jsxs("div",{className:"form-row justify-content-end",children:[s.jsx(W,{kind:"secondary",className:"mr-2",onClick:this.handleReset,children:"Reset"}),s.jsx(W,{kind:"primary",onClick:this.handleDone,children:"Done"})]})]}),s.jsx("div",{tabIndex:0,onFocus:this.handleFocusTrapEnd})]})}}it(Ie,"debounceFilterUpdate",250);it(Ie,"defaultProps",{options:{filterItems:null,filterOperators:null,invertSelection:!0,selectedValues:[]},sortDirection:null});const ko=Ie;function Go(r,e){var t=Bo(r);if(t!==void 0){var i=Yo(r);return"".concat(i," ? ").concat(t," : ").concat(e)}}function Mo(r,e){return r.Column.formatRowColor(e)}function Vo(r,e){return r.formatColor(e)}var Tt=ce.module("ConditionalFormattingUtils"),Ce;(function(r){r.CONDITIONAL="conditional",r.ROWS="rows"})(Ce||(Ce={}));var P;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_BETWEEN="is-between",r.GREATER_THAN="greater-than",r.GREATER_THAN_OR_EQUAL="greater-than-or-equal",r.LESS_THAN="less-than",r.LESS_THAN_OR_EQUAL="less-than-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(P||(P={}));var B;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.CONTAINS="contains",r.DOES_NOT_CONTAIN="does-not-contain",r.STARTS_WITH="starts-with",r.ENDS_WITH="ends-with",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(B||(B={}));var k;(function(r){r.IS_EXACTLY="is-exactly",r.IS_NOT_EXACTLY="is-not-exactly",r.IS_BEFORE="is-before",r.IS_BEFORE_OR_EQUAL="is-before-or-equal",r.IS_AFTER="is-after",r.IS_AFTER_OR_EQUAL="is-after-or-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(k||(k={}));var ne;(function(r){r.IS_TRUE="is-true",r.IS_FALSE="is-false",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ne||(ne={}));var ee;(function(r){r.IS_EQUAL="is-equal",r.IS_NOT_EQUAL="is-not-equal",r.IS_NULL="is-null",r.IS_NOT_NULL="is-not-null"})(ee||(ee={}));var $;(function(r){r.NO_FORMATTING="no-formatting",r.POSITIVE="positive",r.NEGATIVE="negative",r.WARN="warn",r.NEUTRAL="neutral",r.ACCENT_1="accent-1",r.ACCENT_2="accent-2",r.CUSTOM="custom"})($||($={}));function yr(r){switch(r){case $.NO_FORMATTING:return"No formatting";case $.POSITIVE:return"Positive";case $.NEGATIVE:return"Negative";case $.WARN:return"Warn";case $.NEUTRAL:return"Neutral";case $.ACCENT_1:return"Accent 1";case $.ACCENT_2:return"Accent 2";case $.CUSTOM:return"Custom..."}}function Ut(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#9fde6f";case $.NEGATIVE:return"#ff6087";case $.WARN:return"#f67f40";case $.NEUTRAL:return"#ffd95c";case $.ACCENT_1:return"#78dce8";case $.ACCENT_2:return"#ab9bf5";case $.CUSTOM:return t?.background;default:return}}function jt(r){var{type:e,customConfig:t}=r;switch(e){case $.NO_FORMATTING:return;case $.POSITIVE:return"#526a3f";case $.NEGATIVE:return"#802f44";case $.WARN:return"#663318";case $.NEUTRAL:return"#63562b";case $.ACCENT_1:return"#3f6469";case $.ACCENT_2:return"#554d72";case $.CUSTOM:return t?.color;default:return}}function Bo(r){var e=jt(r.style),t=Ut(r.style);if(!(e===void 0||t===void 0))return"bgfg(`".concat(t,"`, `").concat(e,"`)")}function $o(r){var{column:e,value:t,start:i,end:n}=r;return as(e.name,r.condition,t,i,n)}function Qo(r){var{column:e,value:t}=r;return os(e.name,r.condition,t)}function Ho(r){var{column:e,value:t}=r;return ss(e.name,r.condition,t)}function Wo(r){var{column:e}=r;return ls(e.name,r.condition)}function Ko(r){var{column:e,value:t}=r;return us(e.name,r.condition,t)}function Yo(r){var{column:e}=r;if(T.isNumberType(e.type))return $o(r);if(T.isCharType(e.type))return Ko(r);if(T.isStringType(e.type))return Qo(r);if(T.isDateType(e.type))return Ho(r);if(T.isBooleanType(e.type))return Wo(r);throw new Error("Invalid column type")}function qo(r){switch(r){case P.IS_EQUAL:return"is equal to";case P.IS_NOT_EQUAL:return"is not equal to";case P.IS_BETWEEN:return"is between";case P.GREATER_THAN:return"greater than";case P.GREATER_THAN_OR_EQUAL:return"greater than or equal to";case P.LESS_THAN:return"less than";case P.LESS_THAN_OR_EQUAL:return"less than or equal to";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function zo(r){switch(r){case B.IS_EXACTLY:return"is exactly";case B.IS_NOT_EXACTLY:return"is not exactly";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function Xo(r){switch(r){case k.IS_EXACTLY:return"is";case k.IS_NOT_EXACTLY:return"is not";case k.IS_BEFORE:return"is before";case k.IS_BEFORE_OR_EQUAL:return"is before or equal";case k.IS_AFTER:return"is after";case k.IS_AFTER_OR_EQUAL:return"is after or equal";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function Zo(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function Jo(r){switch(r){case ee.IS_EQUAL:return"is";case ee.IS_NOT_EQUAL:return"is not";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function Xr(r){if(T.isNumberType(r))return P.IS_EQUAL;if(T.isCharType(r))return ee.IS_EQUAL;if(T.isStringType(r))return B.IS_EXACTLY;if(T.isDateType(r))return k.IS_EXACTLY;if(T.isBooleanType(r))return ne.IS_TRUE;throw new Error("Invalid column type")}function Zr(r){if(T.isCharType(r)||T.isStringType(r))return""}function Jr(r){var{condition:e,value:t,start:i,end:n}=r;return{condition:e,value:t,start:i,end:n}}function Mt(r){return{condition:Xr(r),value:Zr(r),start:void 0,end:void 0}}function en(){return{type:$.NO_FORMATTING}}function es(r){switch(r){case B.IS_EXACTLY:return"==";case B.IS_NOT_EXACTLY:return"!=";case B.CONTAINS:return"contains";case B.DOES_NOT_CONTAIN:return"does not contain";case B.STARTS_WITH:return"starts with";case B.ENDS_WITH:return"ends with";case B.IS_NULL:return"is null";case B.IS_NOT_NULL:return"is not null"}}function ts(r){switch(r){case k.IS_EXACTLY:return"==";case k.IS_NOT_EXACTLY:return"!=";case k.IS_BEFORE:return"<";case k.IS_BEFORE_OR_EQUAL:return"<=";case k.IS_AFTER:return">";case k.IS_AFTER_OR_EQUAL:return">=";case k.IS_NULL:return"is null";case k.IS_NOT_NULL:return"is not null"}}function is(r){switch(r){case ne.IS_TRUE:return"is true";case ne.IS_FALSE:return"is false";case ne.IS_NULL:return"is null";case ne.IS_NOT_NULL:return"is not null"}}function rs(r){switch(r){case ee.IS_EQUAL:return"==";case ee.IS_NOT_EQUAL:return"!=";case ee.IS_NULL:return"is null";case ee.IS_NOT_NULL:return"is not null"}}function ns(r){switch(r){case P.IS_EQUAL:return"==";case P.IS_NOT_EQUAL:return"!=";case P.IS_BETWEEN:return"==";case P.GREATER_THAN:return">";case P.GREATER_THAN_OR_EQUAL:return">=";case P.LESS_THAN:return"<";case P.LESS_THAN_OR_EQUAL:return"<=";case P.IS_NULL:return"is null";case P.IS_NOT_NULL:return"is not null"}}function as(r,e,t,i,n){switch(e){case P.IS_EQUAL:return"".concat(r," == ").concat(t);case P.IS_NOT_EQUAL:return"".concat(r," != ").concat(t);case P.IS_BETWEEN:return"".concat(r," > ").concat(i," && ").concat(r," < ").concat(n);case P.GREATER_THAN:return"".concat(r," > ").concat(t);case P.GREATER_THAN_OR_EQUAL:return"".concat(r," >= ").concat(t);case P.LESS_THAN:return"".concat(r," < ").concat(t);case P.LESS_THAN_OR_EQUAL:return"".concat(r," <= ").concat(t);case P.IS_NULL:return"".concat(r," == null");case P.IS_NOT_NULL:return"".concat(r," != null")}}function os(r,e,t){switch(e){case B.IS_EXACTLY:return"".concat(r,' == "').concat(t,'"');case B.IS_NOT_EXACTLY:return"".concat(r,' != "').concat(t,'"');case B.CONTAINS:return"".concat(r," != null && ").concat(r,'.contains("').concat(t,'")');case B.DOES_NOT_CONTAIN:return"".concat(r," != null && !").concat(r,'.contains("').concat(t,'")');case B.STARTS_WITH:return"".concat(r," != null && ").concat(r,'.startsWith("').concat(t,'")');case B.ENDS_WITH:return"".concat(r," != null && ").concat(r,'.endsWith("').concat(t,'")');case B.IS_NULL:return"".concat(r," == null");case B.IS_NOT_NULL:return"".concat(r," != null")}}function ss(r,e,t){switch(e){case k.IS_EXACTLY:return"".concat(r,' == convertDateTime("').concat(t,'")');case k.IS_NOT_EXACTLY:return"".concat(r," != convertDateTime(`").concat(t,"`)");case k.IS_BEFORE:return"".concat(r," < convertDateTime(`").concat(t,"`)");case k.IS_BEFORE_OR_EQUAL:return"".concat(r,' <= convertDateTime("').concat(t,'")');case k.IS_AFTER:return"".concat(r," > convertDateTime(`").concat(t,"`)");case k.IS_AFTER_OR_EQUAL:return"".concat(r," >= convertDateTime(`").concat(t,"`)");case k.IS_NULL:return"".concat(r," == null");case k.IS_NOT_NULL:return"".concat(r," != null")}}function ls(r,e){switch(e){case ne.IS_TRUE:return"".concat(r," == true");case ne.IS_FALSE:return"".concat(r," == false");case ne.IS_NULL:return"".concat(r," == null");case ne.IS_NOT_NULL:return"".concat(r," != null")}}function us(r,e,t){switch(e){case ee.IS_EQUAL:return"".concat(r," == '").concat(t,"'");case ee.IS_NOT_EQUAL:return"".concat(r," != '").concat(t,"'");case ee.IS_NULL:return"isNull(".concat(r,")");case ee.IS_NOT_NULL:return"!isNull(".concat(r,")")}}function ds(r,e){if(T.isNumberType(r))return ns(e);if(T.isCharType(r))return rs(e);if(T.isStringType(r))return es(e);if(T.isDateType(r))return ts(e);if(T.isBooleanType(r))return is(e);throw new Error("Invalid column type")}function cs(r,e,t){if(t===void 0)return Tt.debug("no rules passed."),[];var i=[],n,a=new Map;return t.forEach(o=>{var u,{config:l,type:d}=o,{column:c}=l,h=e.find(F=>{var{name:w,type:g}=F;return w===c.name&&g===c.type});if(h===void 0){Tt.debug("Column ".concat(c.name,":").concat(c.type," not found. Ignoring format rule."),l);return}var[p,m]=(u=d===Ce.CONDITIONAL?a.get(h.name):n)!==null&&u!==void 0?u:["null",void 0],f=Go(l,p);if(f===void 0){Tt.debug("Ignoring format rule.",l);return}var C=m===void 0?-1:i.indexOf(m);C>-1&&i.splice(C,1);var v=d===Ce.CONDITIONAL?Vo(h,f):Mo(r,f);i.push(v),d===Ce.CONDITIONAL?a.set(h.name,[f,v]):n=[f,v]}),i}function hs(r,e,t){switch(e){case k.IS_NULL:case k.IS_NOT_NULL:return!0;default:{var[i,...n]=(t??"").split(" "),a=n.join(" ");try{Di.parseDateTimeString(i)}catch{return Tt.debug("Invalid datetime string",i),!1}try{r.i18n.TimeZone.getTimeZone(a)}catch{return Tt.debug("Invalid timezone string",a),!1}return!0}}}function ms(r){var{type:e}=r;return T.isNumberType(e)||T.isCharType(e)||T.isStringType(e)||T.isDateType(e)||T.isBooleanType(e)}function Vt(r){var{animation:e="iris-grid-bottom-bar-slide-up",children:t,className:i,isShown:n,onClick:a,onEntering:o,onEntered:u,onExiting:l,onExited:d}=r;return s.jsx(Ei,{in:n,timeout:yi.transitionMs,classNames:e,onEntering:o,onEntered:u,onExiting:l,onExited:d,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:Y("iris-grid-bottom-bar",i),role:"presentation",onClick:a,onKeyPress:a,children:t})})}var ps=3e3,vs=5;function gs(r){var{isSaving:e=!1,onSave:t,onDiscard:i,discardTooltip:n,saveTooltip:a,error:o,pendingDataErrors:u,pendingDataMap:l,onEntering:d,onEntered:c,onExiting:h,onExited:p}=r,[m,f]=y.useState(!1),[C,v]=y.useState(!1),F=y.useRef(),w=Hr(e),g=y.useMemo(()=>u.size===0?o:u.size<=vs?"Key can't be empty (on pending row".concat(u.size>1?"s":""," ").concat(Array.from(u.keys()).join(", ").trim(),")"):"Key can't be empty (on ".concat(u.size," rows)"),[o,u]);y.useEffect(function(){w!=null&&w&&!e&&g==null&&(f(!0),v(!0),F.current=setTimeout(()=>{f(!1)},ps))},[g,e,w]),y.useEffect(function(){F.current&&l.size>0&&(clearTimeout(F.current),f(!1),v(!1))},[l]),y.useEffect(function(){return()=>F.current?clearTimeout(F.current):void 0},[]);var N=l.size,A;return e?A=s.jsx(kt,{className:"loading-spinner-vertical-align"}):C&&(A=la),s.jsxs(Vt,{className:"pending-data-bottom-bar",isShown:N>0||m||g!=null,onEntering:d,onEntered:c,onExiting:h,onExited:()=>{v(!1),p&&p()},children:[g!=null&&g!==""&&s.jsxs("div",{className:"error-message",children:[s.jsx(Z,{icon:sa}),s.jsx("span",{children:"".concat(g)})]}),(g==null||g==="")&&s.jsx("div",{className:"status-message",children:N>0&&s.jsx("span",{children:"".concat(N," row").concat(N>1?"s":""," pending")})}),s.jsxs("div",{className:"buttons-container",children:[!e&&!C&&s.jsx(W,{kind:"secondary",onClick:i,tooltip:n,children:"Discard"}),s.jsxs(W,{kind:C?"success":"primary",onClick:t,icon:A,disabled:e||C||g!=null,tooltip:a,children:[e&&"Committing...",!e&&C&&"Success",!e&&!C&&"Commit"]})]})]})}function wr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function pi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){wr(a,i,n,o,u,"next",l)}function u(l){wr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Qe(r,e,t){return e=fs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fs(r){var e=Cs(r,"string");return typeof e=="symbol"?e:String(e)}function Cs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var me=ce.module("IrisGridCopyHandler");function Ss(r){return r.ranges!=null}function Ts(r){return r.columnIndex!=null}class V extends y.Component{static getStatusMessageText(e,t){switch(e){case V.COPY_STATES.CONFIRMATION_REQUIRED:return"Are you sure you want to copy ".concat(t.toLocaleString()," rows to your clipboard?");case V.COPY_STATES.CLICK_REQUIRED:return"Fetched ".concat(t.toLocaleString()," rows!");case V.COPY_STATES.FETCH_ERROR:return"Unable to copy data.";case V.COPY_STATES.FETCH_RANGES_IN_PROGRESS:return"Fetching ".concat(t.toLocaleString()," rows for clipboard...");case V.COPY_STATES.FETCH_HEADER_IN_PROGRESS:return"Fetching header for clipboard...";case V.COPY_STATES.DONE:return"Copied to Clipboard!";default:return""}}static getCopyButtonText(e){switch(e){case V.BUTTON_STATES.FETCH_IN_PROGRESS:return"Fetching";case V.BUTTON_STATES.CLICK_TO_COPY:return"Click to Copy";case V.BUTTON_STATES.RETRY:return"Retry";default:return"Copy"}}constructor(e){super(e),Qe(this,"textData",void 0),Qe(this,"hideTimer",void 0),Qe(this,"fetchPromise",void 0),this.handleBackgroundClick=this.handleBackgroundClick.bind(this),this.handleCancelClick=this.handleCancelClick.bind(this),this.handleCopyClick=this.handleCopyClick.bind(this),this.handleHideTimeout=this.handleHideTimeout.bind(this),this.state={error:void 0,copyState:V.COPY_STATES.IDLE,buttonState:V.BUTTON_STATES.COPY,isShown:!1,rowCount:0}}componentDidMount(){var{copyOperation:e}=this.props;e!=null&&this.startCopy()}componentDidUpdate(e){var{copyOperation:t}=this.props;e.copyOperation!==t&&this.startCopy()}componentWillUnmount(){this.stopCopy()}startCopy(){me.debug2("startCopy"),this.stopCopy();var{copyOperation:e}=this.props;if(e==null){me.debug2("No copy operation set, cancelling out"),this.setState({isShown:!1});return}var{error:t}=e;if(t!=null){me.debug("Showing copy error",t),this.setState({isShown:!0,copyState:V.COPY_STATES.DONE,error:t}),this.startHideTimer();return}if(this.setState({isShown:!0,error:void 0}),Ss(e)){var{ranges:i}=e,n=Fe.rowCount(i);if(this.setState({rowCount:n}),n>V.NO_PROMPT_THRESHOLD){this.setState({buttonState:V.BUTTON_STATES.COPY,copyState:V.COPY_STATES.CONFIRMATION_REQUIRED});return}}this.startFetch()}stopCopy(){this.textData=void 0,this.stopFetch(),this.stopHideTimer()}handleBackgroundClick(){me.debug2("handleBackgroundClick");var{copyState:e}=this.state;e===V.COPY_STATES.DONE&&this.setState({isShown:!1})}handleCancelClick(){me.debug2("handleCancelClick"),this.stopFetch(),this.setState({isShown:!1})}handleCopyClick(){var e=this;return pi(function*(){if(me.debug2("handleCopyClick"),e.textData!=null)try{yield e.copyText(e.textData),e.showCopyDone()}catch(t){me.error("Error copying text",t),e.setState({error:"Unable to copy. Verify your browser permissions."})}else e.startFetch()})()}handleHideTimeout(){me.debug2("handleHideTimeout"),this.stopHideTimer(),this.setState({isShown:!1})}copyText(e){var t=this;return pi(function*(){me.debug2("copyText",e),t.textData=e,yield Ii(e)})()}showCopyDone(){this.setState({copyState:V.COPY_STATES.DONE}),this.startHideTimer()}startFetch(){var e=this;return pi(function*(){e.stopFetch();var{model:t,copyOperation:i}=e.props;if(Ts(i)){var{columnIndex:n,columnDepth:a,movedColumns:o}=i;me.debug("startFetch copyHeader",n,a),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_HEADER_IN_PROGRESS});var u=ge.getModelIndex(n,o),l=t.textForColumnHeader(u,a);if(l===void 0){e.fetchPromise=void 0,e.setState({error:"Invalid column header selected.",copyState:V.COPY_STATES.DONE});return}e.fetchPromise=Oe.makeCancelable(l)}else{var{ranges:d,includeHeaders:c,userColumnWidths:h,movedColumns:p,formatValues:m}=i;me.debug("startFetch copyRanges",d),e.setState({buttonState:V.BUTTON_STATES.FETCH_IN_PROGRESS,copyState:V.COPY_STATES.FETCH_RANGES_IN_PROGRESS});var f=ie.getHiddenColumns(h),C=ge.getModelRanges(d,p);if(f.length>0){var v=f.map(Fe.makeColumn);C=Fe.subtractRangesFromRanges(C,v)}var F=m!=null&&m?(g,N)=>t.displayString(g,N.type,N.name):g=>"".concat(g);e.fetchPromise=Oe.makeCancelable(t.textSnapshot(C,c,F))}try{var w=yield e.fetchPromise;e.fetchPromise=void 0;try{yield e.copyText(w),e.showCopyDone()}catch(g){me.error("Error copying text",g),e.setState({buttonState:V.BUTTON_STATES.CLICK_TO_COPY,copyState:V.COPY_STATES.CLICK_REQUIRED})}}catch(g){g instanceof Qa?me.debug("User cancelled copy."):(me.error("Error fetching contents",g),e.fetchPromise=void 0,e.setState({buttonState:V.BUTTON_STATES.RETRY,copyState:V.COPY_STATES.FETCH_ERROR}))}})()}stopFetch(){this.fetchPromise&&(me.debug2("stopFetch"),this.fetchPromise.cancel(),this.fetchPromise=void 0)}startHideTimer(){this.stopHideTimer(),this.hideTimer=setTimeout(this.handleHideTimeout,V.HIDE_TIMEOUT)}stopHideTimer(){this.hideTimer!=null&&(clearTimeout(this.hideTimer),this.hideTimer=void 0)}render(){var{onEntering:e,onEntered:t,onExiting:i,onExited:n}=this.props,{buttonState:a,copyState:o,isShown:u,rowCount:l,error:d}=this.state,c=o===V.COPY_STATES.DONE?"fade":"copy-slide-up",h=V.getCopyButtonText(a),p=d??V.getStatusMessageText(o,l),m=o!==V.COPY_STATES.DONE,f=a===V.BUTTON_STATES.FETCH_IN_PROGRESS,C=o===V.COPY_STATES.DONE;return s.jsxs(Vt,{animation:c,isShown:u,className:Y("iris-grid-copy-handler",{"copy-done":C}),onClick:this.handleBackgroundClick,onEntering:e,onEntered:t,onExiting:i,onExited:n,children:[s.jsx("div",{className:"status-message",children:s.jsx("span",{children:p})}),s.jsx(xi,{in:m,mountOnEnter:!0,unmountOnExit:!0,children:s.jsxs("div",{className:"buttons-container",children:[s.jsx("button",{type:"button",className:"btn btn-outline-secondary btn-cancel",onClick:this.handleCancelClick,children:"Cancel"}),s.jsxs(W,{kind:f?"tertiary":"primary",className:Y("btn-copy",{"btn-spinner":f}),onClick:this.handleCopyClick,disabled:f,children:[f&&s.jsx(kt,{className:"loading-spinner-vertical-align"}),h]})]})})]})}}Qe(V,"NO_PROMPT_THRESHOLD",1e4);Qe(V,"HIDE_TIMEOUT",3e3);Qe(V,"COPY_STATES",{IDLE:"IDLE",CONFIRMATION_REQUIRED:"CONFIRMATION_REQUIRED",FETCH_RANGES_IN_PROGRESS:"FETCH_RANGES_IN_PROGRESS",FETCH_HEADER_IN_PROGRESS:"FETCH_HEADER_IN_PROGRESS",FETCH_ERROR:"FETCH_ERROR",CLICK_REQUIRED:"CLICK_REQUIRED",DONE:"DONE"});Qe(V,"BUTTON_STATES",{COPY:"COPY",FETCH_IN_PROGRESS:"FETCH_IN_PROGRESS",CLICK_TO_COPY:"CLICK_TO_COPY",RETRY:"RETRY"});Qe(V,"defaultProps",{copyOperation:null,onEntering:()=>{},onEntered:()=>{},onExiting:()=>{},onExited:()=>{}});const bs=V;function It(r,e,t){return e=Es(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Es(r){var e=ys(r,"string");return typeof e=="symbol"?e:String(e)}function ys(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class tn extends y.PureComponent{constructor(e){super(e),It(this,"inputField",void 0),It(this,"initialValue",void 0),It(this,"debouncedSendUpdate",void 0);var{debounceMs:t}=e;this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t),this.handleCancel=this.handleCancel.bind(this),this.handleChange=this.handleChange.bind(this),this.handleCommit=this.handleCommit.bind(this),this.handleFocus=this.handleFocus.bind(this),this.handleBlur=this.handleBlur.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleContextMenu=this.handleContextMenu.bind(this),this.inputField=null;var{value:i}=e;this.initialValue=i,this.state={isChanged:!1,value:i}}componentDidMount(){var e;(e=this.inputField)===null||e===void 0||e.focus()}componentDidUpdate(e){var{debounceMs:t}=this.props;e.debounceMs!==t&&(this.debouncedSendUpdate.flush(),this.debouncedSendUpdate=rt(this.sendUpdate.bind(this),t))}componentWillUnmount(){this.debouncedSendUpdate.cancel()}setValue(e){this.initialValue=e,this.setState({value:e})}focus(){var e;(e=this.inputField)===null||e===void 0||e.focus()}handleChange(e){var{value:t}=e.target;this.setState({value:t,isChanged:!0}),this.debouncedSendUpdate(t)}handleCancel(){this.debouncedSendUpdate.cancel();var{initialValue:e}=this,{isChanged:t}=this.state;t&&this.sendUpdate(e);var{onDone:i}=this.props;i()}handleCommit(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;this.debouncedSendUpdate.flush();var{onDone:i}=this.props;i(e,t)}handleFocus(){var e;(e=this.inputField)===null||e===void 0||e.select()}handleBlur(e){var{relatedTarget:t}=e;t!=null&&t.classList.contains("context-menu-container")?this.handleCommit(!1,!0):t!=null&&t.classList.contains("advanced-filter-button")?this.handleCommit(!1,!1):this.handleCommit(!0,!0)}handleTab(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;this.debouncedSendUpdate.flush();var{onTab:t}=this.props;t(e)}handleKeyDown(e){switch(e.key){case"Escape":e.stopPropagation(),e.preventDefault(),this.handleCancel();break;case"Enter":e.stopPropagation(),e.preventDefault(),this.handleCommit();break;case"Tab":e.stopPropagation(),e.preventDefault(),this.handleTab(e.shiftKey);break}}handleContextMenu(e){var{onContextMenu:t}=this.props;t(e)}sendUpdate(e){var{onChange:t}=this.props;t(e)}render(){var{className:e,style:t,isAdvancedFilterSet:i,onAdvancedFiltersTriggered:n}=this.props,{value:a}=this.state;return s.jsxs("div",{style:t,className:"iris-grid-input-autosized-wrapper","data-value":a,children:[s.jsx("input",{ref:o=>{this.inputField=o},className:Y("iris-grid-input-field",e),type:"text",value:a,onBlur:this.handleBlur,onFocus:this.handleFocus,onChange:this.handleChange,onKeyDown:this.handleKeyDown,onContextMenu:this.handleContextMenu,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"}),s.jsx("div",{className:"advanced-filter-button-container",children:s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":i}),onClick:n,onContextMenu:this.handleContextMenu,children:s.jsxs("div",{className:"fa-layers ",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})})]})}}It(tn,"defaultProps",{style:{},className:"",value:"",isAdvancedFilterSet:!1,onAdvancedFiltersTriggered:()=>{},onChange:()=>{},onDone:()=>{},onTab:()=>{},onContextMenu:()=>{},debounceMs:150});const ws=tn;function Fs(r,e,t){return e=Ns(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ns(r){var e=Os(r,"string");return typeof e=="symbol"?e:String(e)}function Os(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class As extends Gt{constructor(e){super(),Fs(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onDown(e,t){if(e.altKey&&!Ae.isModifierKeyDown(e)&&!e.shiftKey){var{mouseX:i,mouseY:n}=t.state;if(i==null||n==null)return!1;var a=t.getGridPointFromXY(i,n);if(a.column!=null&&a.row!=null)return this.cursor=this.irisGrid.props.copyCursor,!0}return!1}onUp(e,t){return this.cursor===this.irisGrid.props.copyCursor?(this.cursor=null,!0):!1}}const Rs=As;function _s(r,e,t){return e=xs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function xs(r){var e=Ds(r,"string");return typeof e=="symbol"?e:String(e)}function Ds(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Is extends Gt{constructor(e){super(),_s(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{selectedRanges:t}=this.irisGrid.state;return e.key==="c"&&Ae.isModifierKeyDown(e)?(ie.isValidSnapshotRanges(t)?this.irisGrid.copyRanges(t):this.irisGrid.copyRanges(t,!1,!1,"Invalid copy ranges"),!0):!1}}const Ps=Is;function Ls(r,e,t){return e=Us(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Us(r){var e=js(r,"string");return typeof e=="symbol"?e:String(e)}function js(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class ks extends Gt{constructor(e){super(),Ls(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){if(Ne.TABLE.REVERSE.matchesEvent(e)){if(!this.irisGrid.isReversible())return!1;var{reverseType:t}=this.irisGrid.state;return t===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE),!0}return!1}}const Gs=ks;function Ms(r,e,t){return e=Vs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Vs(r){var e=Bs(r,"string");return typeof e=="symbol"?e:String(e)}function Bs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class $s extends Gt{constructor(e){super(),Ms(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){return Ne.TABLE.CLEAR_FILTERS.matchesEvent(e)?(this.irisGrid.clearAllFilters(),!0):!1}}const Qs=$s;function Hs(r,e,t){return e=Ws(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ws(r){var e=Ks(r,"string");return typeof e=="symbol"?e:String(e)}function Ks(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ys extends Re{constructor(e){super(850),Hs(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:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:h}=d,{canvasContext:p}=u,m=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:h,theme:m},{left:C,top:v,width:F,height:w}=o.getCellOverflowButtonPosition(f);return C==null||F==null||v==null||w==null?null:{left:C,top:v,width:F,height:w}}isHoveringOverflowButton(e){var t,{x:i,y:n}=e,{left:a,top:o,width:u,height:l}=(t=this.getButtonPosition(e))!==null&&t!==void 0?t:{};if(a==null||u==null||o==null||l==null)return!1;var{renderer:d,grid:c,state:h,props:p}=this.irisGrid;if(!c)return!1;var{metrics:m}=h,{model:f}=p,{canvasContext:C}=c,v=c.getTheme(),F={context:C,mouseX:i,mouseY:n,metrics:m,model:f,theme:v};return d.shouldRenderOverflowButton(F)&&i>=a&&i<=a+u&&n>=o&&n<=o+l}onMove(e){if(this.isHoveringOverflowButton(e)){var{overflowButtonTooltipProps:t}=this.irisGrid.state,i=this.getButtonPosition(e);De(t,i)||this.irisGrid.setState({overflowButtonTooltipProps:i})}else this.destroyColumnTooltip();return this.setCursor(e)}onWheel(e){return this.destroyColumnTooltip(),this.onMove(e)}onDown(e){this.destroyColumnTooltip();var{column:t,row:i}=e;return this.isHoveringOverflowButton(e)&&this.irisGrid.setState({showOverflowModal:!0,overflowText:this.irisGrid.getValueForCell(t,i)}),!1}onContextMenu(){return this.destroyColumnTooltip(),!1}onLeave(){return this.destroyColumnTooltip(),!1}}const qs=Ys;function zs(r,e,t){return e=Xs(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Xs(r){var e=Zs(r,"string");return typeof e=="symbol"?e:String(e)}function Zs(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Js extends Re{constructor(e){super(),zs(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:t}=this.irisGrid.props;return t!=null?t(e):!0}updateColumnSelectionStatus(){var{columnSelectionValidator:e}=this.irisGrid.props;e?.(null)}getTableColumn(e){if(e==null)return null;var{model:t}=this.irisGrid.props,i=this.irisGrid.getModelColumn(e);return i==null?null:t.columns[i]}onMove(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,this.irisGrid.setState({hoverSelectColumn:null})),!0}onWheel(e){if(!this.isActive())return!1;var{columnAllowedCursor:t,columnNotAllowedCursor:i}=this.irisGrid.props,{column:n}=e,a=this.getTableColumn(n);return this.isValidColumn(a)?(this.cursor=t,this.irisGrid.setState({hoverSelectColumn:n})):(this.cursor=i,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:t}=e,i=this.getTableColumn(t);return i!=null&&this.isValidColumn(i)&&this.irisGrid.selectColumn(i),!0}}const el=Js;function tl(r,e,t){return e=il(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function il(r){var e=rl(r,"string");return typeof e=="symbol"?e:String(e)}function rl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class nl extends Re{constructor(e){super(),tl(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,t,i){var{relatedTarget:n}=i instanceof MouseEvent?i:i.nativeEvent,{tooltip:a}=this.irisGrid;if(!a)return!1;var o=a.popper.current;return o&&n instanceof Element&&o.element.contains(n)||this.hideColumnTooltip(),!1}onMove(e){var{column:t,row:i,columnHeaderDepth:n}=e,{shownColumnTooltip:a}=this.irisGrid.state,o=null;return t!==null&&i===null&&n===0&&(o=t),o!==a&&this.irisGrid.setState({shownColumnTooltip:o}),!1}}const al=nl;function rn(r,e,t){return e=ol(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ol(r){var e=sl(r,"string");return typeof e=="symbol"?e:String(e)}function sl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bt extends y.Component{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt.defaultProps;super(e),rn(this,"inputRef",void 0),this.handleInputChange=this.handleInputChange.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.inputRef=ke.createRef()}handleInputChange(){var{onChange:e}=this.props;this.inputRef.current&&e(this.inputRef.current.value)}closeContextMenu(){var{forwardedProps:e}=this.props,{closeMenu:t}=e;t(!0)}revertToDefault(){var{onChange:e}=this.props;e(null)}returnFocusToContextMenu(){var e=ua.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:t,placeholder:i,title:n}=this.props,{menuItem:{description:a},iconElement:o}=t;return s.jsxs("div",{className:"form-group flex-grow mb-0",children:[s.jsxs("div",{className:"custom-format-title",children:[s.jsx("span",{className:"icon",children:o}),s.jsxs("label",{className:"title mb-0",htmlFor:"custom-format-input",children:[n,a!=null&&s.jsx(Xe,{children:a})]})]}),s.jsx("div",{className:"pl-2 pr-2 pb-2",children:s.jsx("input",{id:"custom-format-input",className:"form-control text-right mb-0",type:"text",defaultValue:e,ref:this.inputRef,placeholder:i,onKeyDown:this.handleKeyDown,onChange:this.handleInputChange,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:"false"})})]})}}rn(Bt,"defaultProps",{formatString:"",forwardedProps:{menuItem:{},closeMenu(r){},iconElement:null},placeholder:"",title:"",onChange(r){}});const ll=Bt;class ul{static isDefaultSelected(e){return!e||![Dt.TYPE_CONTEXT_CUSTOM,Dt.TYPE_CONTEXT_PRESET].includes(e.type)}static isCustomSelected(e){return e!=null&&e.type===Dt.TYPE_CONTEXT_CUSTOM}static makeOption(e,t,i,n){return{title:e,description:e,group:i,format:t,isSelected:n}}static makeCustomFormatOption(e,t,i,n,a){var o;return{title:e.label,description:e.label,format:e,group:t,isSelected:n,menuElement:s.jsx(ll,{formatString:(o=e.formatString)!==null&&o!==void 0?o:void 0,title:e.label,placeholder:i,onChange:a})}}}const be=ul;function Li(r,e,t){return e=dl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dl(r){var e=cl(r,"string");return typeof e=="symbol"?e:String(e)}function cl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class fe{static getOptions(e,t){var i=new Date,n=[{group:fe.dateGroup,formatString:"yyyy-MM-dd"},{group:fe.dateGroup,formatString:"MM-dd-yyyy"},{group:fe.timeGroup,formatString:"HH:mm:ss"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSS"},{group:fe.timeGroup,formatString:"HH:mm:ss.SSSSSSSSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSS"},{group:fe.dateTimeGroup,formatString:"yyyy-MM-dd HH:mm:ss.SSSSSSSSS"}],a=n.map(u=>{var l=Ct.makeFormat("",u.formatString,Ct.TYPE_CONTEXT_PRESET),d=e.getFormattedString(i,T.dataType.DATETIME,"",l);return be.makeOption(d,l,u.group,Ct.isSameFormat(l,t))}),o=be.makeOption("Default",null,fe.dateGroup,be.isDefaultSelected(t));return[o,...a]}}Li(fe,"dateGroup",10);Li(fe,"timeGroup",20);Li(fe,"dateTimeGroup",30);const hl=fe;function $t(r,e,t){return e=ml(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ml(r){var e=pl(r,"string");return typeof e=="symbol"?e:String(e)}function pl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class pe{static getOptions(e,t,i){var n=[{format:we.FORMAT_PERCENT,group:pe.presetGroup},{format:we.FORMAT_BASIS_POINTS,group:pe.presetGroup},{format:we.FORMAT_MILLIONS,group:pe.presetGroup},{format:we.FORMAT_SCIENTIFIC_NOTATION,group:pe.presetGroup},{format:we.FORMAT_ROUND,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_TWO_DECIMALS,group:pe.presetRoundGroup},{format:we.FORMAT_ROUND_FOUR_DECIMALS,group:pe.presetRoundGroup}],a=be.makeOption("Default",null,pe.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,we.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:we.makeCustomFormat(),d=be.makeCustomFormatOption(l,pe.customGroup,we.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var h=we.makeCustomFormat(c);we.isValid(e,h)&&i(h)}else i(null)});return[a,...o,d]}}$t(pe,"defaultGroup",10);$t(pe,"presetGroup",20);$t(pe,"presetRoundGroup",30);$t(pe,"customGroup",40);const vl=pe;function Ui(r,e,t){return e=gl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function gl(r){var e=fl(r,"string");return typeof e=="symbol"?e:String(e)}function fl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class je{static getOptions(e,t,i){var n=[{format:Ke.FORMAT_MILLIONS,group:je.presetGroup},{format:Ke.FORMAT_SCIENTIFIC_NOTATION,group:je.presetGroup}],a=be.makeOption("Default",null,je.defaultGroup,be.isDefaultSelected(t)),o=n.map(c=>be.makeOption(c.format.label,c.format,c.group,Ke.isSameFormat(c.format,t))),u=be.isCustomSelected(t),l=u?t:Ke.makeCustomFormat(),d=be.makeCustomFormatOption(l,je.customGroup,Ke.DEFAULT_FORMAT_STRING,u,c=>{if(c!=null){var h=Ke.makeCustomFormat(c);Ke.isValid(e,h)&&i(h)}else i(null)});return[a,...o,d]}}Ui(je,"defaultGroup",10);Ui(je,"presetGroup",20);Ui(je,"customGroup",30);const Cl=je;function Fr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Nr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fr(Object(t),!0).forEach(function(i){Se(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Fr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Or(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function Sl(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Or(a,i,n,o,u,"next",l)}function u(l){Or(a,i,n,o,u,"throw",l)}o(void 0)})}}function Se(r,e,t){return e=Tl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Tl(r){var e=bl(r,"string");return typeof e=="symbol"?e:String(e)}function bl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ar=ce.module("IrisGridContextMenuHandler"),El=150,Rr="yyyy-MM-dd HH:mm:ss.SSSSSSSSS",vi=1e3;class b extends Re{static getQuickFilterCondition(e,t,i){return e&&i==="&&"?e.and(t):e&&i==="||"?e.or(t):t}static getQuickFilterText(e,t,i){return i&&e!=null?"".concat(e," ").concat(i," ").concat(t):t}static getOperatorAsText(e){return e==="&&"?"And":"Or"}static getRowOptionFormatted(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30;return"".concat(e,' "').concat(To.truncate(t,i-e.length-3),'"')}constructor(e,t){super(),Se(this,"irisGrid",void 0),Se(this,"debouncedUpdateCustomFormat",void 0),Se(this,"dh",void 0),this.getNumberValueEqualsFilter=this.getNumberValueEqualsFilter.bind(this),this.getFilterValueForNumberOrChar=this.getFilterValueForNumberOrChar.bind(this),this.debouncedUpdateCustomFormat=rt(e.handleFormatSelection,El),this.dh=t,this.irisGrid=e}componentWillUnmount(){this.debouncedUpdateCustomFormat.flush()}getHeaderActions(e,t){var{irisGrid:i}=this,{column:n}=t;L(n);var{model:a}=i.props,{columns:o}=a,u=o[e],l=[],{metrics:d,reverseType:c,quickFilters:h,advancedFilters:p,searchFilter:m}=i.state,f=i.getTheme();L(d);var{filterIconColor:C,filterBarActiveColor:v,contextMenuSortIconColor:F,contextMenuReverseIconColor:w}=f,g=a.sort,N=T.getSortForColumn(g,u.name),A=c!==T.REVERSE_TYPE.NONE,{userColumnWidths:E}=d,O=[...E.values()].some(M=>M===0),D=a.getColumnHeaderParentGroup(e,0)===void 0&&!($e(a)&&a.hasExpandableRows),x=a.isColumnFrozen(e),G=a.isColumnSortable(e);if(l.push({title:"Hide Column",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.hideColumnByVisibleIndex(n)}}),l.push({title:x?"Unfreeze Column":"Freeze Column",group:b.GROUP_HIDE_COLUMNS,disabled:!D,action:()=>{x?this.irisGrid.unFreezeColumnByColumnName(u.name):this.irisGrid.freezeColumnByColumnName(u.name)},order:10}),l.push({title:"Show All Columns",group:b.GROUP_HIDE_COLUMNS,action:()=>{this.irisGrid.showAllColumns()},disabled:!O}),l.push({title:"Quick Filters",icon:Ue,iconColor:v,shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER,group:b.GROUP_FILTER,order:10,action:()=>{this.irisGrid.toggleFilterBar(n)}}),l.push({title:"Advanced Filters",icon:p.get(e)?_i:Pt,iconColor:C,group:b.GROUP_FILTER,order:20,action:()=>{this.irisGrid.handleAdvancedMenuOpened(n)}}),l.push({title:"Clear Table Filters",group:b.GROUP_FILTER,order:40,shortcut:Ne.TABLE.CLEAR_FILTERS,action:()=>{this.irisGrid.clearAllFilters()},disabled:!(h.size>0||p.size>0||m!=null)}),l.push({title:"Sort by",icon:Ue,iconColor:F,group:b.GROUP_SORT,order:10,actions:this.sortByActions(u,e,N),disabled:!G}),l.push({title:"Add Additional Sort",disabled:N&&g.length===1||A&&g.length===1||N&&A&&g.length===2||g.length===0||!G,group:b.GROUP_SORT,order:20,actions:this.additionalSortActions(u,e)}),l.push({title:"Clear Table Sorting",disabled:g.length===0||A&&g.length===1,group:b.GROUP_SORT,action:()=>{this.irisGrid.sortColumn(n,b.COLUMN_SORT_DIRECTION.none)},order:30}),l.push({title:c===T.REVERSE_TYPE.NONE?"Reverse Table":"Clear Reverse Table",icon:Ue,iconColor:w,group:b.GROUP_SORT,order:40,disabled:!a.isReversible,shortcut:Ne.TABLE.REVERSE,action:()=>{c===T.REVERSE_TYPE.NONE?this.irisGrid.reverse(T.REVERSE_TYPE.POST_SORT):this.irisGrid.reverse(T.REVERSE_TYPE.NONE)}}),l.push({title:"Copy Column Name",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",action:()=>{var M;Ii((M=a.textForColumnHeader(e))!==null&&M!==void 0?M:"").catch(oe=>Ar.error("Unable to copy header",oe))}}),T.isDateType(u.type))l.push({title:"Date/Time Format",group:b.GROUP_FORMAT,actions:this.dateFormatActions(u)});else if(T.isNumberType(u.type)){var z;l.push({title:"Number Format",group:b.GROUP_FORMAT,actions:(z=this.numberFormatActions(u))!==null&&z!==void 0?z:void 0})}return l}getCellActions(e,t,i){var{irisGrid:n}=this,{column:a,row:o}=i,{model:u,canCopy:l}=n.props,{columns:d}=u,c=n.getModelRow(o);L(c);var h=u.sourceForCell(e,c),{column:p,row:m}=h,f=u.valueForCell(p,m),C=d[p],v=[],F=n.getTheme(),{filterIconColor:w}=F;if(C==null||o==null)return v;if($e(u)&&u.isRowExpandable(m)){var g=0,N=u.valueForCell(g,m),A=N==null?"null":u.textForCell(g,m);v.push({title:b.getRowOptionFormatted(u.isRowExpanded(m)?"Collapse":"Expand",A),group:b.GROUP_EXPAND_COLLAPSE,order:10,action:()=>{u.setRowExpanded(m,!u.isRowExpanded(m))}}),u.isExpandAllAvailable===!0&&v.push({title:b.getRowOptionFormatted("Expand All in",A),group:b.GROUP_EXPAND_COLLAPSE,order:20,action:()=>{u.setRowExpanded(m,!0,!0)}})}$e(u)&&u.hasExpandableRows&&u.isExpandAllAvailable===!0&&(v.push({title:"Expand Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:30,action:()=>{u.expandAll()}}),v.push({title:"Collapse Entire Table",group:b.GROUP_EXPAND_COLLAPSE,order:40,action:()=>{u.collapseAll()}}));var E={title:"Go to",iconColor:w,shortcut:Ne.TABLE.GOTO_ROW,group:b.GROUP_GOTO,order:10,action:()=>this.irisGrid.toggleGotoRow("".concat(o+1),"".concat(f),C.name)};return v.push(E),l&&(v.push({title:"Copy Cell",group:b.GROUP_COPY,shortcutText:Ae.isMacPlatform()?"⌥Click":"Alt+Click",order:10,action:()=>{n.copyCell(a,o)}}),v.push({title:"Copy Cell Unformatted",group:b.GROUP_COPY,order:20,action:()=>{n.copyCell(a,o,!0)}})),v.push({title:"View Cell Contents",group:b.GROUP_VIEW_CONTENTS,order:10,action:()=>{n.setState({showOverflowModal:!0,overflowText:n.getValueForCell(a,o)})}}),v}getCellFilterActions(e,t,i){var n=this;return Sl(function*(){var{dh:a,irisGrid:o}=n,{row:u}=i,{model:l}=o.props,{columns:d}=l,c=o.getModelRow(u),{getSelectedRanges:h}=t;L(c);var p=l.sourceForCell(e,c),{column:m,row:f}=p,C=d[m];if(C==null||u==null)return[];if(!l.isFilterable(m))return[];var{quickFilters:v}=o.state,F=o.getTheme(),{filterIconColor:w}=F,{settings:g}=o.props,N=[...h()];if(N.length===0&&N.push(new Fe(m,f,m,f)),Fe.containsCell(N,m,f))for(var A=Fe.rowCount(N);A>vi;){var E=N.pop();L(E,"Selected ranges should not be empty");var O=Fe.rowCount([E]);if(da(O,"Selected ranges should not be unbounded"),A-O<vi){var D;N.push(new Fe(E.startColumn,E.startRow,E.endColumn,((D=E.endRow)!==null&&D!==void 0?D:0)-(A-vi)));break}A-=O}else N=[new Fe(m,f,m,f)];ca(N);for(var x=yield l.snapshot(N),G=new Set,z=0;z<x.length;z+=1)x[z].length===1?x[z][0]!=null&&G.add(x[z][0]):x[z][m]!=null&&G.add(x[z][m]);var M={title:"Filter by Value".concat(G.size>1?"s":""),icon:Ue,iconColor:w,group:b.GROUP_FILTER,order:10,actions:[]};if(G.size===0)v.get(m)&&M.actions.push({title:"And",actions:n.nullFilterActions(C,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.nullFilterActions(C));else if(G.size===1&&G.has(""))v.get(m)&&M.actions.push({title:"And",actions:n.emptyStringFilterActions(C,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.emptyStringFilterActions(C));else if(T.isBooleanType(C.type))v.get(m)&&M.actions.push({title:"Or",actions:n.booleanFilterActions(C,l.textForCell(m,f),v.get(m),"||"),order:2,group:U.groups.high}),M.actions.push(...n.booleanFilterActions(C,l.textForCell(m,f)));else if(T.isNumberType(C.type)||T.isCharType(C.type))L(m),v.get(m)&&M.actions.push({title:"And",actions:n.numberFilterActions(C,G,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.numberFilterActions(C,G,v.get(m)));else if(T.isDateType(C.type)){var oe=new Ct(a,{timeZone:g?.timeZone,showTimeZone:!1,showTSeparator:!0,defaultDateTimeFormatString:Rr}),X=new Ct(a,{timeZone:g?.timeZone,showTimeZone:g?.showTimeZone,showTSeparator:g?.showTSeparator,defaultDateTimeFormatString:Rr});v.get(m)&&M.actions.push({title:"And",actions:n.dateFilterActions(C,G,oe,X,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.dateFilterActions(C,G,oe,X,v.get(m)))}else v.get(m)&&M.actions.push({title:"And",actions:n.stringFilterActions(C,G,v.get(m),"&&"),order:2,group:U.groups.high}),M.actions.push(...n.stringFilterActions(C,G));return[M]})()}getNumberValueEqualsFilter(e,t){var{dh:i}=this,n=e.filter();if(t===Number.POSITIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.greaterThan(i.FilterValue.ofNumber(0)));if(t===Number.NEGATIVE_INFINITY)return i.FilterCondition.invoke("isInf",n).and(n.lessThan(i.FilterValue.ofNumber(0)));if(Number.isNaN(t))return i.FilterCondition.invoke("isNaN",n);var a=this.getFilterValueForNumberOrChar(e.type,t);return n.eq(a)}getFilterValueForNumberOrChar(e,t){var{dh:i}=this;return T.isCharType(e)?i.FilterValue.ofString(String.fromCharCode(t)):i.FilterValue.ofNumber(t)}onContextMenu(e,t,i){var{irisGrid:n}=this,{y:a,column:o,row:u,columnHeaderDepth:l}=e,d=n.getModelColumn(o),c=n.getModelRow(u),{model:h,canCopy:p}=n.props,{columns:m}=h,{metrics:f,isFilterBarShown:C,quickFilters:v,advancedFilters:F,selectedRanges:w}=n.state;L(f);var{columnHeaderHeight:g,gridY:N,columnHeaderMaxDepth:A}=f,E=[];if(d!=null&&c!=null){var O=h.sourceForCell(d,c??0),{column:D,row:x}=O,G=h.valueForCell(D,x),z=h.textForCell(D,x),M=m[D],{onContextMenu:oe}=n.props;M!=null&&E.push(...oe({model:h,value:G,valueText:z,column:M,rowIndex:u,columnIndex:o,modelRow:c,modelColumn:d}))}if(d!=null){var X=h.getClearFilterRange(d);X!=null&&X.length>0&&E.push({title:X[1]-X[0]>0?"Clear Group Filter":"Clear Column Filter",group:b.GROUP_FILTER,order:30,action:()=>{this.irisGrid.removeColumnFilter(X)},disabled:!Array.from(v.keys()).some(le=>le>=X[0]&&le<=X[1])&&!Array.from(F.keys()).some(le=>le>=X[0]&&le<=X[1])})}return(C?a<=N:a<=g*A&&l===0)?d!=null&&E.push(...this.getHeaderActions(d,e)):(d!=null&&c!=null&&(E.push(...this.getCellActions(d,t,e)),E.push(this.getCellFilterActions(d,t,e))),p&&w.length>0&&(E.push({title:"Copy Selection",shortcut:Ha.COPY,group:b.GROUP_COPY,order:30,action:()=>{n.copyRanges(w)}}),E.push({title:"Copy Selection w/ Headers",group:b.GROUP_COPY,order:40,action:()=>{n.copyRanges(w,!0)}})),Be(h)&&h.isEditable&&w.length>0&&E.push({title:"Delete Selected Rows",group:b.GROUP_EDIT,order:50,action:()=>{this.irisGrid.deleteRanges(w)}})),E.length===0?!1:(L(n.gridWrapper),U.triggerMenu(n.gridWrapper,i.clientX,i.clientY,E),!0)}dateFormatActions(e){for(var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,a=n.getColumnFormat(e.type,e.name),o=hl.getOptions(n,a),u=[],l=function(){var{description:h,format:p,group:m,isSelected:f,title:C}=o[d];u.push({title:C,description:h,icon:f?wi:void 0,group:m,order:d,action:()=>{var v=i.getColumnIndexByName(e.name);L(v),t.irisGrid.handleFormatSelection(v,p)}})},d=0;d<o.length;d+=1)l();return u}numberFormatActions(e){var t=this,{model:i}=this.irisGrid.props,{formatter:n}=i,{dh:a}=this,o=n.getColumnFormat(e.type,e.name),u,l=i.getColumnIndexByName(e.name);if(T.isDecimalType(e.type))u=vl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else if(T.isIntegerType(e.type))u=Cl.getOptions(a,o,p=>{L(l),this.debouncedUpdateCustomFormat(l,p)});else return Ar.error("Invalid column type in numberFormatActions"),null;for(var d=[],c=function(){var{format:m,isSelected:f}=u[h];d.push(Nr(Nr({},u[h]),{},{icon:f?wi:void 0,order:h,action:()=>{l===void 0&&m&&m.type===Dt.TYPE_CONTEXT_CUSTOM||(L(l),t.irisGrid.handleFormatSelection(l,m))}}))},h=0;h<u.length;h+=1)c();return d}stringFilterActions(e,t,i,n){var{dh:a}=this,o=Array.from(t.keys()),u=o.map(v=>a.FilterValue.ofString(v)),l=u.length===1?u[0]:"the selected values",d=i;d||(d={filter:null,text:null});var{filter:c,text:h}=d,p=[],{model:m}=this.irisGrid.props,f=m.getColumnIndexByName(e.name),C=v=>{var F;return(F=T.escapeQuickTextFilter(v))!==null&&F!==void 0?F:""};return L(f),p.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(o.slice(0,20).map(v=>'"'.concat(C(v),'"'))),o.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",o.length," values selected)"]})]}),order:1,group:U.groups.high}),p.push({title:"text is exactly",description:"Show only rows where ".concat(e.name," is ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(v=>e.filter().eq(v)).reduce((v,F)=>v.or(F)),n),b.getQuickFilterText(h,o.map(C).join(" || "),n))},order:10,group:U.groups.low}),p.push({title:"text is not exactly",description:"Show only rows where ".concat(e.name," is not ").concat(l," (case sensitive)"),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,u.map(v=>e.filter().notEq(v)).reduce((v,F)=>v.and(F)),n),b.getQuickFilterText(h,o.map(v=>"!=".concat(C(v))).join(" && "),n))},order:20,group:U.groups.low}),p.push({title:"text contains",description:"Show only rows where ".concat(e.name," contains ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().contains(v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"~".concat(C(v))).join(" || "),n))},order:30,group:U.groups.low}),p.push({title:"text does not contain",description:"Show only rows where ".concat(e.name," does not contain ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().or(u.map(v=>e.filter().contains(v).not()).reduce((v,F)=>v.and(F))),n),b.getQuickFilterText(h,o.map(v=>"!~".concat(C(v))).join(" && "),n))},order:40,group:U.groups.low}),p.push({title:"text starts with",description:"Show only rows where ".concat(e.name," starts with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().invoke("startsWith",v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"".concat(C(v),"*")).join(" || "),n))},order:50,group:U.groups.low}),p.push({title:"text ends with",description:"Show only rows where ".concat(e.name," ends with ").concat(l),action:()=>{this.irisGrid.setQuickFilter(f,b.getQuickFilterCondition(c,e.filter().isNull().not().and(u.map(v=>e.filter().invoke("endsWith",v)).reduce((v,F)=>v.or(F))),n),b.getQuickFilterText(h,o.map(v=>"*".concat(C(v))).join(" || "),n))},order:60,group:U.groups.low}),p}numberFilterActions(e,t,i,n){var a=Array.from(t.keys()),o=a.length===1?"".concat(a):"the selected values",u=g=>T.isCharType(e.type)?String.fromCharCode(g):"".concat(g),l=null,d=null;i&&(l=i.filter,d=i.text);var c=[],{model:h}=this.irisGrid.props,p=h.getColumnIndexByName(e.name);if(L(p),c.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",hi.join(a.slice(0,20).map(g=>'"'.concat(u(g),'"'))),a.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",a.length," values selected)"]})]}),order:1,group:U.groups.high}),c.push({title:"is equal to",description:"Show only rows where ".concat(e.name," is ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(g=>this.getNumberValueEqualsFilter(e,g)).reduce((g,N)=>g.or(N)),n),b.getQuickFilterText(d,a.map(g=>"=".concat(u(g))).join(" || "),n))},order:10,group:U.groups.low}),c.push({title:"is not equal to",description:"Show only rows where ".concat(e.name," is not ").concat(o),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,a.map(g=>this.getNumberValueEqualsFilter(e,g).not()).reduce((g,N)=>g.and(N)),n),b.getQuickFilterText(d,a.map(g=>"!=".concat(u(g))).join(" && "),n))},order:20,group:U.groups.low}),!t.has(Number.NaN)&&!t.has(Number.POSITIVE_INFINITY)&&!t.has(Number.NEGATIVE_INFINITY)&&!T.isCharType(e.type)){var m=a.reduce((g,N)=>g>N?g:N),f=a.reduce((g,N)=>g<N?g:N),C=this.getFilterValueForNumberOrChar(e.type,m),v=this.getFilterValueForNumberOrChar(e.type,f),F="".concat(C),w="".concat(v);c.push({title:"greater than",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThan(C),n),b.getQuickFilterText(d,">".concat(u(m)),n))},order:30,group:U.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(F),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().greaterThanOrEqualTo(C),n),b.getQuickFilterText(d,">=".concat(u(m)),n))},order:40,group:U.groups.low}),c.push({title:"less than",description:"Show only rows where ".concat(e.name," is less than ").concat(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThan(v),n),b.getQuickFilterText(d,"<".concat(u(f)),n))},order:50,group:U.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(w),action:()=>{this.irisGrid.setQuickFilter(p,b.getQuickFilterCondition(l,e.filter().lessThanOrEqualTo(v),n),b.getQuickFilterText(d,"<=".concat(u(f)),n))},order:60,group:U.groups.low})}return c}booleanFilterActions(e,t,i,n){var a=[],{model:o}=this.irisGrid.props,{filter:u,text:l}=i||{},d=o.getColumnIndexByName(e.name);return L(d),a.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[n?b.getOperatorAsText(n):""," ",'"',t??"null",'"']}),order:1,group:U.groups.high}),a.push({title:"true",description:"Show only rows where ".concat(e.name," is true"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isTrue(),n),b.getQuickFilterText(l,"true",n))},order:10,group:U.groups.low}),a.push({title:"false",description:"Show only rows where ".concat(e.name," is false"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isFalse(),n),b.getQuickFilterText(l,"false",n))},order:20,group:U.groups.low}),a.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull(),n),b.getQuickFilterText(l,"null",n))},order:30,group:U.groups.low}),a.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(d,b.getQuickFilterCondition(u,e.filter().isNull().not(),n),b.getQuickFilterText(l,"!null",n))},order:40,group:U.groups.low}),a}dateFilterActions(e,t,i,n,a,o){var{dh:u}=this,l=Array.from(t.keys()),d=l.map(D=>u.FilterValue.ofNumber(D)),c=d.length===1?n.format(l[0]):"the selected values",h=l.reduce((D,x)=>D>x?D:x),p=l.reduce((D,x)=>D<x?D:x),m=u.FilterValue.ofNumber(h),f=u.FilterValue.ofNumber(p),C=i.format(h),v=i.format(p),F=n.format(h),w=n.format(p),g=null,N=null;a&&(g=a.filter,N=a.text);var{model:A}=this.irisGrid.props,E=A.getColumnIndexByName(e.name);L(E);var O=[];return O.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[o?b.getOperatorAsText(o):""," ",hi.join(l.slice(0,20).map(D=>'"'.concat(n.format(D),'"'))),l.length>1&&s.jsxs("div",{className:"iris-grid-filter-menu-subtitle",children:["(",l.length," values selected)"]})]}),order:1,group:U.groups.high}),O.push({title:"date is",description:"Show only rows where ".concat(e.name," is ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,d.map(D=>e.filter().eq(D)).reduce((D,x)=>D.or(x)),o),b.getQuickFilterText(N,l.map(D=>"=".concat(i.format(D))).join(" || "),o))},order:10,group:U.groups.low}),O.push({title:"date is not",description:"Show only rows where ".concat(e.name," is not ").concat(c),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,d.map(D=>e.filter().notEq(D)).reduce((D,x)=>D.and(x)),o),b.getQuickFilterText(N,l.map(D=>"!=".concat(i.format(D))).join(" && "),o))},order:20,group:U.groups.low}),O.push({title:"date is before",description:"Show only rows where ".concat(e.name," is before ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().lessThan(f),o),b.getQuickFilterText(N,"<".concat(v),o))},order:30,group:U.groups.low}),O.push({title:"date is before or equal",description:"Show only rows where ".concat(e.name," is before or equal to ").concat(w),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().lessThanOrEqualTo(f),o),b.getQuickFilterText(N,"<=".concat(v),o))},order:40,group:U.groups.low}),O.push({title:"date is after",description:"Show only rows where ".concat(e.name," is greater than ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().greaterThan(m),o),b.getQuickFilterText(N,">".concat(C),o))},order:50,group:U.groups.low}),O.push({title:"date is after or equal",description:"Show only rows where ".concat(e.name," is after or equal to ").concat(F),action:()=>{this.irisGrid.setQuickFilter(E,b.getQuickFilterCondition(g,e.filter().greaterThanOrEqualTo(m),o),b.getQuickFilterText(N,">=".concat(C),o))},order:60,group:U.groups.low}),O}emptyStringFilterActions(e,t,i){var{dh:n}=this,a=n.FilterValue.ofString(""),o=t;o||(o={filter:null,text:null});var{filter:u,text:l}=o,d=[],{model:c}=this.irisGrid.props,h=c.getColumnIndexByName(e.name);return L(h),d.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"empty"})]}),order:1,group:U.groups.high}),d.push({title:"is empty string",description:"Show only rows where ".concat(e.name," is empty"),action:()=>{this.irisGrid.setQuickFilter(h,b.getQuickFilterCondition(u,e.filter().eq(a),i),b.getQuickFilterText(l,"=",i))},order:10,group:U.groups.low}),d.push({title:"is not empty string",description:"Show only rows where ".concat(e.name," is not empty"),action:()=>{this.irisGrid.setQuickFilter(h,b.getQuickFilterCondition(u,e.filter().notEq(a),i),b.getQuickFilterText(l,"!=",i))},order:20,group:U.groups.low}),d}nullFilterActions(e,t,i){var n=null,a=null;t&&(n=t.filter,a=t.text);var o=[],{model:u}=this.irisGrid.props,l=u.getColumnIndexByName(e.name);return L(l),o.push({menuElement:s.jsxs("div",{className:"iris-grid-filter-menu-item-value",children:[i?b.getOperatorAsText(i):""," ",s.jsx("i",{className:"text-muted",children:"null"})]}),order:1,group:U.groups.high}),o.push({title:"is null",description:"Show only rows where ".concat(e.name," is null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull(),i),b.getQuickFilterText(a,"null",i))},order:10,group:U.groups.low}),o.push({title:"is not null",description:"Show only rows where ".concat(e.name," is not null"),action:()=>{this.irisGrid.setQuickFilter(l,b.getQuickFilterCondition(n,e.filter().isNull().not(),i),b.getQuickFilterText(a,"!null",i))},order:20,group:U.groups.low}),o}sortByActions(e,t,i){var n=this.irisGrid.getTheme(),{contextMenuSortIconColor:a}=n,o=[{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending)?Ue:void 0,iconColor:a},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending)?Ue:void 0,iconColor:a},{title:"Remove Sort",order:50,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.none,!1,!0)},disabled:!i}];return T.isNumberType(e.type)&&(o.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.ascending,!0)?Ue:void 0,iconColor:a}),o.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0)},icon:this.checkColumnSort(i,b.COLUMN_SORT_DIRECTION.descending,!0)?Ue:void 0,iconColor:a})),o}additionalSortActions(e,t){var i=this.irisGrid.getTheme(),{contextMenuSortIconColor:n}=i,a=[{title:"Add Sort By",menuElement:s.jsxs("div",{className:"btn-context-menu menu-title",children:[s.jsx("span",{className:"icon",children:s.jsx(Z,{icon:Ue,style:{color:n??void 0}})}),s.jsx("span",{className:"title",children:"Add Additional Sort"}),s.jsx("span",{className:"shortcut",children:Ae.isMacPlatform()?"⌘Click":"Ctrl+Click"})]}),order:1},{title:"".concat(e.name," Ascending"),order:10,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!1,!0)}},{title:"".concat(e.name," Descending"),order:20,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!1,!0)}}];return T.isNumberType(e.type)&&(a.push({title:"ABS(".concat(e.name,") Ascending"),order:30,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.ascending,!0,!0)}}),a.push({title:"ABS(".concat(e.name,") Descending"),order:40,action:()=>{this.irisGrid.sortColumn(t,b.COLUMN_SORT_DIRECTION.descending,!0,!0)}})),a}checkColumnSort(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return e?e.direction===t&&e.isAbs===i:!1}}Se(b,"GROUP_EDIT",U.groups.high+10);Se(b,"GROUP_HIDE_COLUMNS",U.groups.high+25);Se(b,"GROUP_FILTER",U.groups.high+50);Se(b,"GROUP_EXPAND_COLLAPSE",U.groups.high+55);Se(b,"GROUP_GOTO",U.groups.high+60);Se(b,"GROUP_SORT",U.groups.high+75);Se(b,"GROUP_COPY",U.groups.high+100);Se(b,"GROUP_FORMAT",U.groups.high+150);Se(b,"GROUP_VIEW_CONTENTS",U.groups.high+175);Se(b,"COLUMN_SORT_DIRECTION",{ascending:"ASC",descending:"DESC",none:null});const yl=b;function wl(r,e,t){return e=Fl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Fl(r){var e=Nl(r,"string");return typeof e=="symbol"?e:String(e)}function Nl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Ol extends Re{constructor(e){super(250),wl(this,"irisGrid",void 0),this.irisGrid=e,this.cursor=null}onClick(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey?(this.cursor=null,e.columnHeaderDepth!==void 0?this.irisGrid.copyColumnHeader(e.column,e.columnHeaderDepth):this.irisGrid.copyRanges([Fe.makeCell(e.column,e.row)]),!0):!1}onMove(e,t,i){return i.altKey&&!Ae.isModifierKeyDown(i)&&!i.shiftKey&&e.column!=null&&(e.row!=null||e.columnHeaderDepth!=null)?(this.cursor=this.irisGrid.props.copyCursor,!0):!1}}const Al=Ol;function Rl(r,e,t){return e=_l(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function _l(r){var e=xl(r,"string");return typeof e=="symbol"?e:String(e)}function xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Dl extends Re{constructor(e){super(880),Rl(this,"irisGrid",void 0),this.irisGrid=e}onDoubleClick(e,t){var{column:i,row:n}=e;return n==null||i==null||this.irisGrid.selectData(i,n),!1}}const Il=Dl;function Pl(r,e,t){return e=Ll(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ll(r){var e=Ul(r,"string");return typeof e=="symbol"?e:String(e)}function Ul(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class jl extends Re{constructor(e){super(),Pl(this,"irisGrid",void 0),this.irisGrid=e}onDown(e){var{y:t,column:i,row:n}=e;if(i!==null&&n===null){var{isFilterBarShown:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme();if(a&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&t>l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight)return this.irisGrid.focusFilterBar(i),!0}return!1}onMove(e){var{y:t,column:i}=e,{isFilterBarShown:n,hoverAdvancedFilter:a,metrics:o}=this.irisGrid.state;if(!o)throw new Error("Metrics not set");var{columnHeaderMaxDepth:u}=o,l=this.irisGrid.getTheme(),d=null;return n&&l.columnHeaderHeight!=null&&l.filterBarHeight!=null&&i!==null&&t>=l.columnHeaderHeight*u&&t<=l.columnHeaderHeight*u+l.filterBarHeight&&(d=i),d!==a&&this.irisGrid.setState({hoverAdvancedFilter:d}),!1}onLeave(e){var{column:t}=e,{hoverAdvancedFilter:i}=this.irisGrid.state;return i!==null&&t!==i&&this.irisGrid.setState({hoverAdvancedFilter:null}),!1}}const kl=jl;function Gl(r,e,t){return e=Ml(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ml(r){var e=Vl(r,"string");return typeof e=="symbol"?e:String(e)}function Vl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Bl extends Re{constructor(e){super(750),Gl(this,"irisGrid",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({expandCellTooltipProps:null})}setCursor(e,t){return Sr.isInTreeBox(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}getButtonPosition(e){var{x:t,y:i,column:n,row:a}=e;if(n==null||a==null)return null;var{renderer:o,grid:u,state:l,props:d}=this.irisGrid;if(!u)return null;var{metrics:c}=l,{model:h}=d,{canvasContext:p}=u,m=u.getTheme(),f={context:p,mouseX:t,mouseY:i,metrics:c,model:h,theme:m},C=$e(h)?h.depthForRow(a):null,{left:v,top:F,width:w,height:g}=o.getExpandButtonPosition(f,C);return v==null||w==null||F==null||g==null?null:{left:v,top:F,width:w,height:g}}onMove(e,t){if(Sr.isInTreeBox(e,t)){var{expandCellTooltipProps:i}=this.irisGrid.state,{model:n}=this.irisGrid.props,a=this.getButtonPosition(e),{row:o}=e;L(o);var u=$e(n)&&n.isRowExpanded(o);De(i,a)||this.irisGrid.setState({expandCellTooltipProps:a,expandTooltipDisplayValue:u?"collapse":"expand"})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const $l=Bl;function _r(r,e,t){return e=Ql(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ql(r){var e=Hl(r,"string");return typeof e=="symbol"?e:String(e)}function Hl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Wl extends Re{constructor(e){super(),_r(this,"irisGrid",void 0),_r(this,"column",void 0),this.column=null,this.irisGrid=e}getColumnFromGridPoint(e){var{column:t,row:i,columnHeaderDepth:n}=e;return t!==null&&i===null&&n===0?t:null}onDown(e){return this.column=this.getColumnFromGridPoint(e),!1}onClick(e,t,i){var n=this.getColumnFromGridPoint(e);if(n!=null&&n===this.column){var a=Ae.isModifierKeyDown(i);return this.irisGrid.toggleSort(n,a),!0}return!1}}const Kl=Wl;class Yl extends Re{constructor(e){super(),this.irisGrid=e}onWheel(e,t,i){var{irisGrid:n}=this,{model:a}=n.props,{metrics:o,pendingRowCount:u}=n.state;L(o);var{bottom:l,rowCount:d,rowHeight:c}=o,{deltaY:h}=ge.getScrollDelta(i);return Be(a)&&a.isEditable&&l>=d-1&&h>0&&n.setState({pendingRowCount:u+Math.ceil(h/c)}),!1}}const ql=Yl;function xr(r,e,t){return e=zl(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function zl(r){var e=Xl(r,"string");return typeof e=="symbol"?e:String(e)}function Xl(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class Zl extends Re{constructor(e){super(),xr(this,"irisGrid",void 0),xr(this,"currentLinkBox",void 0),this.irisGrid=e}destroyTooltip(){this.irisGrid.setState({linkHoverTooltipProps:null})}isHoveringLink(e,t){var{column:i,row:n,x:a,y:o}=e,{renderer:u,metrics:l,props:d}=t,{model:c}=d;if(i==null||n==null||l==null)return this.currentLinkBox=void 0,!1;var{modelRows:h,modelColumns:p}=l,m=Fi(h,n),f=Fi(p,i),C=c.renderTypeForCell(f,m),v=u.getCellRenderer(C);if(!Fo(v))return!1;if(this.currentLinkBox!=null){var{x1:F,y1:w,x2:g,y2:N}=this.currentLinkBox;if(a>=F&&a<=g&&o>=w&&o<=N)return!0}for(var A=t.updateRenderState(),E=v.getTokenBoxesForVisibleCell(i,n,A),O=0;O<E.length;O+=1)if(gr(E[O].token)){var D=ge.translateTokenBox(E[O],l),{x1:x,x2:G,y1:z,y2:M}=D;if(a>=x&&a<=G&&o>=z&&o<=M)return this.currentLinkBox=D,!0}return this.currentLinkBox=void 0,!1}setCursor(e,t){return this.isHoveringLink(e,t)?(this.cursor="pointer",{stopPropagation:!1,preventDefault:!1}):(this.cursor=null,!1)}onMove(e,t){var i=this.isHoveringLink(e,t);if(i&&this.currentLinkBox!=null&&gr(this.currentLinkBox.token)){var{linkHoverTooltipProps:n}=this.irisGrid.state;if(this.currentLinkBox==null)return!1;var{x1:a,y1:o,x2:u,y2:l}=this.currentLinkBox,{href:d}=this.currentLinkBox.token,c=u-a,h=l-o,p={left:a,top:o+1,width:c,height:h};De(n,p)||this.irisGrid.setState({linkHoverTooltipProps:p,linkHoverDisplayValue:d})}else this.destroyTooltip();return this.setCursor(e,t)}onDown(){return this.destroyTooltip(),!1}onContextMenu(){return this.destroyTooltip(),!1}onWheel(){return this.destroyTooltip(),!1}onLeave(){return this.destroyTooltip(),!1}}const Jl=Zl;var eu=3e3;function tu(r){var{children:e=null,onEntering:t,onEntered:i,onExiting:n,onExited:a}=r,[o,u]=y.useState(!1),l=y.useRef(),d=Hr(e),c=y.useCallback(()=>{u(!0),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{u(!1)},eu)},[u,l]);return y.useEffect(()=>{d!==e&&e!=null&&c()},[e,d,u,c]),y.useEffect(()=>()=>l.current?clearTimeout(l.current):void 0,[]),s.jsx(Vt,{className:"toast-bottom-bar",isShown:o,onEntering:t,onEntered:i,onExiting:n,onExited:a,children:e})}var iu=1,nn=ke.memo(r=>{var{model:e,modelColumns:t,top:i,bottom:n,left:a,right:o,filter:u,formatter:l,reverseType:d=T.REVERSE_TYPE.NONE,sorts:c,customColumns:h,movedColumns:p,hiddenColumns:m,alwaysFetchColumns:f,rollupConfig:C=null,totalsConfig:v=null,selectDistinctColumns:F=de,pendingRowCount:w=0,pendingDataMap:g=Ve,frozenColumns:N,formatColumns:A,columnHeaderGroups:E,partitionConfig:O}=r,D=y.useMemo(()=>ie.getModelViewportColumns(t,a,o,p,m,f,iu),[t,a,o,p,m,f]);return y.useEffect(function(){e.filter=u},[e,u]),y.useEffect(function(){var G=[...c];d!==T.REVERSE_TYPE.NONE&&G.push(e.dh.Table.reverse()),e.sort=G},[e,c,d]),y.useEffect(function(){e.formatter=l},[e,l]),y.useEffect(function(){e.isCustomColumnsAvailable&&(e.customColumns=h)},[e,h]),y.useEffect(function(){e.isFormatColumnsAvailable&&(e.formatColumns=A)},[e,A]),y.useEffect(function(){e.setViewport(i,n,D)},[e,i,n,D]),y.useEffect(function(){e.isRollupAvailable&&(e.rollupConfig=C)},[e,e.isRollupAvailable,C]),y.useEffect(function(){e.isSelectDistinctAvailable&&(e.selectDistinctColumns=F)},[e,F]),y.useEffect(function(){e.isTotalsAvailable&&(e.totalsConfig=v)},[e,e.isTotalsAvailable,v]),y.useEffect(function(){e.pendingRowCount=w},[e,w]),y.useEffect(function(){e.pendingDataMap=g},[e,g]),y.useEffect(function(){N&&e.updateFrozenColumns(N)},[e,N]),y.useEffect(function(){e.columnHeaderGroups=E},[e,E]),y.useEffect(function(){O&&Ni(e)&&(e.partitionConfig=O)},[e,O]),null});nn.displayName="IrisGridModelUpdater";const ru=nn;function an(r,e,t){return e=nu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function nu(r){var e=au(r,"string");return typeof e=="symbol"?e:String(e)}function au(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var gi=ce.module("ColumnStatistics"),ou={SIZE:"Number of Rows"};class Et extends y.Component{static getStatsLabel(e){var t;return(t=ou[e])!==null&&t!==void 0?t:e.split(" ").map(i=>i[0].toUpperCase()+i.substr(1).toLowerCase()).join(" ")}constructor(e){super(e),an(this,"cancelablePromise",void 0),this.handleError=this.handleError.bind(this),this.handleGenerateStatistics=this.handleGenerateStatistics.bind(this),this.handleStatistics=this.handleStatistics.bind(this),this.cancelablePromise=null,this.state={error:null,loading:!1,statistics:null,numRows:0}}componentDidMount(){this.maybeGenerateStatistics()}componentWillUnmount(){this.cancelablePromise&&this.cancelablePromise.cancel()}maybeGenerateStatistics(){var{column:e,model:t}=this.props,i=t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount;this.setState({numRows:i}),!t.isColumnStatisticsAvailable||e.isProxy===!0?this.setState({loading:!1}):i<Et.AUTO_GENERATE_LIMIT&&this.handleGenerateStatistics()}handleGenerateStatistics(){this.setState({loading:!0});var{column:e,model:t}=this.props;this.cancelablePromise=Oe.makeCancelable(t.columnStatistics(e)),this.cancelablePromise.then(this.handleStatistics).catch(this.handleError)}handleStatistics(e){gi.debug("Received statistics",e);var{model:t,onStatistics:i}=this.props,n=[];e.statisticsMap.forEach((a,o)=>{n.push({operation:Et.getStatsLabel(o),value:a,type:e.getType(o)})}),e.uniqueValues.forEach((a,o)=>{n.push({operation:o,className:"column-statistics-unique-value",value:a,type:"long"})}),this.setState({loading:!1,statistics:n,numRows:t.rowCount-t.pendingRowCount-t.floatingBottomRowCount-t.floatingTopRowCount}),i()}handleError(e){if(e!=null&&Oe.isCanceled(e)){gi.debug("Called handleError on a cancelled promise result");return}gi.error("Error generating statistics",e),this.setState({error:e,loading:!1,statistics:null})}render(){var e,{column:t,model:i}=this.props,{error:n,loading:a,statistics:o,numRows:u}=this.state,l=!a&&n==null&&o==null&&i.isColumnStatisticsAvailable,d=[],c=t.type.substring(t.type.lastIndexOf(".")+1),h=t.description===null?null:t.description;if(o!=null)for(var p=0;p<o.length;p+=1){var{operation:m,className:f,value:C,type:v}=o[p],F=v?i.displayString(C,v):i.displayString(C,t.type,t.name),w=s.jsxs(ke.Fragment,{children:[s.jsx("div",{className:Y("column-statistic-operation",f),children:m}),s.jsx("div",{className:"column-statistic-value",children:F})]},m);d.push(w)}var g=$e(i)&&i.hasExpandableRows?"Expanded Rows":"Number of Rows",N=i.displayString(u,"long"),A=i.getColumnIndexByName(t.name);return s.jsxs("div",{className:"column-statistics",children:[s.jsxs("div",{className:"column-statistics-title",children:[(e=t.displayName)!==null&&e!==void 0?e:t.name,s.jsxs("span",{className:"column-statistics-type",children:[" (",c,")"]}),s.jsx(Wr,{className:"column-statistics-copy",tooltip:"Copy column name",copy:t.name})]}),h!=null&&s.jsx("div",{className:"column-statistics-description",children:h}),A!=null&&!i.isColumnSortable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:ha,className:"mr-1"}),"Not sortable"]}),A!=null&&!i.isColumnMovable(A)&&s.jsxs("div",{className:"column-statistics-status",children:[s.jsx(Z,{icon:i.isColumnFrozen(A)?ma:pa,className:"mr-1"}),i.isColumnFrozen(A)?"Frozen":"Not movable"]}),s.jsxs("div",{className:"column-statistics-grid",children:[o==null&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"column-statistic-operation",children:g}),s.jsx("div",{className:"column-statistic-value",children:N})]}),d]}),l&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,children:"Generate Stats"}),n!=null&&s.jsx("div",{className:"error-message",children:"".concat(n)}),o&&!a&&s.jsx(W,{kind:"ghost",className:"px-0",onClick:this.handleGenerateStatistics,icon:va,children:"Refresh"}),a&&s.jsxs("div",{className:"column-statistics-loading",children:[s.jsx(kt,{className:"loading-spinner-vertical-align"}),"Calculating Stats..."]})]})}}an(Et,"AUTO_GENERATE_LIMIT",1e5);const su=Et;function lu(r,e,t){return e=uu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function uu(r){var e=du(r,"string");return typeof e=="symbol"?e:String(e)}function du(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}class cu extends y.PureComponent{static createSearchFilter(e,t,i,n,a){var o=a?n.filter(d=>!i.includes(d.name)).map(d=>d.name):i;if(t&&o.length>0){var u=e.FilterValue.ofString(t),l=o.length===n.length?e.FilterCondition.search(u):e.FilterCondition.search(u,n.filter(d=>o.includes(d.name)).map(d=>d.filter()));return l}}constructor(e){super(e),lu(this,"searchField",void 0),this.handleSearchValueChange=this.handleSearchValueChange.bind(this),this.toggleColumn=this.toggleColumn.bind(this),this.selectAll=this.selectAll.bind(this),this.clear=this.clear.bind(this),this.selectNumbers=this.selectNumbers.bind(this),this.searchField=ke.createRef(),this.state={isConfigureColumnsShown:!1}}focus(){var e;(e=this.searchField.current)===null||e===void 0||e.focus()}handleSearchValueChange(e){var{onChange:t,selectedColumns:i,invertSelection:n}=this.props;t(e.target.value,i,n)}sendColumnChange(e,t){var{onChange:i,value:n}=this.props;i(n,e,t)}setInvertSelection(e){var{onChange:t,value:i}=this.props;t(i,[],e)}toggleColumn(e){var{selectedColumns:t,invertSelection:i}=this.props;if(t.includes(e))this.sendColumnChange(t.filter(a=>a!==e),i);else{var n=t.slice();n.push(e),this.sendColumnChange(n,i)}}selectAll(){this.setInvertSelection(!0)}clear(){this.setInvertSelection(!1)}selectNumbers(){var{columns:e}=this.props;this.sendColumnChange(e.filter(t=>T.isNumberType(t.type)).map(t=>t.name),!1)}render(){var{value:e,selectedColumns:t,invertSelection:i,columns:n}=this.props,{isConfigureColumnsShown:a}=this.state,o=t.length===0&&i===!0||t.length===n.length&&i===!1,u=t.length===0&&i===!1||t.length===n.length&&i===!0,l;return o?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:vr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:ga,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}):u?l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:fa,mask:ci,transform:"shrink-1 down-5 right-7"}),s.jsx(Z,{icon:pr,className:"text-danger",transform:"shrink-4 down-5 right-7"})]}):l=s.jsxs(s.Fragment,{children:[s.jsx(Z,{icon:vr,mask:ci,transform:"shrink-2 down-5 right-7"}),s.jsx(Z,{icon:Ca,className:"text-primary",transform:"shrink-4 down-5 right-7"})]}),s.jsxs("div",{className:"cross-column-container",children:[s.jsx(Wa,{className:"cross-column-search",placeholder:"Search Data...","data-testid":"cross-column-search",value:e,onChange:this.handleSearchValueChange,ref:this.searchField}),s.jsxs("button",{type:"button",className:"btn btn-link btn-link-icon px-2",onClick:()=>{a?this.setState({isConfigureColumnsShown:!1}):this.setState({isConfigureColumnsShown:!0})},children:[s.jsx("div",{className:"fa-layers",children:l}),s.jsx(Xe,{children:"Configure Columns"}),s.jsx(Kr,{isShown:a,className:"cross-column-popper",onExited:()=>{this.setState({isConfigureColumnsShown:!1})},closeOnBlur:!0,interactive:!0,children:s.jsxs("div",{className:"cross-column-popup",children:["Searched Columns",s.jsx("div",{className:"cross-column-scroll",children:n.map(d=>d.isProxy===!0?null:s.jsxs(ke.Fragment,{children:[s.jsx(Ka,{className:"cross-column-checkbox",checked:i?!t.includes(d.name):t.includes(d.name),onChange:()=>this.toggleColumn(d.name),children:d.name}),d.type.substring(d.type.lastIndexOf(".")+1)]},d.name))}),s.jsxs("div",{className:"cross-column-button-bar",children:[s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectAll,children:"Select All"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.clear,children:"Clear"}),s.jsx("button",{type:"button",className:"btn btn-link",onClick:this.selectNumbers,children:"Numbers Only"})]}),u&&s.jsxs("p",{className:"text-danger",children:[s.jsx(Z,{icon:pr})," Select at least one column to search."]})]})})]})]})}}const xt=cu;function Dr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function Ir(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dr(Object(t),!0).forEach(function(i){ft(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Dr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Pr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function fi(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Pr(a,i,n,o,u,"next",l)}function u(l){Pr(a,i,n,o,u,"throw",l)}o(void 0)})}}function ft(r,e,t){return e=hu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function hu(r){var e=mu(r,"string");return typeof e=="symbol"?e:String(e)}function mu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var qe=ce.module("IrisGridPartitionSelector");class pu extends y.Component{constructor(e){super(e),ft(this,"pending",void 0),ft(this,"tableUtils",void 0),ft(this,"getCachedChangeCallback",J(i=>n=>this.handlePartitionSelect(i,n))),ft(this,"getCachedFormatValueCallback",J(i=>n=>this.getDisplayValue(i,n))),this.handleKeyTableClick=this.handleKeyTableClick.bind(this),this.handleMergeClick=this.handleMergeClick.bind(this),this.handlePartitionSelect=this.handlePartitionSelect.bind(this);var{model:t}=e;this.tableUtils=new T(t.dh),this.pending=new Yr,this.state={isLoading:!0,keysTable:null,partitionFilters:null,partitionTables:null}}componentDidMount(){var e=this;return fi(function*(){var{model:t}=e.props;try{var i=yield e.pending.add(t.partitionKeysTable().then(o=>{var u=t.partitionColumns.map(l=>l.sort().desc());return o.applySort(u),o}),o=>o.close()),n=yield Promise.all(t.partitionColumns.map(function(){var o=fi(function*(u,l){return e.pending.add(i.selectDistinct(t.partitionColumns.slice(0,l+1)),d=>d.close())});return function(u,l){return o.apply(this,arguments)}}())),a=e.getPartitionFilters(n);e.setState({isLoading:!1,keysTable:i,partitionFilters:a,partitionTables:n})}catch(o){if(!Oe.isCanceled(o))throw o}})()}componentDidUpdate(e){var{partitionConfig:t}=e,{partitionConfig:i}=this.props;t!==i&&this.updatePartitionFilters()}componentWillUnmount(){this.pending.cancel();var{keysTable:e,partitionTables:t}=this.state;e?.close(),t?.forEach(i=>i.close())}handleKeyTableClick(){qe.debug2("handleKeyTableClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="keys"?"partition":"keys",this.sendUpdate(t)}handleMergeClick(){qe.debug2("handleMergeClick");var{partitionConfig:e}=this.props,t=Ir({},e);t.mode=e.mode==="merged"?"partition":"merged",this.sendUpdate(t)}handlePartitionSelect(e,t){var i=this;return fi(function*(){var{model:n,partitionConfig:a}=i.props;qe.debug("handlePartitionSelect",e,t,a);var o=[...a.partitions];if(o[e]=t,e===n.partitionColumns.length-1){i.sendUpdate({partitions:o,mode:"partition"});return}var{keysTable:u}=i.state;L(u);try{i.setState({isLoading:!0});var l=yield i.pending.add(u.copy(),p=>p.close()),d=o.slice(0,e+1).map((p,m)=>{var f=l.columns[m];return i.tableUtils.makeNullableEqFilter(f,p)});l.applyFilter(d),l.setViewport(0,0,l.columns);var c=yield i.pending.add(l.getViewportData()),h={partitions:l.columns.map(p=>{var m;return(m=c.rows[0].get(p))!==null&&m!==void 0?m:null}),mode:"partition"};l.close(),i.sendUpdate(h)}catch(p){Oe.isCanceled(p)||qe.error("Unable to get partition tables",p)}finally{i.setState({isLoading:!1})}})()}sendUpdate(e){qe.debug2("sendUpdate",e);var{onChange:t}=this.props;t(e)}getDisplayValue(e,t){var{model:i}=this.props;if(t===null)return"(null)";if(t===void 0||t==="")return"";var n=i.partitionColumns[e];return T.isCharType(n.type)&&t.toString().length>0?String.fromCharCode(parseInt(t.toString(),10)):i.displayString(t,n.type,n.name)}updatePartitionFilters(){var{partitionTables:e}=this.state;L(e);var{partitionConfig:t}=this.props,{mode:i}=t;if(qe.debug("updatePartitionFilters",t),i==="partition"){var n=this.getPartitionFilters(e);this.setState({partitionFilters:n})}}getPartitionFilters(e){var{model:t,partitionConfig:i}=this.props,{partitions:n}=i;if(qe.debug("getPartitionFilters",i),n.length!==e.length)throw new Error("Invalid partition config set. Expected ".concat(e.length," partitions, but got ").concat(n.length));for(var a=[],o=0;o<n.length;o+=1)if(o===0)a.push([]);else{var u=a[o-1],l=n[o-1],d=t.partitionColumns[o-1],c=[...u,this.tableUtils.makeNullableEqFilter(d,l)];a.push(c)}return a}render(){var{model:e,partitionConfig:t}=this.props,{isLoading:i,partitionFilters:n,partitionTables:a}=this.state,{mode:o,partitions:u}=t,l=e.partitionColumns.map((d,c)=>{var h;return s.jsxs("div",{className:"column-selector",children:[s.jsx("div",{className:"column-name",children:d.name}),s.jsx(no,{className:"custom-select-sm",table:a?.[c],column:a==null||(h=a[c])===null||h===void 0?void 0:h.columns[c],filter:n?.[c],onChange:this.getCachedChangeCallback(c),selectedValue:o==="partition"?u[c]:void 0,disabled:c>0&&t.mode!=="partition"||i,formatValue:this.getCachedFormatValueCallback(c)}),e.partitionColumns.length-1===c||s.jsx(Z,{icon:Sa})]},"selector-".concat(d.name))});return s.jsxs("div",{className:"iris-grid-partition-selector",children:[s.jsx("div",{className:"table-name",children:"Partitioned Table"}),s.jsxs("div",{className:"partition-button-group",children:[s.jsx(W,{className:"btn-sm",onClick:this.handleKeyTableClick,kind:"inline",tooltip:"View keys as table",icon:Ta,active:t.mode==="keys",disabled:i,children:"Keys"}),s.jsx(W,{className:"btn-sm",onClick:this.handleMergeClick,kind:"inline",tooltip:"View all partitions as one merged table",icon:s.jsx(Z,{icon:ba,rotation:90}),active:t.mode==="merged",disabled:i,children:"Merge"})]}),l]})}}const vu=pu;function gu(r,e,t){return e=fu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fu(r){var e=Cu(r,"string");return typeof e=="symbol"?e:String(e)}function Cu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Su=ce.module("SelectDistinctBuilder");class on extends y.Component{constructor(e){super(e),this.handleAddColumnClick=this.handleAddColumnClick.bind(this),this.handleDeleteColumn=this.handleDeleteColumn.bind(this),this.handleDropdownChanged=this.handleDropdownChanged.bind(this);var{model:t,selectDistinctColumns:i}=this.props;this.state={inputs:i.length>0?[...i]:[""],columns:t.originalColumns}}componentDidUpdate(e,t){var{inputs:i}=this.state,{onChange:n}=this.props;if(t.inputs!==i){var a=i.filter(o=>o!=="");De(t.inputs.filter(o=>o!==""),a)||n(a)}}handleAddColumnClick(){this.setState(e=>{var{inputs:t}=e;return{inputs:[...t,""]}})}handleDeleteColumn(e){this.setState(t=>{var{inputs:i}=t;return{inputs:i.length===1&&e===0?[""]:i.filter((n,a)=>e!==a)}})}handleDropdownChanged(e,t){Su.debug("handleDropdownChanged",e,t),this.setState(i=>{var{inputs:n}=i,a=[...n];return a[e]=t,{inputs:a}})}renderInputs(){var{columns:e,inputs:t}=this.state;return t.map((i,n)=>{var a=e.filter(o=>{var{name:u}=o;return u===i||!t.includes(u)}).map(o=>{var{name:u}=o;return s.jsx("option",{value:u,children:u},u)});return s.jsxs("div",{className:"form-inline px-3 pb-3",children:[s.jsxs(nt,{className:"form-control custom-select col",value:i,onChange:o=>this.handleDropdownChanged(n,o),children:[s.jsx("option",{value:"",children:"Select a column"}),a]}),(t.length>1||i!=="")&&s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:()=>{this.handleDeleteColumn(n)},icon:s.jsx(Z,{icon:Ai,transform:"grow-3"}),tooltip:"Delete column"})]},n)})}render(){var{columns:e,inputs:t}=this.state,i=t.length>=e.length;return s.jsxs("div",{role:"presentation",className:"select-distinct-builder-container h-100",children:[s.jsx("div",{className:"select-distinct-title",children:"Display Unique Values From"}),this.renderInputs(),s.jsx("hr",{}),s.jsx("div",{className:"pt-1 px-3",children:s.jsx(W,{kind:"ghost",className:"btn-add-column",onClick:this.handleAddColumnClick,disabled:i,icon:Ri,children:"Add Additional Column"})}),s.jsx("div",{className:"select-distinct-builder-footer",children:s.jsx("div",{className:"select-distinct-builder-hint",children:"Display only unique values from the selected table columns. Note that this will reset any filters and display only the selected columns."})})]})}}gu(on,"defaultProps",{selectDistinctColumns:[],onChange:()=>{}});const Tu=on;function ji(r){var{items:e,onChange:t=()=>{}}=r;return s.jsx(qr,{items:Array.from(e.entries()).map(i=>{var[n,a]=i;return{title:ji.getAdvancedSettingsTitleForKey(n),isOn:a,onChange:o=>t(n,o)}})})}ji.getAdvancedSettingsTitleForKey=r=>{switch(r){case Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from a control";case Lt.LINK_CHANGE_CLEARS_ALL_FILTERS:return"Clear current table filters before applying new filters from an incoming link filter"}};function Lr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function tt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Lr(Object(t),!0).forEach(function(i){bu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Lr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function bu(r,e,t){return e=Eu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Eu(r){var e=yu(r,"string");return typeof e=="symbol"?e:String(e)}function yu(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ur=ce.module("ConditionalFormattingMenu"),Ci=()=>{};function wu(r){var{column:{type:e}}=r;if(T.isNumberType(e))return r.condition===P.IS_NULL||r.condition===P.IS_NOT_NULL?"":"".concat(r.value);if(T.isCharType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isStringType(e))return r.condition===B.IS_NULL||r.condition===B.IS_NOT_NULL?"":'"'.concat(r.value,'"');if(T.isDateType(e))return r.condition===k.IS_NULL||r.condition===k.IS_NOT_NULL?"":"".concat(r.value);if(T.isBooleanType(e))return"";throw new Error("Invalid column type ".concat(e," in getRuleValue"))}function Fu(r){return T.isNumberType(r.column.type)&&r.condition===P.IS_BETWEEN?"".concat(r.start," < ").concat(r.column.name," < ").concat(r.end):"".concat(r.column.name," ").concat(ds(r.column.type,r.condition),`
2
2
  `).concat(wu(r))}function Nu(r){var{rules:e=[],onChange:t=Ci,onCreate:i=Ci,onSelect:n=Ci}=r,a=y.useCallback((d,c,h)=>{d.stopPropagation(),Ur.debug("Rule clicked",c,h),n(h)},[n]),o=y.useCallback((d,c,h)=>{d.stopPropagation(),Ur.debug("Delete button clicked",c,h);var p=[...e];p.splice(h,1),t(p)},[t,e]),u=y.useCallback(d=>{d.stopPropagation()},[]),l=y.useCallback(d=>{if(Cr.stopDragging(),d.destination!=null){var c=d.source.index,h=d.destination.index,p=[...e],m=e[c];p.splice(c,1),p.splice(h,0,m),t(p)}},[t,e]);return s.jsxs("div",{className:"conditional-formatting-rules",children:[s.jsx(na,{onDragStart:Cr.startDragging,onDragEnd:l,children:s.jsx(aa,{droppableId:"droppable-custom-columns",children:(d,c)=>s.jsxs("div",tt(tt({ref:d.innerRef},d.droppableProps),{},{className:Y("droppable-container",{dragging:c.draggingFromThisWith}),children:[e.length===0&&s.jsx("div",{className:"text-muted pl-2",children:"No formats defined"}),e.map((h,p)=>s.jsx(oa,{draggableId:"".concat(p,"-").concat(h.type),index:p,disableInteractiveElementBlocking:!0,children:(m,f)=>s.jsx("div",tt(tt({role:"menuitem",tabIndex:0,onClick:C=>a(C,h,p),className:Y("draggable-container",{dragging:f.isDragging}),ref:m.innerRef},m.draggableProps),{},{children:s.jsx("div",{className:"conditional-formatting-list-item",children:s.jsxs("div",{className:"formatting-item",children:[s.jsx("div",{className:"rule-icon",children:s.jsx("span",{className:"rule-icon-bg",style:{backgroundColor:Ut(h.config.style),color:jt(h.config.style)},children:h.type===Ce.ROWS?"row":"col"})}),s.jsx("div",{className:"rule-title",children:Fu(h.config)}),s.jsx(W,{kind:"ghost",className:"ml-1 px-2",onClick:C=>o(C,h,p),icon:Ai,tooltip:"Delete rule"}),s.jsxs("button",tt(tt({type:"button",className:"btn btn-link btn-link-icon px-2 btn-drag-handle",onClick:u},m.dragHandleProps),{},{children:[s.jsx(Xe,{children:"Drag to re-order"}),s.jsx(Z,{icon:Ea})]}))]})})}))},"".concat(p,"-").concat(h.type))),d.placeholder]}))})}),s.jsx("hr",{}),s.jsx(W,{kind:"ghost",onClick:i,icon:Ri,children:"Add New Rule"})]})}var ze=ce.module("ConditionEditor"),Ou=()=>{},Au=[P.IS_EQUAL,P.IS_NOT_EQUAL,P.IS_BETWEEN,P.GREATER_THAN,P.GREATER_THAN_OR_EQUAL,P.LESS_THAN,P.LESS_THAN_OR_EQUAL,P.IS_NULL,P.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:qo(r)},r)),Ru=[B.IS_EXACTLY,B.IS_NOT_EXACTLY,B.CONTAINS,B.DOES_NOT_CONTAIN,B.STARTS_WITH,B.ENDS_WITH,B.IS_NULL,B.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:zo(r)},r)),_u=[k.IS_EXACTLY,k.IS_NOT_EXACTLY,k.IS_BEFORE,k.IS_BEFORE_OR_EQUAL,k.IS_AFTER,k.IS_AFTER_OR_EQUAL,k.IS_NULL,k.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Xo(r)},r)),xu=[ne.IS_TRUE,ne.IS_FALSE,ne.IS_NULL,ne.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Zo(r)},r)),Du=[ee.IS_EQUAL,ee.IS_NOT_EQUAL,ee.IS_NULL,ee.IS_NOT_NULL].map(r=>s.jsx("option",{value:r,children:Jo(r)},r));function Iu(r,e,t,i){return r===P.IS_NULL||r===P.IS_NOT_NULL||r===P.IS_BETWEEN&&t!=null&&t!==""&&!Number.isNaN(Number.parseFloat(t))&&i!=null&&i!==""&&!Number.isNaN(Number.parseFloat(i))||r!==P.IS_BETWEEN&&e!==void 0&&e!==""&&!Number.isNaN(Number.parseFloat(e))}function Pu(r,e,t,i,n,a,o){switch(r){case P.IS_EQUAL:case P.IS_NOT_EQUAL:case P.GREATER_THAN:case P.GREATER_THAN_OR_EQUAL:case P.LESS_THAN:case P.LESS_THAN_OR_EQUAL:return s.jsx("input",{type:"number",className:"form-control",placeholder:"Enter value",value:n??"",onChange:e});case P.IS_BETWEEN:return s.jsxs("div",{className:"d-flex flex-row",children:[s.jsx("input",{type:"number",className:"form-control d-flex mr-2",placeholder:"Start value",value:a??"",onChange:t}),s.jsx("input",{type:"number",className:"form-control d-flex",placeholder:"End value",value:o??"",onChange:i})]});case P.IS_NULL:case P.IS_NOT_NULL:return null}}function Lu(r,e,t){switch(r){case B.IS_NULL:case B.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",placeholder:"Enter value",value:t??"",onChange:e})}}function Uu(r,e,t){switch(r){case k.IS_NULL:case k.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",placeholder:"Enter value",value:t??"",onChange:e})}}function ju(){return null}function ku(r,e,t){switch(r){case ee.IS_NULL:case ee.IS_NOT_NULL:return null;default:return s.jsx("input",{type:"text",className:"form-control",maxLength:1,placeholder:"Enter value",value:t??"",onChange:e})}}function sn(r){var{column:e,config:t,dh:i,onChange:n=Ou}=r,a=e.type,[o,u]=y.useState(a),[l,d]=y.useState(t.condition),[c,h]=y.useState(t.value),[p,m]=y.useState(t.start),[f,C]=y.useState(t.end);a!==o&&(d(Xr(a)),h(Zr(a)),m(void 0),C(void 0),u(a));var v=y.useMemo(()=>{if(a===void 0)return[];if(T.isNumberType(a))return Au;if(T.isCharType(a))return Du;if(T.isStringType(a))return Ru;if(T.isDateType(a))return _u;if(T.isBooleanType(a))return xu},[a]),F=y.useCallback(E=>{ze.debug("handleConditionChange",E),d(E)},[]),w=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleValueChange",O),h(O)},[]),g=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleStartValueChange",O),m(O)},[]),N=y.useCallback(E=>{var{value:O}=E.target;ze.debug("handleEndValueChange",O),C(O)},[]);y.useEffect(function(){var O=!0;l===void 0?(ze.debug("Unable to create formatting rule. Condition is not selected."),O=!1):T.isNumberType(e.type)&&!Iu(l,c,p,f)?(ze.debug("Unable to create formatting rule. Invalid value",c),O=!1):T.isDateType(e.type)&&!hs(i,l,c)&&(ze.debug("Unable to create formatting rule. Invalid date condition",c),O=!1),n({condition:l,value:c,start:p,end:f},O)},[n,e.type,i,l,c,p,f]);var A=y.useMemo(()=>{if(a===void 0)return null;if(T.isNumberType(a))return Pu(l,w,g,N,c,p,f);if(T.isCharType(a))return ku(l,w,c);if(T.isStringType(a))return Lu(l,w,c);if(T.isDateType(a))return Uu(l,w,c);if(T.isBooleanType(a))return ju()},[a,l,c,p,f,w,g,N]);return s.jsxs("div",{className:"condition-editor mb-2",children:[s.jsx(nt,{value:l,"data-testid":"condition-select",className:"custom-select mb-2",onChange:F,children:v}),A]})}var Gu=ce.module("StyleEditor"),Mu="#fcfcfa",Vu="#f0f0ee",Bu="#1a171a",$u=200,Qu=()=>{};function ln(r){var e,t,{config:i,onChange:n=Qu}=r,[a,o]=y.useState(i.type),[u,l]=y.useState((e=(t=i.customConfig)===null||t===void 0?void 0:t.background)!==null&&e!==void 0?e:Mu),[d,c]=y.useState(!1),[h,p]=y.useState($u),m=y.useRef(null),f=y.useCallback(A=>{var{value:E}=A.target;Gu.debug("handleBackgroundChange",E),l(E)},[]),C=y.useCallback(()=>{d&&c(!1)},[d]),v=y.useCallback(()=>{d||w(),c(!d)},[d]),F=y.useMemo(()=>[$.NO_FORMATTING,$.POSITIVE,$.NEGATIVE,$.WARN,$.NEUTRAL,$.ACCENT_1,$.ACCENT_2,$.CUSTOM],[]);function w(){m.current&&p(m.current.getBoundingClientRect().width)}y.useEffect(function(){n({type:a,customConfig:{color:ya.isDark(u)?Vu:Bu,background:u}})},[n,a,u]);var g=y.useCallback(()=>{for(var A=[],E=function(){var x=F[O],G="option-".concat(O,"-").concat(x);A.push(s.jsxs(W,{kind:"inline",className:"style-option-btn",onClick:()=>{o(x),c(!1)},style:{color:jt({type:x}),background:Ut({type:x})},children:[x===a&&s.jsx(Z,{icon:wi,className:"mr-2"}),x!==a&&s.jsx("span",{className:"mr-4"}),yr(x)]},G))},O=0;O<F.length;O+=1)E();return A},[F,a]),N=y.useCallback(()=>s.jsx("div",{className:"style-menu-container",role:"presentation",style:{width:h},children:s.jsx("div",{className:"style-options",children:g()})}),[h,g]);return s.jsxs("div",{className:"style-editor",children:[s.jsxs("div",{className:"mb-2",ref:m,children:[s.jsx("label",{className:"mb-0",children:"Style"}),s.jsxs(W,{kind:"inline",className:"cs-dropdown custom-select",style:{color:jt({type:a}),background:Ut({type:a})},onClick:v,children:[yr(a),s.jsx(Ya,{isShown:d,actions:{menuElement:N()},popperOptions:{placement:"bottom-start"},popperClassName:"style-dropdown-menu",onMenuClosed:C,menuStyle:{maxWidth:"100rem"}})]})]}),a===$.CUSTOM&&s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Background"}),s.jsx("input",{type:"color",value:u,className:"custom-select color-select",onChange:f})]})]})}function jr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function un(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jr(Object(t),!0).forEach(function(i){Hu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):jr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Hu(r,e,t){return e=Wu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wu(r){var e=Ku(r,"string");return typeof e=="symbol"?e:String(e)}function Ku(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var pt=ce.module("ColumnFormatEditor"),Yu=()=>{};function qu(r){var{type:e,name:t}=r[0],i={type:e,name:t},n=un({column:i,style:en()},Mt(e));return n}function zu(r){var e,{columns:t,config:i=qu(t),dh:n,onChange:a=Yu}=r,[o,u]=y.useState((e=t.find(w=>w.name===i.column.name&&w.type===i.column.type))!==null&&e!==void 0?e:t[0]),[l,d]=y.useState(Jr(i)),[c,h]=y.useState(!1),[p,m]=y.useState(i.style),f=y.useCallback(w=>{var g=t.find(N=>{var{name:A}=N;return A===w});g!==void 0?(u(g),o.type!==g.type&&(d(Mt(g.type)),h(!1))):pt.error("Column ".concat(w," not found."))},[t,o]),C=y.useCallback((w,g)=>{pt.debug("handleConditionChange",w,g),d(w),h(g)},[]),v=y.useCallback(w=>{pt.debug("handleStyleChange",w),m(w)},[]);y.useEffect(function(){var g=c;o===void 0&&(pt.debug("Column is not selected, invalidating update."),g=!1),(p===void 0||p.type===$.NO_FORMATTING)&&(pt.debug("Style is not selected, invalidating update."),g=!1);var{type:N,name:A}=o,E={type:N,name:A};a(un({column:E,style:p},l),g)},[a,o,p,l,c]);var F=t.map(w=>{var{name:g}=w;return{title:g,value:g}});return s.jsxs("div",{className:"conditional-rule-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Format Cell If"}),s.jsx(zr,{defaultValue:o?.name,options:F,inputPlaceholder:"Select a column",spellCheck:!1,onChange:f,searchPlaceholder:"Filter columns"})]}),o!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(sn,{dh:n,column:o,config:l,onChange:C}),s.jsx(ln,{config:p,onChange:v})]})]})}function kr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function dn(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kr(Object(t),!0).forEach(function(i){Xu(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):kr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function Xu(r,e,t){return e=Zu(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Zu(r){var e=Ju(r,"string");return typeof e=="symbol"?e:String(e)}function Ju(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var vt=ce.module("RowFormatEditor"),ed=()=>{};function td(r){var{type:e,name:t}=r[0],i={type:e,name:t},n=dn({column:i,style:en()},Mt(e));return n}function id(r){var e,{columns:t,config:i=td(t),dh:n,onChange:a=ed}=r,[o,u]=y.useState((e=t.find(w=>w.name===i.column.name&&w.type===i.column.type))!==null&&e!==void 0?e:t[0]),[l,d]=y.useState(Jr(i)),[c,h]=y.useState(!1),[p,m]=y.useState(i.style),f=y.useCallback(w=>{var g=t.find(N=>{var{name:A}=N;return A===w});g!==void 0?(u(g),o.type!==g.type&&(d(Mt(g.type)),h(!1))):vt.error("Column ".concat(w," not found."))},[t,o]),C=y.useCallback((w,g)=>{vt.debug("handleConditionChange",w,g),d(w),h(g)},[]),v=y.useCallback(w=>{vt.debug("handleStyleChange",w),m(w)},[]);y.useEffect(function(){if(o===void 0){vt.debug("Column is not selected, skip update.");return}if(p===void 0){vt.debug("Style is not selected, skip update.");return}var{type:g,name:N}=o,A={type:g,name:N};a(dn({column:A,style:p},l),c)},[a,o,p,l,c]);var F=t.map(w=>{var{name:g}=w;return{title:g,value:g}});return s.jsxs("div",{className:"conditional-rule-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",children:"Format Row If"}),s.jsx(zr,{defaultValue:o?.name,options:F,inputPlaceholder:"Select a column",spellCheck:!1,onChange:f,searchPlaceholder:"Filter columns"})]}),o!==void 0&&s.jsxs(s.Fragment,{children:[s.jsx(sn,{column:o,config:l,dh:n,onChange:C}),s.jsx(ln,{config:p,onChange:v})]})]})}var Si=ce.module("ConditionalFormatEditor"),Ti=()=>{};function rd(r){switch(r){case Ce.CONDITIONAL:return s.jsx(oo,{});case Ce.ROWS:return s.jsx(ao,{})}}function nd(r){switch(r){case Ce.CONDITIONAL:return"Conditional";case Ce.ROWS:return"Rows"}}var Gr=[Ce.CONDITIONAL,Ce.ROWS];function ad(r){var e,{columns:t,dh:i,onSave:n=Ti,onUpdate:a=Ti,onCancel:o=Ti,rule:u}=r,l=t.filter(ms),[d,c]=y.useState((e=u?.type)!==null&&e!==void 0?e:Gr[0]),[h,p]=y.useState(u),[m,f]=y.useState(!1),C=y.useCallback(()=>{o()},[o]),v=y.useCallback(()=>{if(h===void 0){Si.error("Rule is not defined.");return}n(h)},[n,h]),F=y.useCallback(g=>{Si.debug("handleFormatterChange",g),c(g)},[]),w=y.useCallback((g,N)=>{Si.debug("handleRuleChange",g,N,d);var A={type:d,config:g};p(A),f(N),a(N?A:void 0)},[a,d]);return s.jsxs("div",{className:"conditional-format-editor form",children:[s.jsxs("div",{className:"mb-2",children:[s.jsx("label",{className:"mb-0",htmlFor:"formatter-select",children:"Select Formatter"}),s.jsx("div",{className:"formatter-list",children:Gr.map((g,N)=>s.jsx("div",{className:"formatter-type",children:s.jsxs("button",{type:"button",className:Y("btn","btn-icon","btn-formatter-type",{active:g===d}),"data-index":N,onClick:()=>F(g),children:[rd(g),nd(g)]})},g))})]}),d===Ce.CONDITIONAL&&s.jsx(zu,{columns:l,dh:i,config:h?.config,onChange:w}),d===Ce.ROWS&&s.jsx(id,{columns:l,config:h?.config,dh:i,onChange:w}),s.jsx("hr",{}),s.jsxs("div",{className:"d-flex justify-content-end my-3",children:[s.jsx(W,{kind:"secondary",onClick:C,className:"mr-2",children:"Cancel"}),s.jsx(W,{kind:"primary",onClick:v,disabled:h===void 0||!m,children:"Done"})]})]})}function od(r){var e,t,{text:i,isOpen:n,onClose:a}=r,[o,u]=y.useState(!1),[l,d]=y.useState(0),[c,h]=y.useState(!1),[p,m]=y.useState(!1),[f,C]=y.useState(!1),v=y.useRef();y.useEffect(function(){if(n){try{JSON.parse(i),C(!0)}catch{C(!1)}m(!1)}},[n,i]),y.useEffect(function(){v.current&&v.current.layout()},[l]),y.useEffect(function(){v.current&&v.current.updateOptions({lineNumbers:c?"on":"off"})},[c]);function F(){h(!c)}function w(){var E,O=(E=v.current)===null||E===void 0?void 0:E.getModel();!f||!O||(p?(O.setValue(i),m(!1)):(O.setValue(JSON.stringify(JSON.parse(i),void 0,2)),m(!0)),g())}function g(){var E,O,D=v.current;D&&h(((E=(O=D.getModel())===null||O===void 0?void 0:O.getLineCount())!==null&&E!==void 0?E:0)>1)}function N(){o&&(v.current=void 0,a())}function A(E){v.current=E,d(E.getContentHeight()),E.onDidContentSizeChange(O=>{var{contentHeight:D}=O;return d(D)}),g()}return!n&&!o?null:s.jsxs(wa,{isOpen:n,centered:!0,keyboard:!0,toggle:N,onOpened:()=>u(!0),onClosed:()=>{u(!1),d(0)},className:"cell-overflow-modal",size:"xl",children:[s.jsxs(Fa,{toggle:a,children:[s.jsx("h5",{className:"overflow-modal-title",children:"Cell Contents"}),s.jsx(Wr,{kind:"inline",tooltip:"Copy cell contents",copy:(e=(t=v.current)===null||t===void 0?void 0:t.getValue())!==null&&e!==void 0?e:i}),s.jsx(W,{kind:"inline",active:c,icon:Na,tooltip:"Toggle line numbers",onClick:F}),f&&s.jsx(W,{kind:"inline",icon:Oa,active:p,tooltip:"Format as JSON",onClick:w})]}),s.jsx(Aa,{style:{height:l},children:s.jsx(qa,{onEditorInitialized:A,settings:{value:i,readOnly:!0,wordWrap:"on",language:f?"typescript":"plaintext",folding:f,padding:{bottom:16},lineNumbers:c?"on":"off",overviewRulerLanes:0,renderLineHighlight:"none",find:{seedSearchStringFromSelection:"never"}}})})]})}function sd(r){return r.model!==void 0}var ld="###,##0",cn=y.forwardRef((r,e)=>{var{gotoRow:t,gotoRowError:i,gotoValueError:n,onGotoRowSubmit:a,isShown:o,onEntering:u,onEntered:l,onExiting:d,onExited:c,model:h,onGotoRowNumberChanged:p,onClose:m,gotoValueSelectedColumnName:f,gotoValue:C,gotoValueFilter:v,onGotoValueSelectedColumnNameChanged:F,onGotoValueSelectedFilterChanged:w,onGotoValueChanged:g,onGotoValueSubmit:N}=r,A=y.useRef(null),E=y.useRef(null),[O,D]=y.useState(!1),x=[];sd(h)&&h.table!==void 0&&({columns:x}=h.table);var{dh:G,rowCount:z}=h,M=y.useMemo(()=>"goto-row-input-".concat(bi()),[]),oe=S=>{S.key==="Enter"?(S.stopPropagation(),S.preventDefault(),N()):(S.key==="Backspace"||S.key==="Delete")&&(C==="".concat(Number.POSITIVE_INFINITY)||C==="".concat(Number.NEGATIVE_INFINITY))&&Ee("")},X=S=>{S.key==="Enter"&&(S.stopPropagation(),S.preventDefault(),N(S.shiftKey))},le=h.getColumnIndexByName(f),_e=x[le??0],Le=_e?.type,Ge=T.getNormalizedType(Le),Ee=S=>{g(S??"")};y.useImperativeHandle(e,()=>({focus(){var S;D(!0),(S=A.current)===null||S===void 0||S.select()}}));var He=()=>{if(O&&document.activeElement!==A.current){var S;(S=A.current)===null||S===void 0||S.select()}else if(!O&&document.activeElement!==E.current){var R;(R=E.current)===null||R===void 0||R.select()}};y.useEffect(He,[O]);var at=()=>{switch(Ge){case T.dataType.DECIMAL:case T.dataType.INT:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:Y("form-control",{"is-invalid":n!==""}),onKeyDown:oe,placeholder:"value",onChange:S=>{var R=S.target.value.toLowerCase();/^-?[0-9]*\.?[0-9]*$/.test(S.target.value)?Ee(S.target.value):R==="-i"||R==="-infinity"?Ee("".concat(Number.NEGATIVE_INFINITY)):(R==="i"||R==="infinity")&&Ee("".concat(Number.POSITIVE_INFINITY))},value:C,"aria-label":"Value Input"})});case T.dataType.DATETIME:return s.jsx("div",{className:"goto-value-date-time-input",children:s.jsx(bo,{ref:E,className:Y("form-control","goto-value-date-time-input",{"is-invalid":n!==""}),defaultValue:C,onChange:Ee,onSubmit:X,"aria-label":"Value Input"})});case T.dataType.STRING:return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"goto-row-input",children:s.jsxs(nt,{className:"custom-select",onChange:S=>{w(S)},value:v,"aria-label":"filter-type-select",children:[s.jsx("option",{value:Te.eqIgnoreCase,children:"Equals (case-insensitive)"},Te.eqIgnoreCase),s.jsx("option",{value:Te.containsIgnoreCase,children:"Contains (case-insensitive)"},Te.containsIgnoreCase),s.jsx("option",{value:Te.eq,children:"Equals"},Te.eq),s.jsx("option",{value:Te.contains,children:"Contains"},Te.contains)]})}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:Y("form-control",{"is-invalid":n!==""}),onKeyDown:X,placeholder:"value",onChange:S=>Ee(S.target.value),value:C,"aria-label":"Value Input"})})]});case T.dataType.BOOLEAN:return s.jsx("div",{className:"goto-row-input",children:s.jsxs(nt,{className:"custom-select",onChange:S=>{Ee(S)},value:C,"aria-label":"Value Input",children:[s.jsx("option",{"aria-label":"null value",value:""},"null"),s.jsx("option",{value:"true",children:"true"},"true"),s.jsx("option",{value:"false",children:"false"},"false")]})});default:return s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:E,className:"form-control",onKeyDown:X,placeholder:"value",onChange:S=>Ee(S.target.value),value:C,"aria-label":"Value Input"})})}};return s.jsx(Vt,{isShown:o,className:Y("goto-row"),onEntering:u,onEntered:()=>{l(),He()},onExiting:d,onExited:c,children:s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"goto-row-row",children:[s.jsxs("div",{className:Y("goto-row-wrapper",{"is-inactive":!O}),onClick:()=>D(!0),onFocus:()=>D(!0),role:"group",children:[s.jsx("label",{className:"goto-row-text",htmlFor:M,children:"Go to row"}),s.jsx("div",{className:"goto-row-input",children:s.jsx("input",{ref:A,"data-testid":"goto-row-input",type:"number",onKeyDown:S=>{S.key==="Enter"&&(S.stopPropagation(),S.preventDefault(),a())},className:Y("form-control",{"is-invalid":i!==""}),placeholder:"Row number",onChange:S=>{p(S)},value:t,id:M})}),s.jsxs("div",{className:"goto-row-text",children:["of"," ",G.i18n.NumberFormat.format(ld,z)]}),i&&s.jsx("div",{className:"text-danger",children:i})]}),s.jsx("div",{className:"goto-row-close",children:s.jsx(W,{kind:"ghost",onClick:m,children:s.jsx(Z,{icon:Qr,style:{marginRight:"0"}})})})]}),h.isSeekRowAvailable&&s.jsx("div",{className:"goto-row-row",children:s.jsxs("div",{className:Y("goto-row-wrapper",{"is-inactive":O}),onClick:()=>D(!1),onFocus:()=>D(!1),role:"group",children:[s.jsx("div",{className:"goto-row-text",children:"Go to value"}),s.jsx("div",{className:"goto-row-input",children:s.jsx(nt,{className:"custom-select",onChange:S=>{var R=S;F(R)},value:f,"aria-label":"column-name-select",id:"column-name-select",children:x.map(S=>s.jsx("option",{value:S.name,children:S.name},S.name))})}),at(),s.jsxs("div",{children:[s.jsx(W,{tooltip:"Previous match",icon:Ra,kind:"ghost",disabled:C==="",onClick:()=>{N(!0)}}),s.jsx(W,{tooltip:"Next match",icon:_a,kind:"ghost",disabled:C==="",onClick:()=>{N(!1)}})]}),n&&s.jsx("div",{className:"text-danger",children:n})]})})]})})});cn.displayName="GotoRow";const ud=cn;function Mr(r,e,t,i,n,a,o){try{var u=r[a](o),l=u.value}catch(d){t(d);return}u.done?e(l):Promise.resolve(l).then(i,n)}function gt(r){return function(){var e=this,t=arguments;return new Promise(function(i,n){var a=r.apply(e,t);function o(l){Mr(a,i,n,o,u,"next",l)}function u(l){Mr(a,i,n,o,u,"throw",l)}o(void 0)})}}function Vr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(r,n).enumerable})),t.push.apply(t,i)}return t}function se(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Vr(Object(t),!0).forEach(function(i){_(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Vr(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function _(r,e,t){return e=dd(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dd(r){var e=cd(r,"string");return typeof e=="symbol"?e:String(e)}function cd(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var I=ce.module("IrisGrid"),hd=500,md=500,pd=250,vd=250,gd=250,hn=Object.freeze({aggregations:de,showOnTop:!1}),fd="yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSS z";function Br(r){var{advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d}=r;return e.size===0&&t.aggregations.length===0&&i.length===0&&n.size===0&&a===T.REVERSE_TYPE.NONE&&o==null&&u==null&&l.length===0&&d.length===0}class Pe extends y.Component{constructor(e){var t,i,n,a;super(e),_(this,"grid",void 0),_(this,"lastFocusedFilterBarColumn",void 0),_(this,"lastLoadedConfig",void 0),_(this,"tooltip",void 0),_(this,"pending",void 0),_(this,"globalColumnFormats",void 0),_(this,"dateTimeFormatterOptions",void 0),_(this,"decimalFormatOptions",void 0),_(this,"integerFormatOptions",void 0),_(this,"truncateNumbersWithPound",void 0),_(this,"showEmptyStrings",void 0),_(this,"showNullStrings",void 0),_(this,"loadingScrimStartTime",void 0),_(this,"loadingScrimFinishTime",void 0),_(this,"animationFrame",void 0),_(this,"loadingTimer",void 0),_(this,"renderer",void 0),_(this,"tableSaver",void 0),_(this,"crossColumnRef",void 0),_(this,"isAnimating",void 0),_(this,"filterInputRef",void 0),_(this,"gotoRowRef",void 0),_(this,"isCopying",void 0),_(this,"toggleFilterBarAction",void 0),_(this,"toggleSearchBarAction",void 0),_(this,"toggleGotoRowAction",void 0),_(this,"discardAction",void 0),_(this,"commitAction",void 0),_(this,"contextActions",void 0),_(this,"tableUtils",void 0),_(this,"keyHandlers",void 0),_(this,"mouseHandlers",void 0),_(this,"getAdvancedMenuOpenedHandler",J(S=>this.handleAdvancedMenuOpened.bind(this,S),{max:100})),_(this,"getCachedAdvancedFilterMenuActions",J((S,R,j,Q,H)=>s.jsx(ko,{model:S,column:R,onFilterChange:this.handleAdvancedFilterChange,onSortChange:this.handleAdvancedFilterSortChange,onDone:this.handleAdvancedFilterDone,options:j,sortDirection:Q,formatter:H,tableUtils:this.tableUtils}),{max:50})),_(this,"getCachedOptionItems",J((S,R,j,Q,H,q,te,ue,ae,ve,Ze,wt,Ft,Qt,Ht,Nt)=>{var he=[];return S&&he.push({type:K.CHART_BUILDER,title:"Chart Builder",icon:xa}),he.push({type:K.VISIBILITY_ORDERING_BUILDER,title:"Organize Columns",icon:Da}),j&&he.push({type:K.CONDITIONAL_FORMATTING,title:"Conditional Formatting",icon:Ia}),R&&he.push({type:K.CUSTOM_COLUMN_BUILDER,title:"Custom Columns",icon:Pa}),Q&&he.push({type:K.ROLLUP_ROWS,title:"Rollup Rows",icon:La}),H&&he.push({type:K.AGGREGATIONS,title:"Aggregate Columns",icon:Ua}),q&&he.push({type:K.SELECT_DISTINCT,title:"Select Distinct Values",icon:ja}),te&&Ft&&he.push({type:K.TABLE_EXPORTER,title:"Download CSV",icon:ka}),Nt&&he.push({type:K.ADVANCED_SETTINGS,title:"Advanced Settings",icon:Ga}),he.push({type:K.QUICK_FILTERS,title:"Quick Filters",subtitle:ue.shortcut.getDisplayText(),icon:Pt,isOn:Ze,onChange:ue.action}),Qt&&he.push({type:K.SEARCH_BAR,title:"Search Bar",subtitle:ae.shortcut.getDisplayText(),icon:Ma,isOn:wt,onChange:ae.action}),he.push({type:K.GOTO,title:"Go to",subtitle:ve.shortcut.getDisplayText(),icon:Va,isOn:Ht,onChange:ve.action}),Object.freeze(he)},{max:1})),_(this,"getCachedHiddenColumns",J((S,R)=>ie.getHiddenColumns(new Map([...S.initialColumnWidths,...R])),{max:1})),_(this,"getAggregationMap",J((S,R)=>{var j={};return R.forEach(Q=>{var{operation:H,selected:q,invert:te}=Q;j[H]=Rt.getOperationColumnNames(S,H,q,te)}),j})),_(this,"getOperationMap",J((S,R)=>{var j={};return R.filter(Q=>!Rt.isRollupOperation(Q.operation)).forEach(Q=>{var{operation:H,selected:q,invert:te}=Q;Rt.getOperationColumnNames(S,H,q,te).forEach(ue=>{var ae,ve=[...(ae=j[ue])!==null&&ae!==void 0?ae:[],H];j[ue]=Object.freeze(ve)})}),j})),_(this,"getOperationOrder",J(S=>S.map(R=>R.operation).filter(R=>!Rt.isRollupOperation(R)))),_(this,"getCachedFormatColumns",J((S,R,j)=>cs(S,R,j))),_(this,"getCachedPreviewFormatColumns",J((S,R,j,Q,H)=>{if(I.debug("getCachedPreviewFormatColumns",j,Q,H),Q!==void 0&&H!==void 0){var q=[...j];return q[H]=Q,this.getCachedFormatColumns(S,R,q)}return this.getCachedFormatColumns(S,R,j)})),_(this,"getModelRollupConfig",J((S,R,j)=>ie.getModelRollupConfig(S,R,j))),_(this,"getModelTotalsConfig",J((S,R,j)=>{var Q,H;if(((Q=R==null||(H=R.columns)===null||H===void 0?void 0:H.length)!==null&&Q!==void 0?Q:0)>0)return null;var q=j.aggregations.filter(ae=>ae.selected.length>0||ae.invert);if(q.length===0)return null;var te=this.getOperationMap(S,q),ue=this.getOperationOrder(q);return{operationMap:te,operationOrder:ue,showOnTop:j.showOnTop,defaultOperation:io.SKIP}})),_(this,"getCachedStateOverride",J((S,R,j,Q,H,q,te,ue,ae,ve)=>({hoverSelectColumn:S,isFilterBarShown:R,isSelectingColumn:j,loadingScrimProgress:Q,quickFilters:H,advancedFilters:q,sorts:te,reverseType:ue,rollupConfig:ae,isMenuShown:ve}),{max:1})),_(this,"getCachedFilter",J((S,R,j,Q)=>[...S??[],...ie.getFiltersFromFilterMap(R),...ie.getFiltersFromFilterMap(j),...Q!==void 0?[Q]:[]],{max:1})),_(this,"getCachedTheme",J((S,R,j,Q)=>{var H,q=S??so(),te=Q>0?(H=R?.rowFooterWidth)!==null&&H!==void 0?H:q.rowFooterWidth:0;return se(se(se({},q),R),{},{autoSelectRow:!j,rowFooterWidth:te})},{max:1})),_(this,"getCachedKeyHandlers",J(S=>[...S,...this.keyHandlers].sort((R,j)=>R.order-j.order))),_(this,"getCachedMouseHandlers",J(S=>[...S,...this.mouseHandlers])),_(this,"getAlwaysFetchColumns",J((S,R,j,Q,H,q)=>{for(var te=[],ue=0;ue<Q;ue+=1)te.push(R[ge.getModelIndex(ue,j)].name);for(var ae=0;ae<H;ae+=1)te.push(R[ge.getModelIndex(R.length-1-ae,j)].name);if(q)for(var ve=q[0];ve<=q[1];ve+=1)te.push(R[ge.getModelIndex(ve,j)].name);var Ze=new Set([...S,...te]);return Object.freeze([...Ze])})),_(this,"updateSearchFilter",rt((S,R,j,Q)=>{var{model:H}=this.props,q=xt.createSearchFilter(H.dh,S,R,j,Q);this.setState({searchFilter:q})},pd)),_(this,"showViewportLoading",hr(()=>{var{model:S}=this.props,{loadingSpinnerShown:R}=this.state;S.isViewportPending&&!R&&this.startLoading("Waiting for viewport...",{loadingCancelShown:!1,loadingBlocksGrid:!1})},hd,{leading:!1,trailing:!0})),_(this,"handleConditionalFormatEditorUpdate",rt(S=>{this.setState({conditionalFormatPreview:S})},gd)),_(this,"handleDownloadProgressUpdate",hr((S,R)=>{var{tableDownloadStatus:j}=this.state;j===Ye.DOWNLOAD_STATUS.DOWNLOADING&&this.setState({tableDownloadProgress:S,tableDownloadEstimatedTime:R})},md)),_(this,"getOverflowButtonTooltip",J(S=>{if(S==null)return null;var R=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),j={placement:"left",modifiers:{flip:{behavior:["left","right"]}}};return s.jsx("div",{style:R,children:s.jsx(Xe,{options:j,ref:this.handleTooltipRef,children:"View full contents"},Date.now())})})),_(this,"getExpandCellTooltip",J(S=>{if(S==null)return null;var{expandTooltipDisplayValue:R}=this.state,{model:j}=this.props,Q=$e(j)&&j.isExpandAllAvailable,H=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),q={placement:"bottom-start"};return s.jsx("div",{style:H,children:s.jsx(Xe,{options:q,ref:this.handleTooltipRef,children:s.jsxs("div",{style:{textAlign:"left"},children:["Click to ",R," row",Q&&s.jsxs(s.Fragment,{children:[s.jsx("br",{}),Ae.isMacPlatform()?"⌘":"Ctrl+","Click to expand row and all children"]})]})},Date.now())})})),_(this,"getLinkHoverTooltip",J(S=>{if(S==null)return null;var{linkHoverDisplayValue:R}=this.state,j=se(se({position:"absolute"},S),{},{pointerEvents:"none"}),Q={placement:"bottom"};return s.jsx("div",{style:j,children:s.jsx(Xe,{options:Q,ref:this.handleTooltipRef,children:s.jsxs("div",{className:"link-hover-tooltip",children:[R," - Click once to follow.",s.jsx("br",{}),"Click and hold to select this cell."]})})})})),_(this,"handleGotoValueChanged",S=>{this.setState({gotoValue:S,gotoValueManuallyChanged:!0}),this.debouncedSeekRow(S)}),_(this,"debouncedSeekRow",rt(S=>{this.seekRow(S)},vd)),this.handleAdvancedFilterChange=this.handleAdvancedFilterChange.bind(this),this.handleAdvancedFilterSortChange=this.handleAdvancedFilterSortChange.bind(this),this.handleAdvancedFilterDone=this.handleAdvancedFilterDone.bind(this),this.handleAdvancedMenuOpened=this.handleAdvancedMenuOpened.bind(this),this.handleGotoRowOpened=this.handleGotoRowOpened.bind(this),this.handleGotoRowClosed=this.handleGotoRowClosed.bind(this),this.handleAdvancedMenuClosed=this.handleAdvancedMenuClosed.bind(this),this.handleAggregationChange=this.handleAggregationChange.bind(this),this.handleAggregationsChange=this.handleAggregationsChange.bind(this),this.handleAggregationEdit=this.handleAggregationEdit.bind(this),this.handleAnimationLoop=this.handleAnimationLoop.bind(this),this.handleAnimationStart=this.handleAnimationStart.bind(this),this.handleAnimationEnd=this.handleAnimationEnd.bind(this),this.handleChartChange=this.handleChartChange.bind(this),this.handleChartCreate=this.handleChartCreate.bind(this),this.handleGridError=this.handleGridError.bind(this),this.handleFilterBarChange=this.handleFilterBarChange.bind(this),this.handleFilterBarDone=this.handleFilterBarDone.bind(this),this.handleFilterBarTab=this.handleFilterBarTab.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleMenu=this.handleMenu.bind(this),this.handleMenuClose=this.handleMenuClose.bind(this),this.handleMenuSelect=this.handleMenuSelect.bind(this),this.handleMenuBack=this.handleMenuBack.bind(this),this.handleRequestFailed=this.handleRequestFailed.bind(this),this.handleSelectionChanged=this.handleSelectionChanged.bind(this),this.handleMovedColumnsChanged=this.handleMovedColumnsChanged.bind(this),this.handleHeaderGroupsChanged=this.handleHeaderGroupsChanged.bind(this),this.handleUpdate=this.handleUpdate.bind(this),this.handleTooltipRef=this.handleTooltipRef.bind(this),this.handleViewChanged=this.handleViewChanged.bind(this),this.handleFormatSelection=this.handleFormatSelection.bind(this),this.handleConditionalFormatCreate=this.handleConditionalFormatCreate.bind(this),this.handleConditionalFormatEdit=this.handleConditionalFormatEdit.bind(this),this.handleConditionalFormatsChange=this.handleConditionalFormatsChange.bind(this),this.handleConditionalFormatEditorSave=this.handleConditionalFormatEditorSave.bind(this),this.handleConditionalFormatEditorCancel=this.handleConditionalFormatEditorCancel.bind(this),this.handleUpdateCustomColumns=this.handleUpdateCustomColumns.bind(this),this.handleCustomColumnsChanged=this.handleCustomColumnsChanged.bind(this),this.handleSelectDistinctChanged=this.handleSelectDistinctChanged.bind(this),this.handlePendingDataUpdated=this.handlePendingDataUpdated.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.handlePendingCommitClicked=this.handlePendingCommitClicked.bind(this),this.handlePendingDiscardClicked=this.handlePendingDiscardClicked.bind(this),this.handleGotoRowSelectedRowNumberSubmit=this.handleGotoRowSelectedRowNumberSubmit.bind(this),this.focusRowInGrid=this.focusRowInGrid.bind(this),this.handleDownloadTable=this.handleDownloadTable.bind(this),this.handleDownloadTableStart=this.handleDownloadTableStart.bind(this),this.handleCancelDownloadTable=this.handleCancelDownloadTable.bind(this),this.handleDownloadCanceled=this.handleDownloadCanceled.bind(this),this.handleDownloadCompleted=this.handleDownloadCompleted.bind(this),this.handlePartitionChange=this.handlePartitionChange.bind(this),this.handleColumnVisibilityChanged=this.handleColumnVisibilityChanged.bind(this),this.handleColumnVisibilityReset=this.handleColumnVisibilityReset.bind(this),this.handleCrossColumnSearch=this.handleCrossColumnSearch.bind(this),this.handleRollupChange=this.handleRollupChange.bind(this),this.handleOverflowClose=this.handleOverflowClose.bind(this),this.getColumnBoundingRect=this.getColumnBoundingRect.bind(this),this.handleGotoRowSelectedRowNumberChanged=this.handleGotoRowSelectedRowNumberChanged.bind(this),this.handleGotoValueSelectedColumnNameChanged=this.handleGotoValueSelectedColumnNameChanged.bind(this),this.handleGotoValueSelectedFilterChanged=this.handleGotoValueSelectedFilterChanged.bind(this),this.handleGotoValueChanged=this.handleGotoValueChanged.bind(this),this.handleGotoValueSubmitted=this.handleGotoValueSubmitted.bind(this),this.handleViewportUpdated=this.handleViewportUpdated.bind(this),this.makeQuickFilter=this.makeQuickFilter.bind(this),this.grid=null,this.lastLoadedConfig=null,this.pending=new Yr,this.globalColumnFormats=de,this.decimalFormatOptions={},this.integerFormatOptions={},this.truncateNumbersWithPound=!1,this.showEmptyStrings=!0,this.showNullStrings=!0,this.renderer=new lo,this.tableSaver=null,this.crossColumnRef=ke.createRef(),this.isAnimating=!1,this.filterInputRef=ke.createRef(),this.gotoRowRef=ke.createRef(),this.isCopying=!1,this.toggleFilterBarAction={action:()=>this.toggleFilterBar(),shortcut:Ne.TABLE.TOGGLE_QUICK_FILTER},this.toggleSearchBarAction={action:()=>this.toggleSearchBar(),shortcut:Ne.TABLE.TOGGLE_SEARCH},this.toggleGotoRowAction={action:()=>this.toggleGotoRow(),shortcut:Ne.TABLE.GOTO_ROW},this.discardAction={action:()=>{var{model:S}=this.props;Be(S)&&S.isEditable&&S.pendingDataMap.size>0&&this.discardPending().catch(I.error)},shortcut:Ne.INPUT_TABLE.DISCARD},this.commitAction={action:()=>{var{model:S}=this.props;Be(S)&&S.isEditable&&S.pendingDataMap.size>0&&S.pendingDataErrors.size===0&&this.commitPending().catch(I.error)},shortcut:Ne.INPUT_TABLE.COMMIT},this.contextActions=[this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,this.discardAction,this.commitAction];var{aggregationSettings:o,conditionalFormats:u,customColumnFormatMap:l,isFilterBarShown:d,isSelectingPartition:c,partitions:h,partitionConfig:p,model:m,movedColumns:f,movedRows:C,rollupConfig:v,userColumnWidths:F,userRowHeights:w,showSearchBar:g,searchValue:N,selectedSearchColumns:A,invertSearchColumns:E,advancedFilters:O,quickFilters:D,selectDistinctColumns:x,pendingDataMap:G,canCopy:z,frozenColumns:M,columnHeaderGroups:oe}=e,{dh:X}=m,le=[new Rs(this),new Gs(this),new Qs(this)],_e=[new qs(this),new $l(this),new Jl(this),new el(this),new al(this),new Kl(this),new kl(this),new yl(this,X),new Il(this),new ql(this)];z&&(le.push(new Ps(this)),_e.push(new Al(this)));var Le=f.length>0?f:m.initialMovedColumns,Ge=C.length>0?C:m.initialMovedRows,Ee=new uo({userColumnWidths:new Map(F),userRowHeights:new Map(w),movedColumns:Le,initialColumnWidths:new Map(m==null||(t=m.layoutHints)===null||t===void 0||(i=t.hiddenColumns)===null||i===void 0?void 0:i.map(S=>[m.getColumnIndexByName(S),0]))}),He=A??[],at=xt.createSearchFilter(X,N,He,m.columns,E);this.tableUtils=new T(X),this.mouseHandlers=_e,this.keyHandlers=le,this.state={isFilterBarShown:d,isSelectingPartition:c,focusedFilterBarColumn:null,metricCalculator:Ee,metrics:void 0,partitionConfig:p??(h&&h.length?{partitions:h,mode:"partition"}:void 0),quickFilters:D?new Map(D):new Map,advancedFilters:new Map(O),shownAdvancedFilter:null,hoverAdvancedFilter:null,sorts:[],reverseType:T.REVERSE_TYPE.NONE,customColumns:[],selectDistinctColumns:x,selectedRanges:[],copyOperation:null,loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1,loadingBlocksGrid:!1,movedColumns:Le,movedRows:Ge,shownColumnTooltip:null,formatter:new mi(X),isMenuShown:!1,customColumnFormatMap:new Map(l),conditionalFormats:u,conditionalFormatEditIndex:null,conditionalFormatPreview:void 0,hoverSelectColumn:null,isTableDownloading:!1,isReady:!1,tableDownloadStatus:"",tableDownloadProgress:0,tableDownloadEstimatedTime:0,showSearchBar:g,searchFilter:at,searchValue:N,selectedSearchColumns:He,invertSearchColumns:E,rollupConfig:v,rollupSelectedColumns:[],aggregationSettings:o,selectedAggregation:null,openOptions:[],pendingRowCount:0,pendingDataMap:G??new Map,pendingDataErrors:new Map,pendingSavePromise:null,pendingSaveError:null,toastMessage:null,frozenColumns:M,showOverflowModal:!1,overflowText:"",overflowButtonTooltipProps:null,expandCellTooltipProps:null,expandTooltipDisplayValue:"expand",linkHoverTooltipProps:null,linkHoverDisplayValue:"",isGotoShown:!1,gotoRow:"",gotoRowError:"",gotoValueError:"",gotoValueSelectedColumnName:(n=(a=m.columns[0])===null||a===void 0?void 0:a.name)!==null&&n!==void 0?n:"",gotoValueSelectedFilter:Te.eqIgnoreCase,gotoValue:"",gotoValueManuallyChanged:!1,columnHeaderGroups:oe??m.initialColumnHeaderGroups}}componentDidMount(){var{model:e}=this.props;this.initState(),this.startListening(e)}componentDidUpdate(e,t){var{inputFilters:i,isSelectingColumn:n,settings:a,model:o,customFilters:u,sorts:l}=this.props;o!==e.model&&(this.stopListening(e.model),this.startListening(o));var d=i!==e.inputFilters?i.filter(F=>!e.inputFilters.includes(F)):[];if(d.length>0){var c,{advancedSettings:h}=this.props,p=(c=h.get(Lt.FILTER_CONTROL_CHANGE_CLEARS_ALL_FILTERS))!==null&&c!==void 0?c:!1;p&&(this.clearGridInputField(),this.clearCrossColumSearch()),this.startLoading("Filtering...",{resetRanges:!0}),this.applyInputFilters(d,p)}n!==e.isSelectingColumn&&this.resetColumnSelection(),a!==e.settings&&this.updateFormatterSettings(a),u!==e.customFilters&&this.startLoading("Filtering...",{resetRanges:!0}),l!==e.sorts&&this.updateSorts(l);var{loadingScrimStartTime:m,loadingScrimFinishTime:f}=this;m!=null&&f!=null&&window.requestAnimationFrame(()=>{var F=Date.now(),w=F-m,g=f-m,N=Math.min(w/g,1);f<F&&(this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0),this.setState(A=>A.loadingScrimProgress==null?(I.debug2("Ignoring scrim update because loading cancelled."),null):{loadingScrimProgress:N})});var{openOptions:C}=this.state;if(C!==t.openOptions){var v=F=>F.type===K.AGGREGATION_EDIT;!C.some(v)&&t.openOptions.some(v)&&this.removeEmptyAggregations()}this.sendStateChange()}componentWillUnmount(){var{model:e}=this.props;this.stopListening(e),this.pending.cancel(),this.updateSearchFilter.cancel(),this.loadingTimer&&clearTimeout(this.loadingTimer),this.handleDownloadProgressUpdate.cancel(),this.animationFrame!==void 0&&cancelAnimationFrame(this.animationFrame),this.showViewportLoading.cancel()}get gridWrapper(){var e,t;return(e=(t=this.grid)===null||t===void 0?void 0:t.canvasWrapper.current)!==null&&e!==void 0?e:null}getKeyHandlers(){var{keyHandlers:e}=this.props;return this.getCachedKeyHandlers(e)}getMouseHandlers(){var{mouseHandlers:e}=this.props;return this.getCachedMouseHandlers(e)}getValueForCell(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{model:n}=this.props,{dh:a}=n,o=this.getModelColumn(e),u=this.getModelRow(t);if(i&&o!=null&&u!=null){var l=n.valueForCell(o,u);if(T.isDateType(n.columns[o].type)){var{formatter:d}=n;return a.i18n.DateTimeFormat.format(fd,l,a.i18n.TimeZone.getTimeZone(d.timeZone))}return l}return i?null:o!=null&&u!=null?n.textForCell(o,u):""}getModelColumn(e){var{metrics:t}=this.state;L(t);var{modelColumns:i}=t;return i==null?null:e!=null?i.get(e):null}getModelRow(e){var{metrics:t}=this.state;L(t);var{modelRows:i}=t;return i==null?null:e!=null?i.get(e):null}getTheme(){var e,{model:t,theme:i}=this.props;return this.getCachedTheme(this.context,i,(e=Be(t)&&t.isEditable)!==null&&e!==void 0?e:!1,t.floatingTopRowCount+t.floatingBottomRowCount)}getVisibleColumn(e){var{movedColumns:t}=this.state;return ge.getVisibleIndex(e,t)}makeQuickFilter(e,t,i){try{return this.tableUtils.makeQuickFilter(e,t,i)}catch(n){I.error("Error creating quick filter",n)}return null}applyInputFilters(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,{model:i}=this.props,{advancedFilters:n,quickFilters:a}=this.state,o=t?new Map:new Map(n),u=t?new Map:new Map(a),l=t&&n.size>0;e.forEach(d=>{var{name:c,type:h,value:p}=d,m=i.columns.findIndex(f=>{var{name:C,type:v}=f;return C===c&&v===h});m>=0?(l=o.delete(m)||l,l=this.applyQuickFilter(m,p,u)||l):I.error("Unable to find column for inputFilter",c,h,p)}),l&&this.setState({quickFilters:u,advancedFilters:o})}applyQuickFilter(e,t,i){var{model:n}=this.props,{formatter:a}=n,o=n.columns[e];if(t!=null&&"".concat(t).trim().length>0){var u=i.get(e);if(u!=null){var{text:l}=u;if(l===t)return I.debug2("Ignoring change to existing filter"),!1}return i.set(e,{text:t,filter:this.makeQuickFilter(o,t,a.timeZone)}),!0}return i.delete(e)}setAdvancedFilterMap(e){this.setState({advancedFilters:e})}setAdvancedFilter(e,t,i){I.debug("Setting advanced filter",e,t),this.startLoading("Filtering...",{resetRanges:!0}),this.setState(n=>{var{advancedFilters:a}=n,o=new Map(a);return t==null?o.delete(e):o.set(e,{filter:t,options:i}),{advancedFilters:o}})}setQuickFilter(e,t,i){I.debug("Setting quick filter",e,t,i),this.startLoading("Filtering...",{resetRanges:!0}),this.setState(n=>{var{quickFilters:a}=n,o=new Map(a);return o.set(e,{filter:t,text:i}),{quickFilters:o}})}setFilterMap(e){var t;I.debug("setFilterMap",e);var{advancedSettings:i}=this.props,n=(t=i.get(Lt.LINK_CHANGE_CLEARS_ALL_FILTERS))!==null&&t!==void 0?t:!1;n&&this.clearAllFilters();var{model:a}=this.props;e.forEach((o,u)=>{var{columnType:l,filterList:d}=o,c=a.columns.find(f=>f.name===u&&f.type===l);if(c!=null){var h=a.getColumnIndexByName(c.name);L(h);var p=ie.combineFiltersFromList(l,d);if(p.length===0)this.removeQuickFilter(h);else{var{formatter:m}=a;this.setQuickFilter(h,this.makeQuickFilter(c,p,m.timeZone),"".concat(p))}}})}removeColumnFilter(e){this.startLoading("Filtering...",{resetRanges:!0});var t=Array.isArray(e)?e:[e,e];this.setState(i=>{var{advancedFilters:n,quickFilters:a}=i,o=n?new Map(n):new Map,u=a?new Map(a):new Map;return o.forEach((l,d)=>{d>=t[0]&&d<=t[1]&&o.delete(d)}),u.forEach((l,d)=>{d>=t[0]&&d<=t[1]&&u.delete(d)}),{quickFilters:u,advancedFilters:o}})}removeQuickFilter(e){this.startLoading("Clearing Filter...",{resetRanges:!0}),this.setState(t=>{var{quickFilters:i}=t,n=new Map(i);return n.delete(e),{quickFilters:n}})}clearAllFilters(){I.debug("Clearing all filters");var{advancedFilters:e,quickFilters:t,searchFilter:i}=this.state;t.size===0&&e.size===0&&i===null||(this.clearGridInputField(),this.startLoading("Clearing Filters...",{resetRanges:!0}),this.setState({quickFilters:new Map,advancedFilters:new Map,searchValue:"",searchFilter:void 0}))}clearCrossColumSearch(){I.debug("Clearing cross-column search"),this.setState({searchValue:"",searchFilter:void 0})}clearGridInputField(){this.filterInputRef.current!=null&&this.filterInputRef.current.setValue("")}rebuildFilters(){I.debug("Rebuilding filters");var{model:e}=this.props,{advancedFilters:t,quickFilters:i}=this.state,{columns:n,formatter:a}=e,o=new Map,u=new Map;t.forEach((l,d)=>{var{options:c}=l,h=n[d],p=this.tableUtils.makeAdvancedFilter(h,c,a.timeZone);o.set(d,{options:c,filter:p})}),i.forEach((l,d)=>{var{text:c}=l,h=n[d];u.set(d,{text:c,filter:this.makeQuickFilter(h,c,a.timeZone)})}),this.startLoading("Rebuilding filters...",{resetRanges:!0}),this.setState({quickFilters:u,advancedFilters:o})}setFilters(e){var{quickFilters:t,advancedFilters:i}=e;this.setState({quickFilters:t,advancedFilters:i})}updateFormatterSettings(e){var t,i,n,a,o,u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,l=Tr.getColumnFormats(e),d=Tr.getDateTimeFormatterOptions(e),c=(t=e?.defaultDecimalFormatOptions)!==null&&t!==void 0?t:{},h=(i=e?.defaultIntegerFormatOptions)!==null&&i!==void 0?i:{},p=(n=e?.truncateNumbersWithPound)!==null&&n!==void 0?n:!1,m=(a=e?.showEmptyStrings)!==null&&a!==void 0?a:!0,f=(o=e?.showNullStrings)!==null&&o!==void 0?o:!0,C=!De(this.globalColumnFormats,l),v=!De(this.dateTimeFormatterOptions,d),F=!De(this.decimalFormatOptions,e?.defaultDecimalFormatOptions),w=!De(this.integerFormatOptions,h),g=this.truncateNumbersWithPound!==p,N=this.showEmptyStrings!==m,A=this.showNullStrings!==f;(C||v||F||w||g||N||A)&&(this.globalColumnFormats=l,this.dateTimeFormatterOptions=d,this.decimalFormatOptions=c,this.integerFormatOptions=h,this.truncateNumbersWithPound=p,this.showEmptyStrings=m,this.showNullStrings=f,this.updateFormatter({},u),v&&u&&this.rebuildFilters())}updateFormatter(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,{customColumnFormatMap:n}=this.state,{model:a}=this.props,o=se({customColumnFormatMap:n},e),u=[...(t=this.globalColumnFormats)!==null&&t!==void 0?t:[],...o.customColumnFormatMap.values()],l=new mi(a.dh,u,this.dateTimeFormatterOptions,this.decimalFormatOptions,this.integerFormatOptions,this.truncateNumbersWithPound,this.showEmptyStrings,this.showNullStrings);I.debug("updateFormatter",this.globalColumnFormats,u),this.setState(se(se({},o),{},{formatter:l}),()=>{i&&this.grid&&this.grid.forceUpdate()})}initFormatter(){var{settings:e}=this.props;this.updateFormatterSettings(e)}initState(){var{model:e}=this.props;try{Ni(e)&&e.isPartitionRequired?this.loadPartitionsTable(e):this.loadTableState()}catch(t){this.handleTableLoadError(t)}}loadTableState(){var{applyInputFiltersOnInit:e,inputFilters:t,sorts:i,model:n,reverseType:a,customColumns:o,searchValue:u,selectedSearchColumns:l,invertSearchColumns:d}=this.props,c=l??[],h=xt.createSearchFilter(n.dh,u,c,n.columns,d);if(e){var p=t.filter(m=>m.value!=null);this.applyInputFilters(p)}this.setState({sorts:i,reverseType:a,customColumns:o,isReady:!0,searchFilter:h}),this.initFormatter()}loadPartitionsTable(e){var t=this;return gt(function*(){try{var i=yield t.getInitialPartitionConfig(e);t.setState({isSelectingPartition:!0,partitionConfig:i},t.loadTableState)}catch(n){Oe.isCanceled(n)||t.handleTableLoadError(n)}})()}getInitialPartitionConfig(e){var t=this;return gt(function*(){var{partitionConfig:i}=t.state;if(i!==void 0)return i;var n=yield t.pending.add(e.partitionKeysTable(),u=>u.close()),{dh:a}=e,o=n.columns.map(u=>u.sort().desc());return n.applySort(o),n.setViewport(0,0),new Promise((u,l)=>{n.addEventListener(a.Table.EVENT_UPDATED,d=>{try{var{detail:c}=d;if(c.rows.length===0)return;var h=c.rows[0],p=n.columns.map(f=>{var C;return(C=h.get(f))!==null&&C!==void 0?C:null}),m={partitions:p,mode:"partition"};n.close(),u(m)}catch(f){n.close(),l(f)}})})})()}copyCell(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{canCopy:n}=this.props;if(n){var a=String(this.getValueForCell(e,t,i));Ii(a).catch(o=>I.error("Unable to copy cell",o))}else I.error("Attempted to copyCell for user without copy permission.")}copyColumnHeader(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(e!==null){var{canCopy:i}=this.props,{movedColumns:n}=this.state;if(i){var a={columnIndex:e,columnDepth:t,movedColumns:n};this.setState({copyOperation:a})}else I.error("Attempted copyColumnHeader for user without copy permission.")}}copyRanges(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,n=arguments.length>3?arguments[3]:void 0,{model:a,canCopy:o}=this.props,{metricCalculator:u,movedColumns:l}=this.state,d=u.getUserColumnWidths();if(o){var c={ranges:Fe.boundedRanges(e,a.columnCount,a.rowCount),includeHeaders:t,formatValues:i,movedColumns:l,userColumnWidths:d,error:n};this.setState({copyOperation:c})}else I.error("Attempted copyRanges for user without copy permission.")}startLoading(e){var{resetRanges:t=!1,loadingCancelShown:i=!0,loadingBlocksGrid:n=!0}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.setState({loadingText:e,loadingCancelShown:i,loadingBlocksGrid:n});var a=this.getTheme();if(t&&this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({top:0},!0)),this.loadingScrimStartTime==null){var o,u,{minScrimTransitionTime:l,maxScrimTransitionTime:d}=a;L(l),L(d);var c=(o=(u=this.gridWrapper)===null||u===void 0?void 0:u.getBoundingClientRect().height)!==null&&o!==void 0?o:0,h=Math.max(l,Math.min(c/2,d));this.loadingScrimStartTime=Date.now(),this.loadingScrimFinishTime=this.loadingScrimStartTime+h,this.setState({loadingScrimProgress:0}),this.loadingTimer=setTimeout(()=>{this.setState({loadingSpinnerShown:!0})},Pe.loadingSpinnerDelay)}}stopLoading(){this.showViewportLoading.cancel(),this.loadingScrimStartTime=void 0,this.loadingScrimFinishTime=void 0,this.setState({loadingText:null,loadingScrimProgress:null,loadingSpinnerShown:!1,loadingCancelShown:!1}),this.loadingTimer!=null&&(clearTimeout(this.loadingTimer),this.loadingTimer=void 0)}rollback(){if(this.lastLoadedConfig){I.debug("loading last loading config",this.lastLoadedConfig);var{advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d}=this.lastLoadedConfig;this.lastLoadedConfig=null,this.setState({advancedFilters:e,aggregationSettings:t,customColumns:i,quickFilters:n,reverseType:a,rollupConfig:o,searchFilter:u,selectDistinctColumns:l,sorts:d})}else I.debug("remove all sorts, filters, and custom columns"),this.setState({advancedFilters:new Map,aggregationSettings:hn,customColumns:[],quickFilters:new Map,reverseType:T.REVERSE_TYPE.NONE,rollupConfig:void 0,selectDistinctColumns:[],sorts:[]})}canRollback(){return this.lastLoadedConfig!=null||!Br(this.state)}startListening(e){e.addEventListener(xe.EVENT.UPDATED,this.handleUpdate),e.addEventListener(xe.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.addEventListener(xe.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.addEventListener(xe.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.addEventListener(xe.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated)}stopListening(e){e.removeEventListener(xe.EVENT.UPDATED,this.handleUpdate),e.removeEventListener(xe.EVENT.REQUEST_FAILED,this.handleRequestFailed),e.removeEventListener(xe.EVENT.COLUMNS_CHANGED,this.handleCustomColumnsChanged),e.removeEventListener(xe.EVENT.PENDING_DATA_UPDATED,this.handlePendingDataUpdated),e.removeEventListener(xe.EVENT.VIEWPORT_UPDATED,this.handleViewportUpdated)}focus(){var e;(e=this.grid)===null||e===void 0||e.focus()}focusFilterBar(e){var{movedColumns:t}=this.state,{model:i}=this.props,{columnCount:n}=i,a=ge.getModelIndex(e,t);if(e==null||e<0||n<=e||!i.isFilterable(a)){this.setState({focusedFilterBarColumn:null});return}var{metricCalculator:o,metrics:u}=this.state;L(u);var{left:l,rightVisible:d,lastLeft:c}=u;if(e<l){var h;(h=this.grid)===null||h===void 0||h.setViewState({left:e},!0)}else if(d<e){var p,m,f=(p=this.grid)===null||p===void 0?void 0:p.getMetricState();L(f);var C=o.getLastLeft(f,e,o.getVisibleWidth(f));(m=this.grid)===null||m===void 0||m.setViewState({left:Math.min(C,c),leftOffset:0},!0)}this.lastFocusedFilterBarColumn=e,this.setState({focusedFilterBarColumn:e,isFilterBarShown:!0})}hideColumnByVisibleIndex(e){var t,{metricCalculator:i,movedColumns:n}=this.state;i.setColumnWidth(ge.getModelIndex(e,n),0),(t=this.grid)===null||t===void 0||t.forceUpdate()}freezeColumnByColumnName(e){var{frozenColumns:t,movedColumns:i}=this.state,{model:n}=this.props;I.debug2("freezing column",e);var a=t==null?new Set(n.frozenColumns):new Set(t);a.add(e);var o=n.getColumnIndexByName(e);L(o);var u=ge.getVisibleIndex(o,i),l=ge.moveItem(u,a.size-1,i);this.setState({frozenColumns:[...a],movedColumns:l})}unFreezeColumnByColumnName(e){var{frozenColumns:t,movedColumns:i}=this.state,{model:n}=this.props;I.debug2("unfreezing column",e);var a=t==null?new Set(n.frozenColumns):new Set(t);a.delete(e);var o=n.getColumnIndexByName(e);L(o);var u=ge.getVisibleIndex(o,i),l=ge.moveItem(u,a.size+n.frontColumns.length,i);this.setState({frozenColumns:[...a],movedColumns:l})}handleColumnVisibilityChanged(e,t){var i,{metricCalculator:n,metrics:a}=this.state;L(a),t?e.forEach(o=>{var u=n.initialColumnWidths.get(o),l=Fi(a.calculatedColumnWidths,o);u!==l?n.setColumnWidth(o,l):n.resetColumnWidth(o)}):e.forEach(o=>{n.setColumnWidth(o,0)}),(i=this.grid)===null||i===void 0||i.forceUpdate()}handleColumnVisibilityReset(){var e,t,{metricCalculator:i,metrics:n}=this.state,{model:a}=this.props;L(n);for(var o=0;o<n.columnCount;o+=1)i.resetColumnWidth(o);this.handleMovedColumnsChanged(a.initialMovedColumns),this.handleHeaderGroupsChanged(a.initialColumnHeaderGroups),this.setState({frozenColumns:(e=(t=a.layoutHints)===null||t===void 0?void 0:t.frozenColumns)!==null&&e!==void 0?e:[]})}handleCrossColumnSearch(e,t,i){var{model:n}=this.props;this.startLoading("Searching..."),this.updateSearchFilter(e,t,n.columns,i),this.setState({searchValue:e,selectedSearchColumns:t,invertSearchColumns:i})}handleAnimationLoop(){var e;(e=this.grid)===null||e===void 0||e.updateCanvas(),this.isAnimating&&(this.animationFrame=requestAnimationFrame(this.handleAnimationLoop))}handleAnimationStart(){I.debug2("handleAnimationStart"),this.isAnimating=!0,this.animationFrame=requestAnimationFrame(this.handleAnimationLoop)}handleAnimationEnd(){I.debug2("handleAnimationEnd"),this.isAnimating=!1}handlePartitionChange(e){this.startLoading("Partitioning..."),this.setState({partitionConfig:e})}handleTableLoadError(e){if(!Oe.isCanceled(e)){I.error(e);var{onError:t}=this.props;t(e)}}handleViewportUpdated(){var{model:e}=this.props,{loadingText:t,loadingSpinnerShown:i}=this.state,n="Waiting for viewport...";e.isViewportPending&&!i?this.showViewportLoading():t===n&&!e.isViewportPending&&this.stopLoading()}showAllColumns(){for(var e,{metricCalculator:t}=this.state,i=t.getUserColumnWidths(),n=[...i.entries()],a=0;a<n.length;a+=1){var[o,u]=n[a];u===0&&t.resetColumnWidth(o)}(e=this.grid)===null||e===void 0||e.forceUpdate()}toggleSort(e,t){I.info("Toggling sort for column",e);var{model:i}=this.props,n=this.getModelColumn(e);if(L(n),i.isColumnSortable(e)){var{sorts:a}=this.state,o=T.toggleSortForColumn(a,i.columns,n,t);this.updateSorts(o)}else I.debug("Column type was not sortable",i.columns[e])}updateSorts(e){var t;this.startLoading("Sorting..."),this.setState({sorts:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}sortColumn(e){var t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:T.sortDirection.none,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;L(e);var{model:o}=this.props,u=T.sortColumn(o.sort,o.columns,e,i,n,a);this.startLoading("Sorting..."),this.setState({sorts:u}),(t=this.grid)===null||t===void 0||t.forceUpdate()}reverse(e){var t;this.startLoading("Reversing..."),this.setState({reverseType:e}),(t=this.grid)===null||t===void 0||t.forceUpdate()}isReversible(){var{model:e}=this.props;return e.isReversible}toggleFilterBar(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.lastFocusedFilterBarColumn,{isFilterBarShown:t}=this.state;if(t=!t,this.setState({isFilterBarShown:t}),t)if(e!=null)this.focusFilterBar(e);else{for(var i=0,{model:n}=this.props,{columnCount:a}=n,o=0;o<a;o+=1){var u=this.getModelColumn(o);if(u!=null){var l=n.columns[u];if(l!=null&&T.isTextType(l.type)){i=o;break}}}this.focusFilterBar(i)}else{var d;(d=this.grid)===null||d===void 0||d.focus()}}isTableSearchAvailable(){var e,t,i,{model:n,canToggleSearch:a}=this.props,{dh:o}=n,u=n==null||(e=n.layoutHints)===null||e===void 0?void 0:e.searchDisplayMode;return u===((t=o.SearchDisplayMode)===null||t===void 0?void 0:t.SEARCH_DISPLAY_HIDE)?!1:u===((i=o.SearchDisplayMode)===null||i===void 0?void 0:i.SEARCH_DISPLAY_SHOW)?!0:a}toggleSearchBar(){var{showSearchBar:e}=this.state;if(this.isTableSearchAvailable()){var t=!e;this.setState({showSearchBar:t},()=>{var i;if(t&&(i=this.crossColumnRef)!==null&&i!==void 0&&i.current){var n;(n=this.crossColumnRef)===null||n===void 0||n.current.focus()}else{var a;(a=this.grid)===null||a===void 0||a.focus()}})}}toggleGotoRow(){var e,t,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",{isGotoShown:o}=this.state;if(i||n){var u;this.setState({isGotoShown:!0,gotoValue:n,gotoValueSelectedColumnName:a,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1}),this.focusRowInGrid(i),(u=this.gotoRowRef.current)===null||u===void 0||u.focus();return}var l=(e=this.grid)===null||e===void 0?void 0:e.state.cursorRow,d=(t=this.grid)===null||t===void 0?void 0:t.state.cursorColumn;if(l==null||d==null){this.setState({isGotoShown:!o,gotoRow:"",gotoValue:"",gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1});return}var{model:c}=this.props,{name:h,type:p}=c.columns[d],m=c.valueForCell(d,l),f=ie.convertValueToText(m,p);this.setState({isGotoShown:!o,gotoRow:"".concat(l+1),gotoValue:f,gotoValueSelectedColumnName:h,gotoRowError:"",gotoValueError:"",gotoValueManuallyChanged:!1})}commitPending(){var e=this;return gt(function*(){var t,i,{model:n}=e.props;if(!Be(n)||!n.isEditable)throw new Error("Cannot save, table is not editable");var{pendingSavePromise:a}=e.state;if(a!=null)throw new Error("Save already in progress");var o=(t=document)===null||t===void 0||(i=t.activeElement)===null||i===void 0?void 0:i.classList.contains("grid-cell-input-field");if(o!=null&&o){var u;if(document.activeElement!=null&&document.activeElement.classList.contains("error"))throw new za("Current input is invalid");(u=e.grid)===null||u===void 0||u.focus()}var l=e.pending.add(n.commitPending()).then(()=>{e.setState({pendingSaveError:null,pendingSavePromise:null})}).catch(d=>{Oe.isCanceled(d)||e.setState({pendingSaveError:d,pendingSavePromise:null})});return e.setState({pendingSavePromise:l}),l})()}discardPending(){var e=this;return gt(function*(){var{pendingSavePromise:t}=e.state;if(t!=null)throw new Error("Cannot cancel a save in progress");e.setState({pendingSavePromise:null,pendingSaveError:null,pendingDataMap:new Map,pendingDataErrors:new Map})})()}selectColumn(e){var{onColumnSelected:t}=this.props;t(e)}selectData(e,t){var i=this.getRowDataMap(t),{onDataSelected:n}=this.props;n(t,i)}getRowDataMap(e){for(var t=this,{model:i}=this.props,{columns:n,groupedColumns:a}=i,o={},u=function(){var c=n[l],{name:h,type:p}=c,m=i.valueForCell(l,e),f=i.textForCell(l,e),C=t.getVisibleColumn(l),v=$e(i)&&i.isRowExpandable(e),F=a.find(w=>w.name===h)!=null;o[h]={value:m,text:f,type:p,isGrouped:F,isExpandable:v,visibleIndex:C}},l=0;l<n.length;l+=1)u();return o}handleAdvancedFilterChange(e,t,i){var{model:n}=this.props,a=n.getColumnIndexByName(e.name);L(a),this.setAdvancedFilter(a,t,i)}handleAdvancedFilterSortChange(e,t){var i,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,{model:a}=this.props,o=a.getColumnIndexByName(e.name);L(o);var u=a.columns[o].name,l=T.getSortForColumn(a.sort,u),d=null;(l==null||l.direction!==t)&&(t===T.sortDirection.descending?d=e.sort().desc():d=e.sort().asc());var c=T.setSortForColumn(a.sort,u,d,n);I.info("Setting table sorts",c),this.startLoading("Sorting..."),this.setState({sorts:c}),(i=this.grid)===null||i===void 0||i.forceUpdate()}handleAdvancedFilterDone(){var e;(e=this.grid)===null||e===void 0||e.focus()}handleAdvancedMenuOpened(e){this.setState({shownAdvancedFilter:e})}handleGotoRowOpened(){this.setState({isGotoShown:!0,gotoValueManuallyChanged:!1})}handleGotoRowClosed(){this.setState({isGotoShown:!1,gotoValueManuallyChanged:!1})}handleAdvancedMenuClosed(e){var t,{focusedFilterBarColumn:i,isFilterBarShown:n}=this.state;if(n&&i===e&&((t=this.filterInputRef)===null||t===void 0?void 0:t.current)!==null){var a;(a=this.filterInputRef)===null||a===void 0||a.current.focus(),this.setState({shownAdvancedFilter:null})}else this.setState({focusedFilterBarColumn:null,shownAdvancedFilter:null})}handleCancel(){this.rollback()}handleChartChange(){}handleChartCreate(e){var{model:t,onCreateChart:i}=this.props;i(e,t)}handleGridError(e){I.warn("Grid Error",e),this.setState({toastMessage:s.jsx("div",{className:"error-message",children:"".concat(e)})})}handleFilterBarChange(e){this.startLoading("Filtering...",{resetRanges:!0}),this.setState(t=>{var{focusedFilterBarColumn:i,quickFilters:n}=t,a=new Map(n);if(i!=null){var o=this.getModelColumn(i);L(o),this.applyQuickFilter(o,e,a)}return{quickFilters:a}})}handleFilterBarDone(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(e){var i;(i=this.grid)===null||i===void 0||i.focus()}t&&this.setState({focusedFilterBarColumn:null})}handleFilterBarTab(e){var{focusedFilterBarColumn:t}=this.state;L(t),e?this.focusFilterBar(t-1):this.focusFilterBar(t+1)}handleFormatSelection(e,t){var{model:i}=this.props,n=i.columns[e],{customColumnFormatMap:a}=this.state,o=new Map(a);if(t!=null){var u=T.getNormalizedType(n.type);L(u);var l=mi.makeColumnFormattingRule(u,n.name,t);o.set(n.name,l)}else o.delete(n.name);this.updateFormatter({customColumnFormatMap:o})}handleMenu(e){e.stopPropagation(),this.setState({isMenuShown:!0})}handleMenuClose(){this.setState({isMenuShown:!1,openOptions:[]})}handleMenuBack(){this.setState(e=>{var{openOptions:t}=e,i=[...t];return i.pop(),{openOptions:i}})}handleMenuSelect(e){this.setState(t=>{var{openOptions:i}=t;return{openOptions:[...i,e]}})}handleRequestFailed(e){var{detail:t}=e;I.error("request failed:",t),this.stopLoading();var{partitionConfig:i}=this.state;if(ro(t)&&i!=null)this.startLoading("Reloading partition...",{resetRanges:!0}),this.setState({partitionConfig:void 0},()=>{this.initState()});else if(this.canRollback())this.startLoading("Rolling back changes...",{resetRanges:!0}),this.rollback();else{I.error("Table failed and unable to rollback");var{onError:n}=this.props;n(new Error("Error displaying table: ".concat(t)))}}handleUpdate(){var e;I.debug2("Received model update");var{advancedFilters:t,aggregationSettings:i,customColumns:n,quickFilters:a,reverseType:o,rollupConfig:u,searchFilter:l,selectDistinctColumns:d,sorts:c}=this.state,h={advancedFilters:t,aggregationSettings:i,customColumns:n,quickFilters:a,reverseType:o,rollupConfig:u,searchFilter:l,selectDistinctColumns:d,sorts:c};Br(h)?this.lastLoadedConfig=null:this.lastLoadedConfig=h,(e=this.grid)===null||e===void 0||e.forceUpdate(),this.stopLoading()}handleViewChanged(e){var t,i,{model:n}=this.props,{selectionEndRow:a=0}=(t=(i=this.grid)===null||i===void 0?void 0:i.state)!==null&&t!==void 0?t:{},o=0;if(Be(n)&&n.isEditable){L(e);var{bottomViewport:u}=e,l=n.rowCount-n.floatingBottomRowCount;a===l-1?o=n.pendingRowCount+1:a===l-2?o=n.pendingRowCount:o=Math.max(0,u-(n.rowCount-n.pendingRowCount)-n.floatingTopRowCount-n.floatingBottomRowCount-1)}this.setState({metrics:e,pendingRowCount:o})}handleSelectionChanged(e){var t;L(e);var{onSelectionChanged:i}=this.props,{copyOperation:n}=this.state;this.setState({selectedRanges:e}),n!=null&&this.setState({copyOperation:null}),((t=this.grid)===null||t===void 0?void 0:t.state.cursorRow)!=null&&this.setState({gotoRow:"".concat(this.grid.state.cursorRow+1)}),i(e)}handleMovedColumnsChanged(e,t){this.setState({movedColumns:e},t)}handleHeaderGroupsChanged(e){var{model:t}=this.props;this.setState({columnHeaderGroups:ie.parseColumnHeaderGroups(t,e).groups},()=>{var i;return(i=this.grid)===null||i===void 0?void 0:i.forceUpdate()})}handleTooltipRef(e){e?.startTimer(),this.tooltip=e}handleConditionalFormatsChange(e){I.debug("Updated conditional formats",e),this.setState({conditionalFormats:e})}handleConditionalFormatCreate(){I.debug("Create new conditional format");var{openOptions:e,conditionalFormats:t}=this.state;this.setState({openOptions:[...e,{type:K.CONDITIONAL_FORMATTING_EDIT,title:"Create Formatting Rule"}],conditionalFormatEditIndex:t.length,conditionalFormatPreview:void 0})}handleConditionalFormatEdit(e){I.debug("Edit conditional format",e);var{openOptions:t,conditionalFormats:i}=this.state;this.setState({openOptions:[...t,{type:K.CONDITIONAL_FORMATTING_EDIT,title:"Edit Formatting Rule"}],conditionalFormatEditIndex:e,conditionalFormatPreview:se({},i[e])})}handleConditionalFormatEditorSave(e){I.debug("Save conditional format changes",e),this.setState(t=>{if(t.conditionalFormatEditIndex===null)return I.debug("Invalid format index"),null;var i=[...t.conditionalFormats];return i[t.conditionalFormatEditIndex]=e,{conditionalFormats:i}},()=>{this.handleMenuBack()})}handleConditionalFormatEditorCancel(){this.handleMenuBack(),this.setState({conditionalFormatEditIndex:null})}handleUpdateCustomColumns(e){I.info("handleUpdateCustomColumns:",e);var{model:t}=this.props,{movedColumns:i,sorts:n,quickFilters:a,advancedFilters:o,selectDistinctColumns:u}=this.state,{columns:l}=t,d=t.customColumns.map(v=>"".concat(v)),c=ie.getRemovedCustomColumnNames(d,e);if(c.length>0){var h=ie.removeSortsInColumns(n,c),p=ie.removeFiltersInColumns(l,a,c),m=ie.removeFiltersInColumns(l,o,c),f=ie.removeColumnFromMovedColumns(l,i,c),C=ie.removeColumnsFromSelectDistinctColumns(u,c);h.length!==n.length&&(I.debug("removing sorts from removed custom columns..."),this.setState({sorts:h})),(p.size!==a.size||m.size!==o.size)&&(I.debug("removing filters from removed custom columns..."),this.setState({quickFilters:p,advancedFilters:m})),De(i,f)||(I.debug("change moved columns for removed custom columns",f),this.setState({movedColumns:f})),De(u,C)||(I.debug("change selectDistinct columns for removed custom columns",f),this.setState({selectDistinctColumns:C}))}this.setState({customColumns:e}),e.length>0&&this.startLoading("Applying custom columns...")}handleCustomColumnsChanged(){I.debug("custom columns changed");var{isReady:e}=this.state;if(e){var t;this.stopLoading(),(t=this.grid)===null||t===void 0||t.forceUpdate()}else this.loadTableState()}handlePendingCommitClicked(){return this.commitPending()}handlePendingDiscardClicked(){return this.discardPending()}handlePendingDataUpdated(){var e;I.debug("pending data updated");var{model:t}=this.props,{pendingDataMap:i,pendingDataErrors:n}=t;this.setState({pendingDataMap:i,pendingDataErrors:n,pendingSaveError:null}),(e=this.grid)===null||e===void 0||e.forceUpdate()}handleAggregationsChange(e){I.debug("handleAggregationsChange",e),this.startLoading("Aggregating ".concat(e.aggregations.map(t=>t.operation).join(", "),"...")),this.setState({aggregationSettings:e})}handleAggregationChange(e){I.debug("handleAggregationChange",e),this.startLoading("Aggregating ".concat(e.operation,"...")),this.setState(t=>{var{aggregationSettings:i}=t;return{selectedAggregation:e,aggregationSettings:se(se({},i),{},{aggregations:i.aggregations.map(n=>n.operation===e.operation?e:n)})}})}handleAggregationEdit(e){I.debug("handleAggregationEdit",e);var{openOptions:t}=this.state;this.setState({openOptions:[...t,{type:K.AGGREGATION_EDIT,title:"Edit Columns to ".concat(e.operation)}],selectedAggregation:e})}handleRollupChange(e){var t,i;I.info("Rollup change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading("Grouping by columns ".concat((t=e==null||(i=e.columns)===null||i===void 0?void 0:i.join(", "))!==null&&t!==void 0?t:"","...")),this.setState({rollupConfig:e,movedColumns:[],frozenColumns:[],sorts:[],reverseType:T.REVERSE_TYPE.NONE,selectDistinctColumns:[]})}handleSelectDistinctChanged(e){I.debug("SelectDistinct change",e),this.resetGridViewState(),this.showAllColumns(),this.clearAllFilters(),this.startLoading("Selecting distinct values in ".concat(e.length>0?e.join(", "):"","...")),this.setState({selectDistinctColumns:e,movedColumns:[],sorts:[],reverseType:T.REVERSE_TYPE.NONE})}handleDownloadTableStart(){var{canDownloadCsv:e}=this.props;e?this.setState({isTableDownloading:!0,tableDownloadProgress:0,tableDownloadEstimatedTime:null,tableDownloadStatus:Ye.DOWNLOAD_STATUS.INITIATING}):I.error("Attempted to handleDownloadTableStart for user without download CSV permission.")}handleDownloadTable(e,t,i,n,a,o,u){var{canDownloadCsv:l}=this.props;l?(I.info("start table downloading",e,t,i,n,a,o,u),this.setState(()=>(this.tableSaver&&this.tableSaver.startDownload(e,t,i,n,a,o,u),{tableDownloadStatus:Ye.DOWNLOAD_STATUS.DOWNLOADING}))):I.error("Attempted to handleDownloadTable for user without download CSV permission.")}removeEmptyAggregations(){I.debug("removeEmptyAggregations"),this.setState(e=>{var{aggregationSettings:t}=e,{aggregations:i}=t,n=i.filter(a=>a.selected.length>0||a.invert);return n.length!==i.length?{selectedAggregation:null,aggregationSettings:se(se({},t),{},{aggregations:n})}:{selectedAggregation:null,aggregationSettings:t}})}seekRow(e){var t=arguments,i=this;return gt(function*(){var n,a=t.length>1&&t[1]!==void 0?t[1]:!1,{gotoValueSelectedColumnName:o,gotoValueSelectedFilter:u}=i.state,{model:l}=i.props,{dh:d}=l;if(l.isSeekRowAvailable&&e!==""){var c=ie.getColumnByName(l.columns,o);if(c!==void 0){var h=(n=i.grid)===null||n===void 0?void 0:n.state.cursorRow;h==null&&(h=0);var p=u===Te.contains||u===Te.containsIgnoreCase,m=u===Te.eqIgnoreCase||u===Te.containsIgnoreCase;try{var f,{formatter:C}=l,v=T.getNormalizedType(c.type),F;switch(v){case T.dataType.CHAR:case T.dataType.STRING:{F=yield l.seekRow(h,c,d.ValueType.STRING,e,m,p,a??!1);break}case T.dataType.DATETIME:{var[w]=Di.parseDateRange(d,e,C.timeZone);F=yield l.seekRow(h,c,d.ValueType.DATETIME,w,void 0,void 0,a??!1);break}case T.dataType.DECIMAL:case T.dataType.INT:{if(!T.isBigDecimalType(c.type)&&!T.isBigIntegerType(c.type)){var g=parseInt(e,10);e==="-Infinity"?g=Number.NEGATIVE_INFINITY:e==="Infinity"&&(g=Number.POSITIVE_INFINITY),F=yield l.seekRow(h,c,d.ValueType.NUMBER,g,void 0,void 0,a??!1)}else F=yield l.seekRow(h,c,d.ValueType.STRING,e,void 0,void 0,a??!1);break}default:F=yield l.seekRow(h,c,d.ValueType.STRING,i.tableUtils.makeValue(c.type,e,C.timeZone),void 0,void 0,a??!1)}(f=i.grid)===null||f===void 0||f.setFocusRow(F),i.setState({gotoValueError:""})}catch{i.setState({gotoValueError:"invalid input"})}}}})()}handleCancelDownloadTable(){var e;(e=this.tableSaver)===null||e===void 0||e.cancelDownload(),this.setState({isTableDownloading:!1})}handleDownloadCompleted(){this.setState({isTableDownloading:!1,tableDownloadProgress:100,tableDownloadStatus:Ye.DOWNLOAD_STATUS.FINISHED})}handleDownloadCanceled(){this.setState({isTableDownloading:!1,tableDownloadProgress:0,tableDownloadStatus:Ye.DOWNLOAD_STATUS.CANCELED})}deleteRanges(e){var{model:t}=this.props;this.pending.add(t.delete(e)).catch(i=>{Oe.isCanceled(i)||I.error("Unable to delete ranges",e,i)})}resetColumnSelection(){if(this.grid!=null){var{isSelectingColumn:e}=this.props;if(e){var{columnAllowedCursor:t}=this.props;this.grid.setState({cursor:t})}else this.grid.setState({cursor:null}),this.setState({hoverSelectColumn:null})}}resetGridViewState(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.grid&&(this.grid.clearSelectedRanges(),this.grid.setViewState({left:0,top:0,topOffset:0,leftOffset:0},e))}sendStateChange(){if(this.grid){var{state:e}=this,{state:t}=this.grid,{onStateChange:i}=this.props;i(e,t)}}handleOverflowClose(){this.setState({showOverflowModal:!1})}getColumnBoundingRect(){var e,{metrics:t,shownColumnTooltip:i}=this.state;L(t),L(i);var n=(e=this.gridWrapper)===null||e===void 0?void 0:e.getBoundingClientRect(),a=20;L(n);var{columnHeaderHeight:o,allColumnXs:u,allColumnWidths:l,width:d,columnHeaderMaxDepth:c}=t,h=u.get(i),p=l.get(i);L(h),L(p);var m=n.left+di(h+p/2,a,d-a);return{top:n.top+(c-1)*o,left:n.left+di(h+p/2,a,d-a),bottom:n.top+c*o,right:n.left+di(h+p/2,a,d-a)+1,width:1,height:o,x:m,y:n.top,toJSON:()=>{throw new Error("not implemented")}}}handleGotoRowSelectedRowNumberSubmit(){var{gotoRow:e}=this.state;this.focusRowInGrid(e)}focusRowInGrid(e){var{model:t}=this.props,{rowCount:i}=t;if(this.setState({gotoRow:e}),e===""){this.setState({gotoRowError:"",gotoValueError:""});return}var n=parseInt(e,10);if(n>i||n<-i)this.setState({gotoRowError:"Invalid row index"});else if(n===0){var a;this.setState({gotoRowError:"",gotoValueError:""}),(a=this.grid)===null||a===void 0||a.setFocusRow(0)}else if(n<0){var o;this.setState({gotoRowError:"",gotoValueError:""}),(o=this.grid)===null||o===void 0||o.setFocusRow(n+i)}else{var u;(u=this.grid)===null||u===void 0||u.setFocusRow(n-1),this.setState({gotoRowError:"",gotoValueError:""})}}handleGotoRowSelectedRowNumberChanged(e){var t=e.target.value;this.focusRowInGrid(t)}getColumnTooltip(e,t,i){var{columnHeaderHeight:n,columnHeaderMaxDepth:a,allColumnXs:o,allColumnWidths:u,width:l}=t,d=o.get(e),c=u.get(e);if(d==null||c==null)return null;var h=Math.max(0,d),p=c;d+c>l?p=l-d:d<0&&(p=c-Math.abs(d));var m={position:"absolute",top:(a-1)*n,left:h,width:p,height:n,pointerEvents:"none"},f={clientWidth:1,clientHeight:n,getBoundingClientRect:this.getColumnBoundingRect},C={placement:"bottom",modifiers:{flip:{behavior:["bottom","top"]}}},v=this.getModelColumn(e);if(v==null)return null;var F=i.columns[v];return F==null?null:s.jsx("div",{style:m,children:s.jsx(Xe,{timeout:400,interactive:!0,options:C,ref:this.handleTooltipRef,referenceObject:f,onExited:()=>{this.setState({shownColumnTooltip:null})},children:s.jsx(su,{model:i,column:F,onStatistics:()=>{var w;(w=this.tooltip)===null||w===void 0||w.update()}})},F.name)})}handleGotoValueSelectedColumnNameChanged(e){var t,{model:i}=this.props,n=(t=this.grid)===null||t===void 0?void 0:t.state.cursorRow,{gotoValueSelectedColumnName:a,gotoValueManuallyChanged:o}=this.state;if(n!=null){var u=i.getColumnIndexByName(e),l=ie.getColumnByName(i.columns,e),d=ie.getColumnByName(i.columns,a);if(u==null||l==null)return;var c=i.valueForCell(u,n),h=ie.convertValueToText(c,l.type);o&&l.type===d?.type?this.setState({gotoValueSelectedColumnName:e,gotoValueError:""}):this.setState({gotoValueSelectedColumnName:e,gotoValue:h,gotoValueError:"",gotoValueManuallyChanged:!1})}this.setState({gotoValueSelectedColumnName:e,gotoValueError:""})}handleGotoValueSelectedFilterChanged(e){this.setState({gotoValueSelectedFilter:e,gotoValueError:""})}handleGotoValueSubmitted(e){var{gotoValue:t}=this.state;this.seekRow(t,e)}render(){var e,t,i=this,n,a,o,{children:u,customFilters:l,getDownloadWorker:d,isSelectingColumn:c,isStuckToBottom:h,isStuckToRight:p,model:m,name:f,onlyFetchVisibleColumns:C,alwaysFetchColumns:v,advancedSettings:F,onAdvancedSettingsChange:w,canDownloadCsv:g,onCreateChart:N}=this.props,{metricCalculator:A,metrics:E,isFilterBarShown:O,isSelectingPartition:D,isMenuShown:x,isReady:G,copyOperation:z,focusedFilterBarColumn:M,loadingText:oe,loadingScrimProgress:X,loadingSpinnerShown:le,loadingCancelShown:_e,loadingBlocksGrid:Le,shownColumnTooltip:Ge,hoverAdvancedFilter:Ee,shownAdvancedFilter:He,hoverSelectColumn:at,quickFilters:S,advancedFilters:R,searchFilter:j,selectDistinctColumns:Q,movedColumns:H,movedRows:q,formatter:te,conditionalFormats:ue,conditionalFormatPreview:ae,conditionalFormatEditIndex:ve,sorts:Ze,reverseType:wt,customColumns:Ft,selectedRanges:Qt,isTableDownloading:Ht,tableDownloadStatus:Nt,tableDownloadProgress:he,tableDownloadEstimatedTime:Wt,showSearchBar:ki,searchValue:mn,selectedSearchColumns:pn,invertSearchColumns:vn,aggregationSettings:Kt,selectedAggregation:Gi,rollupConfig:We,openOptions:ot,pendingSavePromise:gn,pendingSaveError:fn,pendingRowCount:Cn,pendingDataErrors:Sn,pendingDataMap:Mi,toastMessage:Tn,frozenColumns:bn,columnHeaderGroups:Vi,showOverflowModal:En,overflowText:yn,overflowButtonTooltipProps:Bi,expandCellTooltipProps:$i,linkHoverTooltipProps:Qi,isGotoShown:Hi,gotoRow:wn,gotoRowError:Fn,gotoValueError:Nn,gotoValueSelectedColumnName:On,gotoValue:An,gotoValueSelectedFilter:Rn,partitionConfig:Yt}=this.state;if(!G)return null;var st=this.getTheme(),_n=this.getCachedFilter(l,S,R,j),Wi=A.getUserColumnWidths(),xn=this.getCachedStateOverride(at,O,c,X,S,R,Ze,wt,We,x),Dn=E?E.top:0,In=E?E.bottomViewport:0,Ki=null,Yi=null;C&&(Ki=E?E.left:0,Yi=E?E.right:0);var Pn=E!=null&&E.width>0&&E.height>0,qi=((e=We==null||(t=We.columns)===null||t===void 0?void 0:t.length)!==null&&e!==void 0?e:0)>0,zi=null,Ln=E?Math.min(Math.max(Pe.minDebounce,Math.round(E.rowCount/200)),Pe.maxDebounce):Pe.maxDebounce;if(O&&M!=null&&E!=null){var{gridX:Un,gridY:jn,allColumnXs:kn,allColumnWidths:Gn,width:Mn}=E,Xi=kn.get(M),Zi=Gn.get(M);if(Xi!=null&&Zi!=null){var qt,zt,Xt,Ji=Un+Xi,Vn=jn-((qt=st.filterBarHeight)!==null&&qt!==void 0?qt:0),Bn=Zi+1,$n=((zt=st.filterBarHeight)!==null&&zt!==void 0?zt:0)-1,Qn={top:Vn,left:Ji,minWidth:Math.min(Bn,Mn-Ji),height:$n},Zt="",er=!0,Jt=this.getModelColumn(M);L(Jt);var ei=S.get(Jt),tr=R.get(Jt);ei!=null&&(Zt=ei.text,er=ei.filter!=null);var Hn=S.size!==0||R.size!==0;zi=s.jsx(ws,{ref:this.filterInputRef,style:Qn,className:Y({error:!er,active:Zt!==""||tr!=null,"iris-grid-has-filter":Hn}),isAdvancedFilterSet:tr!=null,onAdvancedFiltersTriggered:()=>{this.setState({shownAdvancedFilter:M})},onChange:this.handleFilterBarChange,onDone:this.handleFilterBarDone,onTab:this.handleFilterBarTab,onContextMenu:(Xt=this.grid)===null||Xt===void 0?void 0:Xt.handleContextMenu,debounceMs:Ln,value:Zt},M)}}var ir=null;if(oe!=null){var Wn=s.jsxs("div",{className:"iris-grid-loading-status",children:[s.jsx("div",{className:Y("iris-grid-loading-status-bar",{show:le}),children:oe}),s.jsxs("button",{type:"button",onClick:this.handleCancel,className:Y("iris-grid-btn-cancel",{show:_e}),children:[s.jsx(Z,{icon:Qr,transform:"down-1"}),"Cancel"]})]}),Kn=E?E.gridY:0;ir=s.jsx("div",{className:"iris-grid-loading",style:Le?{top:Kn}:{},children:Wn})}var rr=null;if(Ge!=null&&E){var ti;rr=this.getColumnTooltip(Ge,E,m),(ti=this.tooltip)===null||ti===void 0||ti.update()}var nr=[];if(E&&O)for(var{gridX:Yn,gridY:qn,visibleColumns:ar,allColumnXs:zn,allColumnWidths:Xn}=E,{filterBarHeight:ii}=st,Zn=function(){var re=ar[ri],Je=zn.get(re),Me=Xn.get(re),lt=i.getModelColumn(re);if(lt!=null){var ai=m.isFilterable(lt);if(ai&&Je!=null&&Me!=null&&Me>0){var oi=Yn+Je+Me-24,et=qn-(ii??0)+2,ut={position:"absolute",top:et,left:oi},si=R.get(lt),Ot=si!=null,dt=re===Ee||re===M||Ot,ct=s.jsx("div",{className:Y("advanced-filter-button-container",{hidden:!dt}),style:ut,children:dt&&s.jsx(W,{kind:"ghost",className:Y("btn-link-icon advanced-filter-button",{"filter-set":Ot}),onClick:()=>{i.setState({shownAdvancedFilter:re})},onContextMenu:li=>{var ui;(ui=i.grid)===null||ui===void 0||ui.handleContextMenu(li)},onMouseEnter:()=>{i.setState({hoverAdvancedFilter:re})},onMouseLeave:()=>{i.setState({hoverAdvancedFilter:null})},children:s.jsxs("div",{className:"fa-layers",children:[s.jsx(Z,{icon:_i,className:"filter-solid"}),s.jsx(Z,{icon:Pt,className:"filter-light"})]})})},re);nr.push(ct)}}},ri=0;ri<ar.length;ri+=1)Zn();var or=[];if(E)for(var{gridX:sr,visibleColumns:lr,allColumnXs:Jn,allColumnWidths:ea,columnHeaderHeight:ur}=E,ta=function(){var re=lr[ni],Je=Jn.get(re),Me=ea.get(re);if(Je!=null&&Me!=null&&Me>0){var lt=sr+Je,ai=sr+Je+Me-20,oi=O?{position:"absolute",top:ur,left:ai,width:20,height:st.filterBarHeight}:{position:"absolute",top:0,left:lt,width:Me,height:ur},et=i.getModelColumn(re);if(et!=null){var ut=m.columns[et];if(ut==null)return I.warn("Column does not exist at index ".concat(et," for column array of length ").concat(m.columns.length)),"continue";var si=R.get(et),{options:Ot}=si||{},dt=T.getSortForColumn(m.sort,ut.name),ct=dt?dt.direction:null;if(!Xa(ct))throw new Error("Invalid sort direction: ".concat(ct));var li=s.jsx("div",{className:"advanced-filter-menu-container",style:oi,children:s.jsx(Kr,{className:"advanced-filter-menu-popper",onEntered:i.getAdvancedMenuOpenedHandler(re),onExited:()=>{i.handleAdvancedMenuClosed(re)},isShown:He===re,interactive:!0,closeOnBlur:!0,options:{positionFixed:!0},children:i.getCachedAdvancedFilterMenuActions(m,ut,Ot,ct,te)})},re);or.push(li)}}},ni=0;ni<lr.length;ni+=1)var ia=ta();var dr=this.getCachedOptionItems(N!==void 0&&m.isChartBuilderAvailable,m.isCustomColumnsAvailable,m.isFormatColumnsAvailable,m.isRollupAvailable,m.isTotalsAvailable||qi,m.isSelectDistinctAvailable,m.isExportAvailable,this.toggleFilterBarAction,this.toggleSearchBarAction,this.toggleGotoRowAction,O,ki,g,this.isTableSearchAvailable(),Hi,F.size>0),cr=this.getCachedHiddenColumns(A,Wi),ra=ot.map(ye=>{switch(ye.type){case K.CHART_BUILDER:return s.jsx(go,{model:m,onChange:this.handleChartChange,onSubmit:this.handleChartCreate},K.CHART_BUILDER);case K.VISIBILITY_ORDERING_BUILDER:return s.jsx(vo,{model:m,movedColumns:H,hiddenColumns:cr,columnHeaderGroups:Vi,onColumnVisibilityChanged:this.handleColumnVisibilityChanged,onReset:this.handleColumnVisibilityReset,onMovedColumnsChanged:this.handleMovedColumnsChanged,onColumnHeaderGroupChanged:this.handleHeaderGroupsChanged},K.VISIBILITY_ORDERING_BUILDER);case K.CONDITIONAL_FORMATTING:return s.jsx(Nu,{rules:ue,onChange:this.handleConditionalFormatsChange,onCreate:this.handleConditionalFormatCreate,onSelect:this.handleConditionalFormatEdit});case K.CONDITIONAL_FORMATTING_EDIT:return L(m.columns),L(this.handleConditionalFormatEditorUpdate),s.jsx(ad,{dh:m.dh,columns:m.columns,rule:ae,onUpdate:this.handleConditionalFormatEditorUpdate,onSave:this.handleConditionalFormatEditorSave,onCancel:this.handleConditionalFormatEditorCancel});case K.CUSTOM_COLUMN_BUILDER:return s.jsx(po,{model:m,customColumns:Ft,onSave:this.handleUpdateCustomColumns,onCancel:this.handleMenuBack},K.CUSTOM_COLUMN_BUILDER);case K.ROLLUP_ROWS:return s.jsx(mo,{model:m,onChange:this.handleRollupChange,config:We},K.ROLLUP_ROWS);case K.AGGREGATIONS:return s.jsx(ho,{settings:Kt,isRollup:qi,onChange:this.handleAggregationsChange,onEdit:this.handleAggregationEdit});case K.AGGREGATION_EDIT:return Gi&&s.jsx(co,{aggregation:Gi,columns:m.originalColumns,onChange:this.handleAggregationChange});case K.TABLE_EXPORTER:return s.jsx(Ye,{model:m,name:f,userColumnWidths:Wi,movedColumns:H,isDownloading:Ht,tableDownloadStatus:Nt,tableDownloadProgress:he,tableDownloadEstimatedTime:Wt??void 0,onDownload:this.handleDownloadTable,onDownloadStart:this.handleDownloadTableStart,onCancel:this.handleCancelDownloadTable,selectedRanges:Qt},K.TABLE_EXPORTER);case K.SELECT_DISTINCT:return s.jsx(Tu,{model:m,selectDistinctColumns:Q,onChange:this.handleSelectDistinctChanged});case K.ADVANCED_SETTINGS:return s.jsx(ji,{items:F,onChange:w});default:throw Error("Unexpected option type ".concat(ye.type))}});return s.jsxs("div",{className:"iris-grid",role:"presentation",children:[s.jsxs("div",{className:"iris-grid-column",children:[u!=null&&s.jsx("div",{className:"iris-grid-bar",children:u}),s.jsx(Ei,{in:D,timeout:yi.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"iris-grid-partition-selector-wrapper iris-grid-bar iris-grid-bar-primary",children:Ni(m)&&m.isPartitionRequired&&Yt&&s.jsx(vu,{model:m,partitionConfig:Yt,onChange:this.handlePartitionChange})})}),s.jsx(Ei,{in:ki,timeout:yi.transitionSlowMs,classNames:"iris-grid-bar-horizontal",onEnter:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExit:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"iris-grid-bar",children:s.jsx(xt,{value:mn,selectedColumns:pn,invertSelection:vn,onChange:this.handleCrossColumnSearch,columns:m.columns,ref:this.crossColumnRef})})}),s.jsxs(No,{ref:ye=>{this.grid=ye},isStickyBottom:!Be(m)||!m.isEditable,isStuckToBottom:h,isStuckToRight:p,metricCalculator:A,model:m,keyHandlers:this.getKeyHandlers(),mouseHandlers:this.getMouseHandlers(),movedColumns:H,movedRows:q,onError:this.handleGridError,onViewChanged:this.handleViewChanged,onSelectionChanged:this.handleSelectionChanged,onMovedColumnsChanged:this.handleMovedColumnsChanged,renderer:this.renderer,stateOverride:xn,theme:st,children:[s.jsx(od,{isOpen:En,text:yn,onClose:this.handleOverflowClose}),Pn&&s.jsx(ru,{model:m,modelColumns:m.columns,top:Dn,bottom:In,left:Ki,right:Yi,filter:_n,formatter:te,sorts:Ze,reverseType:wt,movedColumns:H,customColumns:Ft,hiddenColumns:cr,alwaysFetchColumns:this.getAlwaysFetchColumns(v,m.columns,H,m.floatingLeftColumnCount,m.floatingRightColumnCount,(n=this.grid)===null||n===void 0||(a=n.state.draggingColumn)===null||a===void 0?void 0:a.range),formatColumns:this.getCachedPreviewFormatColumns(m.dh,m.columns,ue,ae,((o=ot[ot.length-1])===null||o===void 0?void 0:o.type)===K.CONDITIONAL_FORMATTING_EDIT?ve??void 0:void 0),rollupConfig:this.getModelRollupConfig(m.originalColumns,We,Kt),totalsConfig:this.getModelTotalsConfig(m.columns,We,Kt),selectDistinctColumns:Q,pendingRowCount:Cn,pendingDataMap:Mi,frozenColumns:bn,columnHeaderGroups:Vi,partitionConfig:Yt}),!x&&s.jsx("div",{className:"grid-settings-button",children:s.jsx(W,{kind:"ghost","data-testid":"btn-iris-grid-settings-button-".concat(f),onClick:this.handleMenu,icon:s.jsx(Z,{icon:Ba,transform:"up-1"}),tooltip:"Table Options"})}),zi,ir,nr,rr,or,Bi&&this.getOverflowButtonTooltip(Bi),$i&&this.getExpandCellTooltip($i),Qi&&this.getLinkHoverTooltip(Qi)]}),s.jsx(ud,{ref:this.gotoRowRef,model:m,isShown:Hi,gotoRow:wn,gotoRowError:Fn,gotoValueError:Nn,onGotoRowSubmit:this.handleGotoRowSelectedRowNumberSubmit,onGotoRowNumberChanged:this.handleGotoRowSelectedRowNumberChanged,onClose:this.handleGotoRowClosed,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:()=>{this.handleAnimationStart(),this.focus()},onExited:this.handleAnimationEnd,gotoValueSelectedColumnName:On,gotoValue:An,gotoValueFilter:Rn,onGotoValueSelectedColumnNameChanged:this.handleGotoValueSelectedColumnNameChanged,onGotoValueSelectedFilterChanged:this.handleGotoValueSelectedFilterChanged,onGotoValueChanged:this.handleGotoValueChanged,onGotoValueSubmit:this.handleGotoValueSubmitted}),s.jsx(gs,{error:fn,isSaving:gn!=null,saveTooltip:"Commit (".concat(this.commitAction.shortcut.getDisplayText(),")"),discardTooltip:"Discard (".concat(this.discardAction.shortcut.getDisplayText(),")"),pendingDataErrors:Sn,pendingDataMap:Mi,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,onSave:this.handlePendingCommitClicked,onDiscard:this.handlePendingDiscardClicked}),s.jsx(tu,{children:Tn}),s.jsx(bs,{model:m,copyOperation:z??void 0,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd}),s.jsx(fo,{dh:m.dh,ref:ye=>{this.tableSaver=ye},getDownloadWorker:d,onDownloadCompleted:this.handleDownloadCompleted,onDownloadCanceled:this.handleDownloadCanceled,onDownloadProgressUpdate:this.handleDownloadProgressUpdate,isDownloading:Nt===Ye.DOWNLOAD_STATUS.DOWNLOADING,formatter:te})]}),s.jsx(yo,{in:x,onEntering:this.handleAnimationStart,onEntered:this.handleAnimationEnd,onExiting:this.handleAnimationStart,onExited:this.handleAnimationEnd,mountOnEnter:!0,unmountOnExit:!0,children:s.jsx("div",{className:"table-sidebar",children:s.jsxs(Eo,{children:[s.jsx(fr,{title:"Table Options",onClose:this.handleMenuClose,children:s.jsx(qr,{onSelect:ye=>this.handleMenuSelect(dr[ye]),items:dr})}),ra.map((ye,re)=>s.jsx(fr,{title:ot[re].title,onBack:this.handleMenuBack,onClose:this.handleMenuClose,children:ye},ot[re].type))]})})}),s.jsx(U,{actions:this.contextActions})]})}}_(Pe,"contextType",Co);_(Pe,"minDebounce",150);_(Pe,"maxDebounce",500);_(Pe,"loadingSpinnerDelay",800);_(Pe,"defaultProps",{children:null,advancedFilters:Ve,advancedSettings:Ve,alwaysFetchColumns:de,conditionalFormats:de,customColumnFormatMap:Ve,isFilterBarShown:!1,applyInputFiltersOnInit:!1,movedColumns:de,movedRows:de,inputFilters:de,customFilters:de,onCreateChart:void 0,onColumnSelected:()=>{},onDataSelected:()=>{},onError:()=>{},onStateChange:()=>{},onAdvancedSettingsChange:()=>{},partitions:void 0,partitionConfig:void 0,quickFilters:Ve,selectDistinctColumns:de,sorts:de,reverseType:T.REVERSE_TYPE.NONE,customColumns:de,aggregationSettings:hn,rollupConfig:void 0,userColumnWidths:Ve,userRowHeights:Ve,onSelectionChanged:()=>{},isSelectingColumn:!1,isSelectingPartition:!1,isStuckToBottom:!1,isStuckToRight:!1,columnSelectionValidator:null,columnAllowedCursor:null,columnNotAllowedCursor:null,copyCursor:"copy",name:"table",onlyFetchVisibleColumns:!0,showSearchBar:!1,searchValue:"",selectedSearchColumns:null,invertSearchColumns:!0,onContextMenu:()=>de,pendingDataMap:Ve,getDownloadWorker:wo.getServiceWorker,settings:{timeZone:"America/New_York",defaultDateTimeFormat:Di.FULL_DATE_FORMAT,showTimeZone:!1,showTSeparator:!0,truncateNumbersWithPound:!1,showEmptyStrings:!0,showNullStrings:!0,formatter:de,decimalFormatOptions:At.shape({defaultFormatString:At.string}),integerFormatOptions:At.shape({defaultFormatString:At.string})},canCopy:!0,canDownloadCsv:!0,frozenColumns:null,theme:null,canToggleSearch:!0,mouseHandlers:de,keyHandlers:de});export{Pe as default};
3
- //# sourceMappingURL=IrisGrid-105d172d.js.map
3
+ //# sourceMappingURL=IrisGrid-2abddbb9.js.map