"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[2991],{2511:(e,n,t)=>{var r,l;t.d(n,{A:()=>r,v:()=>l}),function(e){e.Simple="SIMPLE",e.Sql="SQL"}(r||(r={})),function(e){e.Having="HAVING",e.Where="WHERE"}(l||(l={}))},22991:(e,n,t)=>{t.r(n),t.d(n,{default:()=>F});var r=t(96453),l=t(32142),a=t(53682),o=t(62952),i=t(86444),s=t(95579),u=t(96540),d=t(52720),c=t(15595),v=t(10504),h=t(67874),m=t(5815),p=t(23876),g=t(2445);const f=(0,r.I4)(c.Z9)`
  ${({theme:e,validateStatus:n})=>{var t,r;return`\n  .ant-slider-rail {\n    background-color: ${n?null==(t=e.colors[n])?void 0:t.light1:"#99e7f0"};\n  }\n\n  .ant-slider-track {\n    background-color: #f5f5f5;\n  }\n\n  &:hover {\n    .ant-slider-rail {\n      background-color: ${n?null==(r=e.colors[n])?void 0:r.base:"#6dd3e3"};\n    }\n\n    .ant-slider-track {\n      background-color: #e1e1e1;\n    }\n  }\n  `}}
`,b=r.I4.div`
  ${({theme:e,validateStatus:n,orientation:t,isOverflowing:r})=>{var l,a,o,i,s,u,c;return`\n    border: 1px solid transparent;\n    &:focus {\n      border: 1px solid\n        ${null==(l=e.colors[n||"primary"])?void 0:l.base};\n      outline: 0;\n      box-shadow: 0 0 0 3px\n        ${(0,d.rgba)(null==(a=e.colors[n||"primary"])?void 0:a.base,.2)};\n    }\n    & .ant-slider {\n      margin-top: ${t===v.QI.Horizontal?0:e.gridUnit}px;\n      margin-bottom: ${t===v.QI.Horizontal?0:5*e.gridUnit}px;\n\n      ${t===v.QI.Horizontal&&!r&&"line-height: 1.2;"}\n\n      & .ant-slider-track {\n        background-color: ${n&&(null==(o=e.colors[n])?void 0:o.light1)};\n      }\n      & .ant-slider-handle {\n        border: ${n&&`2px solid ${null==(i=e.colors[n])?void 0:i.light1}`};\n        &:focus {\n          box-shadow: 0 0 0 3px\n            ${(0,d.rgba)(null==(s=e.colors[n||"primary"])?void 0:s.base,.2)};\n        }\n      }\n      & .ant-slider-mark {\n        font-size: ${e.typography.sizes.s}px;\n      }\n\n      &:hover {\n        & .ant-slider-track {\n          background-color: ${n&&(null==(u=e.colors[n])?void 0:u.base)};\n        }\n        & .ant-slider-handle {\n          border: ${n&&`2px solid ${null==(c=e.colors[n])?void 0:c.base}`};\n        }\n      }\n    }\n  `}}
`,x=(0,l.gV)(a.A.SMART_NUMBER),$=e=>x(e),S=(e,n)=>null!==e&&null!==n&&e===n?`x = ${x(e)}`:null!==e&&null!==n?`${x(e)} ≤ x ≤ ${x(n)}`:null!==e?`x ≥ ${x(e)}`:null!==n?`x ≤ ${x(n)}`:"",k=(e,n)=>{const t={};return null!==e&&(t[e]=x(e)),null!==n&&(t[n]=x(n)),t};function F(e){const{data:n,formData:t,height:r,width:l,setDataMask:a,setFocusedFilter:d,unsetFocusedFilter:v,setHoveredFilter:x,unsetHoveredFilter:F,setFilterActive:M,filterState:C,inputRef:w,filterBarOrientation:y,isOverflowingFilterBar:N}=e,[A]=n,{min:I,max:E}=A,{groupby:O,defaultValue:H,enableSingleValue:Y}=t,q=Y===p.y.Minimum,T=Y===p.y.Maximum,U=Y===p.y.Exact,z=void 0===Y,[B=""]=(0,o.A)(O).map(i.A),[D,J]=(0,u.useState)(null!=H?H:[I,U?I:E]),[L,Q]=(0,u.useState)({}),R=null!=D?D:[I,E],V=(0,u.useCallback)((e=>{const[n,t]=e;return U?{lower:n,upper:t}:{lower:n>I?n:null,upper:t<E?t:null}}),[E,I,U]),Z=(0,u.useCallback)((e=>{J(e);const{lower:n,upper:t}=V(e);Q(k(n,t)),a({extraFormData:(0,m.SO)(B,n,t),filterState:{value:null!==n||null!==t?e:null,label:S(n,t)}})}),[B,V,a]),P=(0,u.useCallback)((e=>{J(e)}),[]);(0,u.useEffect)((()=>{var e;if(void 0===(null==A?void 0:A.min)&&void 0===(null==A?void 0:A.max))return;let n=null!=(e=C.value)?e:[I,E];if(T){const e=n[1]<=R[1]?n[1]:R[1];n=[I,e]}else q?n=[n[0]>=R[0]?n[0]:R[0],E]:U&&(n=[R[0],R[0]]);Z(n)}),[T,q,U,JSON.stringify(C.value),JSON.stringify(n)]);const W=(0,u.useMemo)((()=>{if(C.validateMessage)return(0,g.Y)(h.Mo,{status:C.validateStatus,children:C.validateMessage})}),[C.validateMessage,C.validateStatus]);(0,u.useEffect)((()=>{T&&Z([I,R[1]])}),[T]),(0,u.useEffect)((()=>{q&&Z([R[0],E])}),[q]),(0,u.useEffect)((()=>{U&&Z([R[0],R[0]])}),[U]);const j=E-I<=1?((e,n)=>{const t=(n-e)/20,r=`1E${Math.floor(Math.log10(t))}`;return Math.min(1,parseFloat(r))})(I,E):1;return(0,g.Y)(h.j3,{height:r,width:l,children:Number.isNaN(Number(I))||Number.isNaN(Number(E))?(0,g.Y)("h4",{children:(0,s.t)("Chosen non-numeric column")}):(0,g.Y)(h.JF,{"aria-labelledby":`filter-name-${t.nativeFilterId}`,extra:W,children:(0,g.FD)(b,{tabIndex:-1,ref:w,validateStatus:C.validateStatus,orientation:y,isOverflowing:N,onFocus:d,onBlur:v,onMouseEnter:x,onMouseLeave:F,onMouseDown:()=>M(!0),onMouseUp:()=>M(!1),children:[T&&(0,g.Y)(c.Z9,{min:I,max:E,step:j,value:R[1],tipFormatter:$,marks:L,onAfterChange:e=>Z([I,e]),onChange:e=>P([I,e])}),q&&(0,g.Y)(f,{validateStatus:C.validateStatus,min:I,max:E,step:j,value:R[0],tipFormatter:$,marks:L,onAfterChange:e=>Z([e,E]),onChange:e=>P([e,E])}),U&&(0,g.Y)(c.Z9,{min:I,max:E,step:j,included:!1,value:R[0],tipFormatter:$,marks:L,onAfterChange:e=>Z([e,e]),onChange:e=>P([e,e])}),z&&(0,g.Y)(c.Z9,{range:!0,min:I,max:E,step:j,value:R,onAfterChange:Z,onChange:P,tipFormatter:$,marks:L})]})})})}},67874:(e,n,t)=>{t.d(n,{JF:()=>i,Mo:()=>s,YH:()=>a,j3:()=>o});var r=t(96453),l=t(86523);const a=0,o=r.I4.div`
  min-height: ${({height:e})=>e}px;
  width: ${({width:e})=>e===a?"100%":`${e}px`};
`,i=(0,r.I4)(l.A)`
  &.ant-row.ant-form-item {
    margin: 0;
  }
`,s=r.I4.div`
  color: ${({theme:e,status:n="error"})=>{var t;return null==(t=e.colors[n])?void 0:t.base}};
`},5815:(e,n,t)=>{t.d(n,{SO:()=>i,Sg:()=>s,pA:()=>o});var r=t(87903),l=t(15151),a=t(2511);const o=(e,n,t=!1,r=!1)=>{const l={};return t?l.adhoc_filters=[{expressionType:a.A.Sql,clause:a.v.Where,sqlExpression:"1 = 0"}]:null!=n&&0!==n.length&&(l.filters=[{col:e,op:r?"NOT IN":"IN",val:n}]),l},i=(e,n,t)=>{const r=[];return null!=n&&n!==t&&r.push({col:e,op:">=",val:n}),null!=t&&t!==n&&r.push({col:e,op:"<=",val:t}),null!=t&&null!=n&&t===n&&r.push({col:e,op:"==",val:t}),r.length?{filters:r}:{}};function s({timeFormatter:e,numberFormatter:n}={}){return(t,a)=>{if(null==t)return l.mu;if("boolean"==typeof t)return t?l.PU:l.qC;if(a===r.s.Boolean)try{return JSON.parse(String(t).toLowerCase())?l.PU:l.qC}catch{return l.qC}return"string"==typeof t?t:e&&a===r.s.Temporal?e(t):n&&"number"==typeof t&&a===r.s.Numeric?n(t):String(t)}}}}]);