(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[665],{45578:(e,t,a)=>{var n=a(67206),r=a(45652);e.exports=function(e,t){return e&&e.length?r(e,n(t,2)):[]}},52630:(e,t,a)=>{"use strict";t.iB=t.YM=void 0;var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},r=s(a(67294)),l=s(a(45697)),i=a(2371);function s(e){return e&&e.__esModule?e:{default:e}}t.YM=function(e){var t=e.itemTypeToComponent,a=e.WrapperComponent,s=void 0===a?"div":a,o=function(e){var a=e.currentPage,l=e.totalPages,o=e.boundaryPagesRange,d=e.siblingPagesRange,u=e.hideEllipsis,c=e.hidePreviousAndNextPageLinks,h=e.hideFirstAndLastPageLinks,p=e.onChange,g=e.disabled,m=function(e,t){var a={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(a[n]=e[n]);return a}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),f=(0,i.getPaginationModel)({currentPage:a,totalPages:l,boundaryPagesRange:o,siblingPagesRange:d,hideEllipsis:u,hidePreviousAndNextPageLinks:c,hideFirstAndLastPageLinks:h}),v=function(e,t,a){return function(l){var i,s,o,d=e[l.type],u=(s=(i=l).value,o=i.isDisabled,function(){!o&&a&&t!==s&&a(s)});return r.default.createElement(d,n({onClick:u},l))}}(t,a,p);return r.default.createElement(s,m,f.map((function(e){return v(n({},e,{isDisabled:!!g}))})))};return o.propTypes={currentPage:l.default.number.isRequired,totalPages:l.default.number.isRequired,boundaryPagesRange:l.default.number,siblingPagesRange:l.default.number,hideEllipsis:l.default.bool,hidePreviousAndNextPageLinks:l.default.bool,hideFirstAndLastPageLinks:l.default.bool,onChange:l.default.func,disabled:l.default.bool},o},t.iB=i.ITEM_TYPES},51794:(e,t,a)=>{"use strict";a.d(t,{Z:()=>r});var n=a(67294);const r=(e,t)=>{var a,r;const[l,i]=(0,n.useState)(0),[s,o]=(0,n.useState)(!1),d=(0,n.useRef)({scrollWidth:0,parentElementWidth:0,plusRefWidth:0});return(0,n.useLayoutEffect)((()=>{var a;const n=e.current,r=null==t?void 0:t.current;if(!n)return;const{scrollWidth:l,clientWidth:s,childNodes:u}=n,c=d.current,h=(null==(a=n.parentElement)?void 0:a.clientWidth)||0,p=(null==r?void 0:r.offsetWidth)||0;if(d.current={scrollWidth:l,parentElementWidth:h,plusRefWidth:p},c.parentElementWidth!==h||c.scrollWidth!==l||c.plusRefWidth!==p)if(l>s){const e=6,t=(null==r?void 0:r.offsetWidth)||0,a=s-e,n=u.length;let l=0,d=0;for(let r=0;r<n;r+=1)a-e-l-t<=0&&(d+=1),l+=u[r].offsetWidth;n>1&&d?(o(!0),i(d)):(o(!1),i(1))}else o(!1),i(0)}),[null==(a=e.current)?void 0:a.offsetWidth,null==(r=e.current)?void 0:r.clientWidth,e]),[l,s]}},54070:(e,t,a)=>{"use strict";a.d(t,{w:()=>s}),a(67294);var n=a(58593),r=a(83379),l=a(61988),i=a(11965);const s=({user:e,date:t})=>{const a=(0,i.tZ)("span",{className:"no-wrap"},t);if(e){const t=(0,r.Z)(e),s=(0,l.t)("Modified by: %s",t);return(0,i.tZ)(n.u,{title:s,placement:"bottom"},a)}return a}},27989:(e,t,a)=>{"use strict";a.d(t,{Z:()=>g});var n=a(67294),r=a(51995),l=a(61988),i=a(35932),s=a(74069),o=a(4715),d=a(34858),u=a(60972),c=a(11965);const h=r.iK.div`
  display: block;
  color: ${({theme:e})=>e.colors.grayscale.base};
  font-size: ${({theme:e})=>e.typography.sizes.s}px;
`,p=r.iK.div`
  padding-bottom: ${({theme:e})=>2*e.gridUnit}px;
  padding-top: ${({theme:e})=>2*e.gridUnit}px;

  & > div {
    margin: ${({theme:e})=>e.gridUnit}px 0;
  }

  &.extra-container {
    padding-top: 8px;
  }

  .confirm-overwrite {
    margin-bottom: ${({theme:e})=>2*e.gridUnit}px;
  }

  .input-container {
    display: flex;
    align-items: center;

    label {
      display: flex;
      margin-right: ${({theme:e})=>2*e.gridUnit}px;
    }

    i {
      margin: 0 ${({theme:e})=>e.gridUnit}px;
    }
  }

  input,
  textarea {
    flex: 1 1 auto;
  }

  textarea {
    height: 160px;
    resize: none;
  }

  input::placeholder,
  textarea::placeholder {
    color: ${({theme:e})=>e.colors.grayscale.light1};
  }

  textarea,
  input[type='text'],
  input[type='number'] {
    padding: ${({theme:e})=>1.5*e.gridUnit}px
      ${({theme:e})=>2*e.gridUnit}px;
    border-style: none;
    border: 1px solid ${({theme:e})=>e.colors.grayscale.light2};
    border-radius: ${({theme:e})=>e.gridUnit}px;

    &[name='name'] {
      flex: 0 1 auto;
      width: 40%;
    }

    &[name='sqlalchemy_uri'] {
      margin-right: ${({theme:e})=>3*e.gridUnit}px;
    }
  }
`,g=({resourceName:e,resourceLabel:t,passwordsNeededMessage:a,confirmOverwriteMessage:r,onModelImport:g,show:m,onHide:f,passwordFields:v=[],setPasswordFields:b=(()=>{}),sshTunnelPasswordFields:y=[],setSSHTunnelPasswordFields:_=(()=>{}),sshTunnelPrivateKeyFields:P=[],setSSHTunnelPrivateKeyFields:E=(()=>{}),sshTunnelPrivateKeyPasswordFields:S=[],setSSHTunnelPrivateKeyPasswordFields:w=(()=>{})})=>{const[T,Z]=(0,n.useState)(!0),[k,I]=(0,n.useState)({}),[N,L]=(0,n.useState)(!1),[x,A]=(0,n.useState)(!1),[C,M]=(0,n.useState)([]),[R,F]=(0,n.useState)(!1),[$,K]=(0,n.useState)(),[O,D]=(0,n.useState)({}),[H,U]=(0,n.useState)({}),[W,Y]=(0,n.useState)({}),z=()=>{M([]),b([]),I({}),L(!1),A(!1),F(!1),K(""),_([]),E([]),w([]),D({}),U({}),Y({})},{state:{alreadyExists:G,passwordsNeeded:B,sshPasswordNeeded:q,sshPrivateKeyNeeded:V,sshPrivateKeyPasswordNeeded:j},importResource:X}=(0,d.PW)(e,t,(e=>{K(e)}));(0,n.useEffect)((()=>{b(B),B.length>0&&F(!1)}),[B,b]),(0,n.useEffect)((()=>{L(G.length>0),G.length>0&&F(!1)}),[G,L]),(0,n.useEffect)((()=>{_(q),q.length>0&&F(!1)}),[q,_]),(0,n.useEffect)((()=>{E(V),V.length>0&&F(!1)}),[V,E]),(0,n.useEffect)((()=>{w(j),j.length>0&&F(!1)}),[j,w]);return T&&m&&Z(!1),(0,c.tZ)(s.default,{name:"model",className:"import-model-modal",disablePrimaryButton:0===C.length||N&&!x||R,onHandledPrimaryAction:()=>{var e;(null==(e=C[0])?void 0:e.originFileObj)instanceof File&&(F(!0),X(C[0].originFileObj,k,O,H,W,x).then((e=>{e&&(z(),g())})))},onHide:()=>{Z(!0),f(),z()},primaryButtonName:N?(0,l.t)("Overwrite"):(0,l.t)("Import"),primaryButtonType:N?"danger":"primary",width:"750px",show:m,title:(0,c.tZ)("h4",null,(0,l.t)("Import %s",t))},(0,c.tZ)(p,null,(0,c.tZ)(o.gq,{name:"modelFile",id:"modelFile",accept:".yaml,.json,.yml,.zip",fileList:C,onChange:e=>{M([{...e.file,status:"done"}])},onRemove:e=>(M(C.filter((t=>t.uid!==e.uid))),!1),customRequest:()=>{},disabled:R},(0,c.tZ)(i.Z,{loading:R},(0,l.t)("Select file")))),$&&(0,c.tZ)(u.Z,{errorMessage:$,showDbInstallInstructions:v.length>0||y.length>0||P.length>0||S.length>0}),(()=>{if(0===v.length&&0===y.length&&0===P.length&&0===S.length)return null;const e=[...new Set([...v,...y,...P,...S])];return(0,c.tZ)(n.Fragment,null,(0,c.tZ)("h5",null,(0,l.t)("Database passwords")),(0,c.tZ)(h,null,a),e.map((e=>(0,c.tZ)(n.Fragment,null,(null==v?void 0:v.indexOf(e))>=0&&(0,c.tZ)(p,{key:`password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,l.t)("%s PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`password-${e}`,autoComplete:`password-${e}`,type:"password",value:k[e],onChange:t=>I({...k,[e]:t.target.value})})),(null==y?void 0:y.indexOf(e))>=0&&(0,c.tZ)(p,{key:`ssh_tunnel_password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,l.t)("%s SSH TUNNEL PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`ssh_tunnel_password-${e}`,autoComplete:`ssh_tunnel_password-${e}`,type:"password",value:O[e],onChange:t=>D({...O,[e]:t.target.value})})),(null==P?void 0:P.indexOf(e))>=0&&(0,c.tZ)(p,{key:`ssh_tunnel_private_key-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,l.t)("%s SSH TUNNEL PRIVATE KEY",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("textarea",{name:`ssh_tunnel_private_key-${e}`,autoComplete:`ssh_tunnel_private_key-${e}`,value:H[e],onChange:t=>U({...H,[e]:t.target.value})})),(null==S?void 0:S.indexOf(e))>=0&&(0,c.tZ)(p,{key:`ssh_tunnel_private_key_password-for-${e}`},(0,c.tZ)("div",{className:"control-label"},(0,l.t)("%s SSH TUNNEL PRIVATE KEY PASSWORD",e.slice(10)),(0,c.tZ)("span",{className:"required"},"*")),(0,c.tZ)("input",{name:`ssh_tunnel_private_key_password-${e}`,autoComplete:`ssh_tunnel_private_key_password-${e}`,type:"password",value:W[e],onChange:t=>Y({...W,[e]:t.target.value})}))))))})(),N?(0,c.tZ)(n.Fragment,null,(0,c.tZ)(p,null,(0,c.tZ)("div",{className:"confirm-overwrite"},r),(0,c.tZ)("div",{className:"control-label"},(0,l.t)('Type "%s" to confirm',(0,l.t)("OVERWRITE"))),(0,c.tZ)("input",{id:"overwrite",type:"text",onChange:e=>{var t,a;const n=null!=(t=null==(a=e.currentTarget)?void 0:a.value)?t:"";A(n.toUpperCase()===(0,l.t)("OVERWRITE"))}}))):null)}},83556:(e,t,a)=>{"use strict";a.d(t,{P:()=>c});var n=a(67294),r=a(51995),l=a(59361),i=a(58593),s=a(11965);const o=(0,r.iK)(l.Z)`
  ${({theme:e})=>`\n  margin-top: ${e.gridUnit}px;\n  margin-bottom: ${e.gridUnit}px;\n  font-size: ${e.typography.sizes.s}px;\n  `};
`,d=({name:e,id:t,index:a,onDelete:r,editable:l=!1,onClick:d,toolTipTitle:u=e})=>{const c=(0,n.useMemo)((()=>e.length>20),[e])?`${e.slice(0,20)}...`:e;return(0,s.tZ)(n.Fragment,null,l?(0,s.tZ)(i.u,{title:u,key:u},(0,s.tZ)(o,{key:t,closable:l,onClose:()=>a?null==r?void 0:r(a):null,color:"blue"},c)):(0,s.tZ)(i.u,{title:u,key:u},(0,s.tZ)(o,{role:"link",key:t,onClick:d},t?(0,s.tZ)("a",{href:`/superset/all_entities/?id=${t}`,target:"_blank",rel:"noreferrer"},c):c)))},u=r.iK.div`
  max-width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
`,c=({tags:e,editable:t=!1,onDelete:a,maxTags:r})=>{const[l,i]=(0,n.useState)(r),o=e=>{null==a||a(e)},c=(0,n.useMemo)((()=>l?e.length>l:null),[e.length,l]),h=(0,n.useMemo)((()=>"number"==typeof l?e.length-l+1:null),[c,e.length,l]);return(0,s.tZ)(u,{className:"tag-list"},c&&"number"==typeof l?(0,s.tZ)(n.Fragment,null,e.slice(0,l-1).map(((e,a)=>(0,s.tZ)(d,{id:e.id,key:e.id,name:e.name,index:a,onDelete:o,editable:t}))),e.length>l?(0,s.tZ)(d,{name:`+${h}...`,onClick:()=>i(void 0),toolTipTitle:e.map((e=>e.name)).join(", ")}):null):(0,s.tZ)(n.Fragment,null,e.map(((e,a)=>(0,s.tZ)(d,{id:e.id,key:e.id,name:e.name,index:a,onDelete:o,editable:t}))),r&&e.length>r?(0,s.tZ)(d,{name:"...",onClick:()=>i(r)}):null))}},1510:(e,t,a)=>{"use strict";a.d(t,{GW:()=>y,Rz:()=>b,X3:()=>m,on:()=>p,vk:()=>g,zi:()=>h});var n=a(5364),r=a(16355),l=a(93185),i=a(61988),s=a(70400),o=a(81255),d=a(80621),u=a(20292);const c=()=>{var e,t;const a=(0,u.Z)();return(null==a||null==(e=a.common)||null==(t=e.conf)?void 0:t.NATIVE_FILTER_DEFAULT_ROW_LIMIT)||1e3},h=({datasetId:e,dependencies:t={},groupby:a,defaultDataMask:n,controlValues:r,filterType:l,sortMetric:i,adhoc_filters:o,time_range:d,granularity_sqla:u,type:h,dashboardId:p,id:g})=>{var m;const f={};return e&&(f.datasource=`${e}__table`),a&&(f.groupby=[a]),i&&(f.sortMetric=i),{...r,...f,adhoc_filters:null!=o?o:[],extra_filters:[],extra_form_data:t,granularity_sqla:u,metrics:["count"],row_limit:c(),showSearch:!0,defaultValue:null==n||null==(m=n.filterState)?void 0:m.value,time_range:d,url_params:(0,s.Z)("regular"),inView:!0,viz_type:l,type:h,dashboardId:p,native_filter_id:g}};function p(e={},t={}){const a={};return n.Ci.forEach((n=>{const r=[...e[n]||[],...t[n]||[]];r.length&&(a[n]=r)})),n.Ay.forEach((n=>{const r=e[n];void 0!==r&&(a[n]=r);const l=t[n];void 0!==l&&(a[n]=l)})),a}function g(e,t){let a={};return t.forEach((t=>{var n,r;a=p(a,null!=(n=null==(r=e[t])?void 0:r.extraFormData)?n:{})})),a}function m(e){return!e.includes(r.cg.NativeFilter)||(0,l.cr)(l.TT.DashboardCrossFilters)&&e.includes(r.cg.InteractiveChart)}const f=(e,t)=>{var a;return(null==e||null==(a=e[t])?void 0:a.type)===o.gn},v=(e,t,a,n,r,l)=>{var i,s,d,u,c,h;l.has(a)||(l.add(a),(null==e||null==(i=e[a])?void 0:i.type)===o.dW&&t.includes(null==(s=e[a])||null==(d=s.meta)?void 0:d.chartId)&&n.forEach(r.add,r),0===(null==e||null==(u=e[a])||null==(c=u.children)?void 0:c.length)||f(e,a)&&r.has(a)||null==(h=e[a])||h.children.forEach((a=>v(e,t,a,f(e,a)?[...n,a]:n,r,l))))},b=(e,t)=>{const a=e[d._4].children[0],n=a!==d.PV,r=new Set,l=new Set;var i,s;return n?null==(i=e[a])||null==(s=i.children)||s.forEach((a=>v(e,t,a,[a],r,l))):Object.values(e).filter((e=>(null==e?void 0:e.type)===o.gn)).forEach((a=>v(e,t,a.id,[a.id],r,l))),r},y=e=>null==e?"":"string"==typeof e||"number"==typeof e?`${e}`:Array.isArray(e)?e.join(", "):"object"==typeof e?JSON.stringify(e):(0,i.t)("Unknown value")},33320:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>ee});var n=a(45578),r=a.n(n),l=a(51995),i=a(61988),s=a(11064),o=a(31069),d=a(55786),u=a(93185),c=a(67294),h=a(15926),p=a.n(h),g=a(28216),m=a(40768),f=a(34858),v=a(32228),b=a(19259),y=a(83556),_=a(86074),P=a(36674),E=a(16550),S=a(73727),w=a(93139),T=a(51794),Z=a(58593),k=a(11965);const I=l.iK.div`
  .link {
    color: ${({theme:e})=>e.colors.grayscale.light5};
    display: block;
    text-decoration: underline;
  }
`;function N({children:e,crossLinks:t=[],moreItems:a,show:n=!1}){return(0,k.tZ)(Z.u,{placement:"top",title:n&&(0,k.tZ)(I,null,t.map((e=>(0,k.tZ)(S.rU,{className:"link",key:e.to,to:e.to,target:"_blank",rel:"noreferer noopener"},e.title))),a&&(0,k.tZ)("span",null,(0,i.t)("+ %s more",a)))},e)}const L=l.iK.div`
  ${({theme:e})=>`\n    & > span {\n      width: 100%;\n      display: flex;\n\n      .ant-tooltip-open {\n        display: inline;\n      }\n\n      .truncated {\n        overflow: hidden;\n        text-overflow: ellipsis;\n        white-space: nowrap;\n        display: inline-block;\n        width: 100%;\n        vertical-align: bottom;\n      }\n\n      .count {\n        cursor: pointer;\n        color: ${e.colors.grayscale.base};\n        font-weight: ${e.typography.weights.bold};\n      }\n    }\n  `}
`;function x({crossLinks:e,maxLinks:t=20,linkPrefix:a="/superset/dashboard/"}){const n=(0,c.useRef)(null),r=(0,c.useRef)(null),[l,i]=(0,T.Z)(n,r),s=(0,c.useMemo)((()=>e.length>t?e.length-t:void 0),[e,t]),o=(0,c.useMemo)((()=>(0,k.tZ)("span",{className:"truncated",ref:n},e.map(((e,t)=>(0,k.tZ)(S.rU,{key:e.id,to:a+e.id,target:"_blank",rel:"noreferer noopener"},0===t?e.title:`, ${e.title}`))))),[e]),d=(0,c.useMemo)((()=>e.slice(0,t).map((e=>({title:e.title,to:a+e.id})))),[e,t]);return(0,k.tZ)(L,null,(0,k.tZ)(N,{moreItems:s,crossLinks:d,show:!!l},o,i&&(0,k.tZ)("span",{ref:r,className:"count"},"+",l)))}var A=a(38703),C=a(61337),M=a(14114),R=a(83673),F=a(27989),$=a(70707),K=a(1510),O=a(8272),D=a(79789),H=a(85931),U=a(60718),W=a(34581),Y=a(8494),z=a(12617),G=a(54070),B=a(12);const q=l.iK.div`
  align-items: center;
  display: flex;

  a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
  }

  svg {
    margin-right: ${({theme:e})=>e.gridUnit}px;
  }
`,V=(0,i.t)('The passwords for the databases below are needed in order to import them together with the charts. Please note that the "Secure Extra" and "Certificate" sections of the database configuration are not present in export files, and should be added manually after the import if they are needed.'),j=(0,i.t)("You are importing one or more charts that already exist. Overwriting might cause you to lose some of your work. Are you sure you want to overwrite?"),X=(0,s.Z)(),J=async(e="",t,a)=>{var n;const l=e?{filters:[{col:"table_name",opr:"sw",value:e}]}:{},i=p().encode({columns:["datasource_name","datasource_id"],keys:["none"],order_column:"table_name",order_direction:"asc",page:t,page_size:a,...l}),{json:s={}}=await o.Z.get({endpoint:`/api/v1/dataset/?q=${i}`}),d=null==s||null==(n=s.result)?void 0:n.map((({table_name:e,id:t})=>({label:e,value:t})));return{data:r()(d,"value"),totalCount:null==s?void 0:s.count}},Q=l.iK.div`
  color: ${({theme:e})=>e.colors.grayscale.base};
`,ee=(0,M.ZP)((function(e){const{addDangerToast:t,addSuccessToast:a,user:{userId:n}}=e,l=(0,E.k6)(),{state:{loading:s,resourceCount:h,resourceCollection:T,bulkSelectEnabled:I},setResourceCollection:N,hasPerm:L,fetchData:M,toggleBulkSelect:ee,refreshData:te}=(0,f.Yi)("chart",(0,i.t)("chart"),t),ae=(0,c.useMemo)((()=>T.map((e=>e.id))),[T]),{roles:ne}=(0,g.v9)((e=>e.user)),re=(0,z.R)("can_read","Tag",ne),[le,ie]=(0,f.NE)("chart",ae,t),{sliceCurrentlyEditing:se,handleChartUpdated:oe,openChartEditModal:de,closeChartEditModal:ue}=(0,f.fF)(N,T),[ce,he]=(0,c.useState)(!1),[pe,ge]=(0,c.useState)([]),[me,fe]=(0,c.useState)(!1),[ve,be]=(0,c.useState)([]),[ye,_e]=(0,c.useState)([]),[Pe,Ee]=(0,c.useState)([]),Se=(0,C.OH)(null==n?void 0:n.toString(),null),we=L("can_write"),Te=L("can_write"),Ze=L("can_write"),ke=L("can_export"),Ie=[{id:"changed_on_delta_humanized",desc:!0}],Ne=e=>{const t=e.map((({id:e})=>e));(0,v.Z)("chart",t,(()=>{fe(!1)})),fe(!0)},Le=async(e="",a,n)=>{var l,s,d;const u=e?{filters:[{col:"dashboard_title",opr:w.p.StartsWith,value:e}]}:{},c=p().encode({columns:["dashboard_title","id"],keys:["none"],order_column:"dashboard_title",order_direction:"asc",page:a,page_size:n,...u}),h=await o.Z.get({endpoint:`/api/v1/dashboard/?q=${c}`}).catch((()=>t((0,i.t)("An error occurred while fetching dashboards")))),g=null==h||null==(l=h.json)||null==(s=l.result)?void 0:s.map((({dashboard_title:e,id:t})=>({label:e,value:t})));return{data:r()(g,"value"),totalCount:null==h||null==(d=h.json)?void 0:d.count}},xe=(0,c.useMemo)((()=>[{Cell:({row:{original:{id:e}}})=>n&&(0,k.tZ)(P.Z,{itemId:e,saveFaveStar:le,isStarred:ie[e]}),Header:"",id:"id",disableSortBy:!0,size:"xs",hidden:!n},{Cell:({row:{original:{url:e,slice_name:t,certified_by:a,certification_details:n,description:r}}})=>(0,k.tZ)(q,null,(0,k.tZ)(S.rU,{to:e},a&&(0,k.tZ)(c.Fragment,null,(0,k.tZ)(D.Z,{certifiedBy:a,details:n})," "),t),r&&(0,k.tZ)(O.Z,{tooltip:r})),Header:(0,i.t)("Name"),accessor:"slice_name"},{Cell:({row:{original:{viz_type:e}}})=>{var t;return(null==(t=X.get(e))?void 0:t.name)||e},Header:(0,i.t)("Type"),accessor:"viz_type",size:"xxl"},{Cell:({row:{original:{datasource_name_text:e,datasource_url:t}}})=>(0,k.tZ)(H.m,{to:t},e),Header:(0,i.t)("Dataset"),accessor:"datasource_id",disableSortBy:!0,size:"xl"},{Cell:({row:{original:{dashboards:e}}})=>(0,k.tZ)(x,{crossLinks:(0,d.Z)(e).map((e=>({title:e.dashboard_title,id:e.id})))}),Header:(0,i.t)("Dashboards added to"),accessor:"dashboards",disableSortBy:!0,size:"xxl",hidden:!0},{Cell:({row:{original:{tags:e=[]}}})=>(0,k.tZ)(y.P,{tags:e.filter((e=>!e.type||1===e.type||"TagTypes.custom"===e.type)),maxTags:3}),Header:(0,i.t)("Tags"),accessor:"tags",disableSortBy:!0,hidden:!(0,u.cr)(u.TT.TaggingSystem)},{Cell:({row:{original:{owners:e=[]}}})=>(0,k.tZ)(W.Z,{users:e}),Header:(0,i.t)("Owners"),accessor:"owners",disableSortBy:!0,size:"xl"},{Cell:({row:{original:{changed_on_delta_humanized:e,changed_by:t}}})=>(0,k.tZ)(G.w,{date:e,user:t}),Header:(0,i.t)("Last modified"),accessor:"last_saved_at",size:"xl"},{Cell:({row:{original:e}})=>Te||Ze||ke?(0,k.tZ)(Q,{className:"actions"},Ze&&(0,k.tZ)(b.Z,{title:(0,i.t)("Please confirm"),description:(0,k.tZ)(c.Fragment,null,(0,i.t)("Are you sure you want to delete")," ",(0,k.tZ)("b",null,e.slice_name),"?"),onConfirm:()=>(0,m.Gm)(e,a,t,te)},(e=>(0,k.tZ)(Z.u,{id:"delete-action-tooltip",title:(0,i.t)("Delete"),placement:"bottom"},(0,k.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:e},(0,k.tZ)($.Z.Trash,null))))),ke&&(0,k.tZ)(Z.u,{id:"export-action-tooltip",title:(0,i.t)("Export"),placement:"bottom"},(0,k.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>Ne([e])},(0,k.tZ)($.Z.Share,null))),Te&&(0,k.tZ)(Z.u,{id:"edit-action-tooltip",title:(0,i.t)("Edit"),placement:"bottom"},(0,k.tZ)("span",{role:"button",tabIndex:0,className:"action-button",onClick:()=>de(e)},(0,k.tZ)($.Z.EditAlt,null)))):null,Header:(0,i.t)("Actions"),id:"actions",disableSortBy:!0,hidden:!Te&&!Ze},{accessor:B.J.ChangedBy,hidden:!0}]),[n,Te,Ze,ke,le,ie,te,a,t]),Ae=(0,c.useMemo)((()=>({Header:(0,i.t)("Favorite"),key:"favorite",id:"id",urlDisplay:"favorite",input:"select",operator:w.p.ChartIsFav,unfilteredLabel:(0,i.t)("Any"),selects:[{label:(0,i.t)("Yes"),value:!0},{label:(0,i.t)("No"),value:!1}]})),[]),Ce=(0,c.useMemo)((()=>[{Header:(0,i.t)("Name"),key:"search",id:"slice_name",input:"search",operator:w.p.ChartAllText},{Header:(0,i.t)("Type"),key:"viz_type",id:"viz_type",input:"select",operator:w.p.Equals,unfilteredLabel:(0,i.t)("All"),selects:X.keys().filter((e=>{var t;return(0,K.X3)((null==(t=X.get(e))?void 0:t.behaviors)||[])})).map((e=>{var t;return{label:(null==(t=X.get(e))?void 0:t.name)||e,value:e}})).sort(((e,t)=>e.label&&t.label?e.label>t.label?1:e.label<t.label?-1:0:0))},{Header:(0,i.t)("Dataset"),key:"dataset",id:"datasource_id",input:"select",operator:w.p.Equals,unfilteredLabel:(0,i.t)("All"),fetchSelects:J,paginate:!0},...(0,u.cr)(u.TT.TaggingSystem)&&re?[{Header:(0,i.t)("Tag"),key:"tags",id:"tags",input:"select",operator:w.p.ChartTags,unfilteredLabel:(0,i.t)("All"),fetchSelects:U.m}]:[],{Header:(0,i.t)("Owner"),key:"owner",id:"owners",input:"select",operator:w.p.RelationManyMany,unfilteredLabel:(0,i.t)("All"),fetchSelects:(0,m.tm)("chart","owners",(0,m.v$)((e=>t((0,i.t)("An error occurred while fetching chart owners values: %s",e)))),e.user),paginate:!0},{Header:(0,i.t)("Dashboard"),key:"dashboards",id:"dashboards",input:"select",operator:w.p.RelationManyMany,unfilteredLabel:(0,i.t)("All"),fetchSelects:Le,paginate:!0},...n?[Ae]:[],{Header:(0,i.t)("Certified"),key:"certified",id:"id",urlDisplay:"certified",input:"select",operator:w.p.ChartIsCertified,unfilteredLabel:(0,i.t)("Any"),selects:[{label:(0,i.t)("Yes"),value:!0},{label:(0,i.t)("No"),value:!1}]},{Header:(0,i.t)("Modified by"),key:"changed_by",id:"changed_by",input:"select",operator:w.p.RelationOneMany,unfilteredLabel:(0,i.t)("All"),fetchSelects:(0,m.tm)("chart","changed_by",(0,m.v$)((e=>(0,i.t)("An error occurred while fetching dataset datasource values: %s",e))),e.user),paginate:!0}]),[t,Ae,e.user]),Me=[{desc:!1,id:"slice_name",label:(0,i.t)("Alphabetical"),value:"alphabetical"},{desc:!0,id:"changed_on_delta_humanized",label:(0,i.t)("Recently modified"),value:"recently_modified"},{desc:!1,id:"changed_on_delta_humanized",label:(0,i.t)("Least recently modified"),value:"least_recently_modified"}],Re=(0,c.useCallback)((e=>(0,k.tZ)(Y.Z,{chart:e,showThumbnails:Se?Se.thumbnails:(0,u.cr)(u.TT.Thumbnails),hasPerm:L,openChartEditModal:de,bulkSelectEnabled:I,addDangerToast:t,addSuccessToast:a,refreshData:te,userId:n,loading:s,favoriteStatus:ie[e.id],saveFavoriteStatus:le,handleBulkChartExport:Ne})),[t,a,I,ie,L,s]),Fe=[];return(Ze||ke)&&Fe.push({name:(0,i.t)("Bulk select"),buttonStyle:"secondary","data-test":"bulk-select",onClick:ee}),we&&(Fe.push({name:(0,k.tZ)(c.Fragment,null,(0,k.tZ)("i",{className:"fa fa-plus"})," ",(0,i.t)("Chart")),buttonStyle:"primary",onClick:()=>{l.push("/chart/add")}}),Fe.push({name:(0,k.tZ)(Z.u,{id:"import-tooltip",title:(0,i.t)("Import charts"),placement:"bottomRight"},(0,k.tZ)($.Z.Import,null)),buttonStyle:"link",onClick:()=>{he(!0)}})),(0,k.tZ)(c.Fragment,null,(0,k.tZ)(_.Z,{name:(0,i.t)("Charts"),buttons:Fe}),se&&(0,k.tZ)(R.Z,{onHide:ue,onSave:oe,show:!0,slice:se}),(0,k.tZ)(b.Z,{title:(0,i.t)("Please confirm"),description:(0,i.t)("Are you sure you want to delete the selected charts?"),onConfirm:function(e){o.Z.delete({endpoint:`/api/v1/chart/?q=${p().encode(e.map((({id:e})=>e)))}`}).then((({json:e={}})=>{te(),a(e.message)}),(0,m.v$)((e=>t((0,i.t)("There was an issue deleting the selected charts: %s",e)))))}},(e=>{const n=[];return Ze&&n.push({key:"delete",name:(0,i.t)("Delete"),type:"danger",onSelect:e}),ke&&n.push({key:"export",name:(0,i.t)("Export"),type:"primary",onSelect:Ne}),(0,k.tZ)(w.Z,{bulkActions:n,bulkSelectEnabled:I,cardSortSelectOptions:Me,className:"chart-list-view",columns:xe,count:h,data:T,disableBulkSelect:ee,refreshData:te,fetchData:M,filters:Ce,initialSort:Ie,loading:s,pageSize:25,renderCard:Re,enableBulkTag:!0,bulkTagResourceName:"chart",addSuccessToast:a,addDangerToast:t,showThumbnails:Se?Se.thumbnails:(0,u.cr)(u.TT.Thumbnails),defaultViewMode:(0,u.cr)(u.TT.ListviewsDefaultCardView)?"card":"table"})})),(0,k.tZ)(F.Z,{resourceName:"chart",resourceLabel:(0,i.t)("chart"),passwordsNeededMessage:V,confirmOverwriteMessage:j,addDangerToast:t,addSuccessToast:a,onModelImport:()=>{he(!1),te(),a((0,i.t)("Chart imported"))},show:ce,onHide:()=>{he(!1)},passwordFields:pe,setPasswordFields:ge,sshTunnelPasswordFields:ve,setSSHTunnelPasswordFields:be,sshTunnelPrivateKeyFields:ye,setSSHTunnelPrivateKeyFields:_e,sshTunnelPrivateKeyPasswordFields:Pe,setSSHTunnelPrivateKeyPasswordFields:Ee}),me&&(0,k.tZ)(A.Z,null))}))},83379:(e,t,a)=>{"use strict";function n(e){return e?`${e.first_name} ${e.last_name}`:""}a.d(t,{Z:()=>n})},56590:(e,t)=>{"use strict";t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},53804:(e,t,a)=>{"use strict";var n=a(56590);t.createFirstEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:n.ITEM_TYPES.ELLIPSIS,key:n.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.FIRST_PAGE_LINK,key:n.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:n.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:n.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:n.ITEM_TYPES.NEXT_PAGE_LINK,key:n.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(a,t+1),isActive:t===a}},t.createLastPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:n.ITEM_TYPES.LAST_PAGE_LINK,key:n.ITEM_KEYS.LAST_PAGE_LINK,value:a,isActive:t===a}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:n.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},1158:(e,t)=>{"use strict";t.createRange=function(e,t){for(var a=[],n=e;n<=t;n++)a.push(n);return a}},2371:(e,t,a)=>{"use strict";var n=a(1158),r=a(53804);t.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var a=Number(e.currentPage);if(isNaN(a))throw new Error("getPaginationModel(): currentPage should be a number");if(a<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(a>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var l=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(l))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(l<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var i=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(i))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(i<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var s=Boolean(e.hidePreviousAndNextPageLinks),o=Boolean(e.hideFirstAndLastPageLinks),d=Boolean(e.hideEllipsis),u=d?0:1,c=[],h=r.createPageFunctionFactory(e);if(o||c.push(r.createFirstPageLink(e)),s||c.push(r.createPreviousPageLink(e)),1+2*u+2*i+2*l>=t){var p=n.createRange(1,t).map(h);c.push.apply(c,p)}else{var g=l,m=n.createRange(1,g).map(h),f=t+1-l,v=t,b=n.createRange(f,v).map(h),y=Math.min(Math.max(a-i,g+u+1),f-u-2*i-1),_=y+2*i,P=n.createRange(y,_).map(h);if(c.push.apply(c,m),!d){var E=y-1,S=(E===g+1?h:r.createFirstEllipsis)(E);c.push(S)}if(c.push.apply(c,P),!d){var w=_+1,T=(w===f-1?h:r.createSecondEllipsis)(w);c.push(T)}c.push.apply(c,b)}return s||c.push(r.createNextPageLink(e)),o||c.push(r.createLastPageLink(e)),c};var l=a(56590);t.ITEM_TYPES=l.ITEM_TYPES,t.ITEM_KEYS=l.ITEM_KEYS}}]);
//# sourceMappingURL=7a338015db6cea86bd5f.chunk.js.map