"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[9152],{40701:(e,t,n)=>{n.d(t,{J0:()=>T,YA:()=>g,bK:()=>_,CB:()=>b,Mu:()=>I,L1:()=>A,aZ:()=>w,qL:()=>R,nj:()=>h,x_:()=>L,LM:()=>v,Ww:()=>m,v7:()=>E,g3:()=>C,_p:()=>N,az:()=>F,iO:()=>O,Ou:()=>x,WZ:()=>f,A7:()=>y});var r=n(21090),o=n(61988),i=n(72570),s=n(81255),d=n(80621),a=n(47456),c=n(44803),l=n(81395),u=n(31758);const h="UPDATE_COMPONENTS";function p(e){return(...t)=>(n,r)=>{const o=e(...t);n("function"==typeof o?o(n,r):o);const{dashboardLayout:i,dashboardState:s}=r();if(o.type!==h||!o.payload||!o.payload.nextComponents){const e=i.present;n((0,l.P_)(e))}s.hasUnsavedChanges||n((0,u.if)(!0))}}const f=p((e=>({type:h,payload:{nextComponents:e}})));function y(e){return(t,n)=>{const{dashboardLayout:r}=n();t(f({[d.M2]:{...r.present[d.M2],meta:{text:e}}}))}}const _="DASHBOARD_TITLE_CHANGED";function m(e){return{type:_,text:e}}const b="DELETE_COMPONENT",E=p(((e,t)=>({type:b,payload:{id:e,parentId:t}}))),T="CREATE_COMPONENT",v=p((e=>({type:T,payload:{dropResult:e}}))),g="CREATE_TOP_LEVEL_TABS",S=p((e=>({type:g,payload:{dropResult:e}}))),I="DELETE_TOP_LEVEL_TABS",C=p((()=>({type:I,payload:{}}))),R="RESIZE_COMPONENT";function O({id:e,width:t,height:n}){return(r,o)=>{const{dashboardLayout:i}=o(),{present:s}=i,d=s[e],a=t&&d.meta.width!==t,c=n&&d.meta.height!==n;if(d&&(a||c)){const o={[e]:{...d,meta:{...d.meta,width:t||d.meta.width,height:n||d.meta.height}}};r(f(o))}}}const w="MOVE_COMPONENT",D=p((e=>({type:w,payload:{dropResult:e}}))),A="HANDLE_COMPONENT_DROP";function N(e){return(t,n)=>{const r=function(e,t){const n=(0,a.Z)({dropResult:e,layout:t});return"number"==typeof n&&n<0}(e,n().dashboardLayout.present);if(r)return t((0,i.Dz)((0,o.t)("There is not enough space for this component. Try decreasing its width, or increasing the destination width.")));const{source:l,destination:u}=e,h=u&&u.id===d._4,p=l.id===d.D0,f=n().dashboardLayout.present[d._4],y=f&&f.children?f.children[0]:"";if(h)t(S(e));else if(u&&p)t(v(e));else{if(l.type===s.yR&&u.type===s.yR&&l.id===y&&u.id!==y)return t((0,i.Dz)((0,o.t)("Can not move top level tab into nested tabs")));u&&l&&(u.id!==l.id||u.index!==l.index)&&t(D(e))}const{dashboardFilters:_,dashboardLayout:m}=n();if(!p){const{present:e}=m,n=e[l.id]||{},r=e[u.id]||{};if((n.type===s.yR||n.type===s.Os)&&n.children&&0===n.children.length){const n=(0,c.Z)({childId:l.id,layout:e});t(E(l.id,n))}(function({dashboardFilters:e={},source:t=[],destination:n=[]}){const r=new Set(t),o=new Set(n);return[].concat(...Object.values(e).map((({scopes:e})=>[].concat(...Object.values(e).map((({scope:e})=>e)))))).some((e=>o.has(e)!==r.has(e)))})({dashboardFilters:_,source:(n.parents||[]).concat(l.id),destination:(r.parents||[]).concat(u.id)})&&t((0,i.Dz)((0,o.t)("This chart has been moved to a different filter scope.")))}return null}}function x(){return(e,t)=>{e(r.zF.undo());const{dashboardLayout:n,dashboardState:o}=t();0!==n.past.length||o.maxUndoHistoryExceeded||o.updatedColorScheme||e((0,u.if)(!1))}}const F=p(r.zF.redo),L="UPDATE_COMPONENTS_PARENTS_LIST"},31758:(e,t,n)=>{n.d(t,{BD:()=>R,P0:()=>B,bs:()=>J,sm:()=>K,ec:()=>ee,k5:()=>X,Ii:()=>q,Vd:()=>O,PI:()=>w,nV:()=>ue,J$:()=>de,FF:()=>ge,RU:()=>ce,$f:()=>$,mq:()=>pe,r$:()=>me,n1:()=>Ee,yV:()=>G,ee:()=>I,oJ:()=>ne,ek:()=>M,Z9:()=>A,H9:()=>L,Iw:()=>ye,Be:()=>U,Pi:()=>oe,Mn:()=>Y,Lb:()=>x,Qt:()=>ve,z2:()=>W,YC:()=>Q,Yy:()=>te,Cd:()=>ie,rL:()=>se,M8:()=>V,TN:()=>F,dr:()=>Z,$_:()=>he,ps:()=>ae,sL:()=>Se,E2:()=>le,Mb:()=>H,GH:()=>fe,zL:()=>be,uN:()=>Te,fE:()=>k,if:()=>C,O8:()=>re,WL:()=>P,oY:()=>_e,Sn:()=>j});var r=n(21090),o=n(31069),i=n(61988),s=n(55786),d=n(78161),a=n(52256),c=n(37863),l=n(35854),u=n(98286),h=n(80621),p=n(72570),f=n(11370),y=n(43399),_=n(9679),m=n(91877),b=n(93185),E=n(40701),T=n(41295),v=n(50810),g=n(81395),S=n(52794);const I="SET_UNSAVED_CHANGES";function C(e){return{type:I,payload:{hasUnsavedChanges:e}}}const R="ADD_SLICE",O="REMOVE_SLICE",w="RESET_SLICE",D="/superset/favstar/Dashboard",A="TOGGLE_FAVE_STAR";function N(e){return{type:A,isStarred:e}}function x(e){return function(t){return o.Z.get({endpoint:`${D}/${e}/count/`}).then((({json:e})=>{e.count>0&&t(N(!0))})).catch((()=>t((0,p.Gb)((0,i.t)("There was an issue fetching the favorite status of this dashboard.")))))}}function F(e,t){return function(n){const r=t?"unselect":"select";return o.Z.get({endpoint:`${D}/${e}/${r}/`}).then((()=>{n(N(!t))})).catch((()=>n((0,p.Gb)((0,i.t)("There was an issue favoriting this dashboard.")))))}}const L="TOGGLE_PUBLISHED";function Z(e,t){return function(n){return o.Z.put({endpoint:`/api/v1/dashboard/${e}`,headers:{"Content-Type":"application/json"},body:JSON.stringify({published:t})}).then((()=>{n((0,p.ws)(t?(0,i.t)("This dashboard is now published"):(0,i.t)("This dashboard is now hidden"))),n(function(e){return{type:L,isPublished:e}}(t))})).catch((()=>{n((0,p.Gb)((0,i.t)("You do not have permissions to edit this dashboard.")))}))}}const M="TOGGLE_EXPAND_SLICE";function P(e){return{type:M,sliceId:e}}const U="UPDATE_CSS";function j(e){return{type:U,css:e}}const $="SET_EDIT_MODE";function H(e){return{type:$,editMode:e}}const B="ON_CHANGE";function W(){return{type:B}}const q="ON_SAVE",G="SET_REFRESH_FREQUENCY";function k(e,t=!1){return{type:G,refreshFrequency:e,isPersistent:t}}function z(e){return t=>{t(function(e){return{type:q,lastModifiedTime:e}}(e)),t(r.zF.clearHistory())}}function V(e,t,n){return(r,d)=>{var a,c,l,v,I,C,R;r({type:E.x_});const{dashboardFilters:O,dashboardLayout:w}=d(),D=w.present;Object.values(O).forEach((e=>{var t;const{chartId:n}=e,o=e.directPathToFilter.slice().pop(),i=((null==(t=D[o])?void 0:t.parents)||[]).slice();i.push(o),r((0,g.yz)(n,i))}));const A=(0,f.Z)((0,y.De)()),N=function(e){return Object.values(e).reduce(((e,{chartId:t,scopes:n})=>({...e,[t]:Object.keys(n).reduce(((e,t)=>({...e,[t]:n[t]})),{})})),{})}(O),{certified_by:x,certification_details:F,css:L,dashboard_title:Z,owners:M,roles:P,slug:U}=e,j=e=>void 0!==e.id,$={...e,certified_by:x||"",certification_details:x&&F?F:"",css:L||"",dashboard_title:Z||(0,i.t)("[ untitled dashboard ]"),owners:(0,s.Z)(M).map((e=>j(e)?e.id:e)),roles:(0,m.cr)(b.T.DASHBOARD_RBAC)?(0,s.Z)(P).map((e=>j(e)?e.id:e)):void 0,slug:U||null,metadata:{...e.metadata,color_namespace:(null==(a=e.metadata)?void 0:a.color_namespace)||void 0,color_scheme:(null==(c=e.metadata)?void 0:c.color_scheme)||"",expanded_slices:(null==(l=e.metadata)?void 0:l.expanded_slices)||{},label_colors:(null==(v=e.metadata)?void 0:v.label_colors)||{},shared_label_colors:(null==(I=e.metadata)?void 0:I.shared_label_colors)||{},refresh_frequency:(null==(C=e.metadata)?void 0:C.refresh_frequency)||0,timed_refresh_immune_slices:(null==(R=e.metadata)?void 0:R.timed_refresh_immune_slices)||[]}},H=()=>{const{dashboardInfo:{metadata:{chart_configuration:e={}}}}=d();return Object.values(e).reduce(((e,t)=>Object.values(D).find((e=>{var n;return(null==e||null==(n=e.meta)?void 0:n.chartId)===t.id}))?{...e,[t.id]:t}:e),{})},B=async e=>{const{error:t,message:n}=await(0,u.O)(e);let o=(0,i.t)("Sorry, an unknown error occurred");t&&(o=(0,i.t)("Sorry, there was an error saving this dashboard: %s",t)),"string"==typeof n&&"Forbidden"===n&&(o=(0,i.t)("You do not have permission to edit this dashboard")),r((0,p.Gb)(o))};if(n===h.TN){let e={};(0,m.cr)(b.T.DASHBOARD_CROSS_FILTERS)&&(e=H());const n={certified_by:$.certified_by,certification_details:$.certification_details,css:$.css,dashboard_title:$.dashboard_title,slug:$.slug,owners:$.owners,roles:$.roles,json_metadata:(0,_.o)({...(null==$?void 0:$.metadata)||{},default_filters:(0,_.o)(A),filter_scopes:N,chart_configuration:e})};return o.Z.put({endpoint:`/api/v1/dashboard/${t}`,headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then((e=>(e=>{const n=e.json.result,o=e.json.last_modified_time;if(n.json_metadata){const e=JSON.parse(n.json_metadata);r((0,T.a8)({metadata:e})),e.chart_configuration&&r({type:T.t$,chartConfiguration:e.chart_configuration}),e.native_filter_configuration&&r({type:S.qe,filterConfig:e.native_filter_configuration})}return o&&r(z(o)),window.history.pushState({event:"dashboard_properties_changed"},"",`/superset/dashboard/${U||t}/`),r((0,p.ws)((0,i.t)("This dashboard was saved successfully."))),e})(e))).catch((e=>B(e)))}const W={...$};W.metadata&&delete W.metadata;const q={...W,...(null==$?void 0:$.metadata)||{}};return o.Z.post({endpoint:`/superset/copy_dash/${t}/`,postPayload:{data:{...q,default_filters:(0,_.o)(A),filter_scopes:(0,_.o)(N)}}}).then((e=>(e=>{const t=e.json.last_modified_time;if(t&&r(z(t)),(0,m.cr)(b.T.DASHBOARD_CROSS_FILTERS)){const e=H();r((0,T.Aw)(e))}return r((0,p.ws)((0,i.t)("This dashboard was saved successfully."))),e})(e))).catch((e=>B(e)))}}function Y(e=[],t=!1,n=0,r){return(o,i)=>{if(!n)return void e.forEach((e=>o((0,a.refreshChart)(e,t,r))));const{metadata:s}=i().dashboardInfo,d=Math.max(n,s.stagger_time||5e3);"boolean"!=typeof s.stagger_refresh&&(s.stagger_refresh=void 0===s.stagger_refresh||"true"===s.stagger_refresh);const c=s.stagger_refresh?d/(e.length-1):0;e.forEach(((e,n)=>{setTimeout((()=>o((0,a.refreshChart)(e,t,r))),c*n)}))}}const J="ON_FILTERS_REFRESH",K="ON_FILTERS_REFRESH_SUCCESS";function Q(){return{type:K}}const X="ON_REFRESH_SUCCESS",ee="ON_REFRESH";function te(e=[],t=!1,n=0,r){return o=>{o({type:ee}),((e,t,n,r,o)=>new Promise((i=>{o(Y(e,t,n,r)),i()})))(e,t,n,r,o).then((()=>{o({type:X}),o({type:J})}))}}const ne="SHOW_BUILDER_PANE";function re(){return{type:ne}}function oe(e,t){return(n,r)=>{const{sliceEntities:o}=r(),i=o.slices[e];if(!i)return n((0,p.Dz)("Sorry, there is no chart definition associated with the chart trying to be added."));const s={...i.form_data,slice_id:i.slice_id},d={...c.u,id:e,form_data:s,formData:(0,l.oN)(s)};return Promise.all([n((0,a.addChart)(d,e)),n((0,v.QR)(s.datasource))]).then((()=>{n({type:R,slice:i}),i&&"filter_box"===i.viz_type&&n((0,g.KJ)(e,t,i.form_data))}))}}function ie(){return(e,t)=>{const{dashboardInfo:{metadata:n},dashboardState:r}=t();null!=r&&r.updateSlice&&null!=r&&r.editMode&&(n.shared_label_colors=(0,d.Z)().getColorMap(null==n?void 0:n.color_namespace,null==n?void 0:n.color_scheme),e((0,T.a8)({metadata:n})),e({type:w}))}}function se(e){return(t,n)=>{const r=n().sliceEntities.slices[e];r&&"filter_box"===r.viz_type&&t((0,g.ku)(e)),t({type:O,sliceId:e}),t((0,a.removeChart)(e));const{dashboardInfo:{metadata:o}}=n();(0,d.Z)().removeSlice(e),o.shared_label_colors=(0,d.Z)().getColorMap(null==o?void 0:o.color_namespace,null==o?void 0:o.color_scheme),t((0,T.a8)({metadata:o}))}}const de="SET_COLOR_SCHEME";function ae(e){return t=>{t(function(e){return{type:de,colorScheme:e}}(e)),t(C(!0))}}const ce="SET_DIRECT_PATH";function le(e){return{type:ce,path:e}}const ue="SET_ACTIVE_TABS";function he(e,t){return{type:ue,tabId:e,prevTabId:t}}const pe="SET_FOCUSED_FILTER_FIELD";function fe(e,t){return{type:pe,chartId:e,column:t}}const ye="UNSET_FOCUSED_FILTER_FIELD";function _e(e,t){return{type:ye,chartId:e,column:t}}const me="SET_FULL_SIZE_CHART_ID";function be(e){return{type:me,chartId:e}}const Ee="SET_MAX_UNDO_HISTORY_EXCEEDED";function Te(e=!0){return{type:Ee,payload:{maxUndoHistoryExceeded:e}}}function ve(){return(e,t)=>{const{dashboardLayout:n}=t(),r=n.past.length;return e((0,p.Dz)(`You have used all ${r} undo slots and will not be able to fully undo subsequent actions. You may save your current state to reset the history.`))}}const ge="SET_DATASETS_STATUS";function Se(e){return{type:ge,status:e}}},44803:(e,t,n)=>{n.d(t,{Z:()=>o});const r={};function o({childId:e,layout:t={}}){if(r[e]){const n=t[r[e]]||{};if(n.children&&n.children.includes(e))return n.id}return r[e]=function({childId:e,layout:t={}}){let n=null;const r=Object.keys(t);for(let o=0;o<=r.length-1;o+=1){const i=r[o],s=t[i]||{};if(i!==e&&s.children&&s.children.includes(e)){n=i;break}}return n}({childId:e,layout:t}),r[e]}},47456:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(80621),o=n(44803),i=n(72673),s=n(28428);function d({dropResult:e,layout:t}){const{source:n,destination:d,dragging:a}=e,c=n.id===r.D0?(0,s.Z)(a.type):t[a.id]||{};if(n.id===d.id)return c.meta.width;const{width:l,minimumWidth:u}=(0,i.Z)({component:c,components:t}),{width:h,occupiedWidth:p}=(0,i.Z)({id:d.id,components:t});let f=Number(h-p);if(Number.isNaN(f)){const{width:e,occupiedWidth:n}=(0,i.Z)({id:(0,o.Z)({childId:d.id,layout:t}),components:t});f=Number(e-n)}return Number.isNaN(f)||Number.isNaN(Number(l))||f>=l?l:f>=u?f:-1}},72673:(e,t,n)=>{n.d(t,{Z:()=>d});var r=n(44803),o=n(80621),i=n(81255);function s({id:e,components:t}){const n=t[e];if(!n)return 0;let r=0;return(n.children||[]).forEach((e=>{const n=t[e]||{};r+=(n.meta||{}).width||0})),r}function d({id:e,component:t,components:n={}}){const a={width:void 0,occupiedWidth:void 0,minimumWidth:void 0},c=t||n[e];return c?(a.width=(c.meta||{}).width,a.occupiedWidth=a.width,c.type===i.Os?(a.width=d({id:(0,r.Z)({childId:c.id,layout:n}),components:n}).width||o.cz,a.occupiedWidth=s({id:c.id,components:n}),a.minimumWidth=a.occupiedWidth||o.cx):c.type===i.BA?(a.minimumWidth=o.cx,a.occupiedWidth=0,(c.children||[]).forEach((e=>{n[e].type===i.Os&&(a.minimumWidth=Math.max(a.minimumWidth,s({id:e,components:n})))}))):c.type!==i.t&&c.type!==i.xh&&c.type!==i.dW||(a.minimumWidth=o.cx),a):a}},61358:(e,t,n)=>{n.d(t,{jt:()=>a,Aw:()=>c,J8:()=>u,cq:()=>h,Dr:()=>p,Me:()=>f,M:()=>y,MZ:()=>_});var r=n(31069),o=n(61988),i=n(15926),s=n.n(i),d=n(72570);const a="SET_REPORT";function c({userId:e,filterField:t,creationMethod:n,resourceId:i}){const c=s().encode({filters:[{col:t,opr:"eq",value:i},{col:"creation_method",opr:"eq",value:n},{col:"created_by",opr:"rel_o_m",value:e}]});return function(e){return r.Z.get({endpoint:`/api/v1/report/?q=${c}`}).then((({json:r})=>{e(function(e,t,n,r){return{type:a,report:e,resourceId:t,creationMethod:n,filterField:r}}(r,i,n,t))})).catch((()=>e((0,d.Gb)((0,o.t)("There was an issue fetching reports attached to this dashboard.")))))}}const l=(e,t)=>{const n=t(),{user:r,dashboardInfo:o,charts:i,explore:s}=n;if(o)e(c({userId:r.userId,filterField:"dashboard_id",creationMethod:"dashboards",resourceId:o.id}));else{const[t]=Object.keys(i);e(c({userId:s.user.userId,filterField:"chart_id",creationMethod:"charts",resourceId:i[t].id}))}},u="ADD_REPORT",h=e=>t=>r.Z.post({endpoint:"/api/v1/report/",jsonPayload:e}).then((({json:e})=>{t({type:u,json:e}),t((0,d.ws)((0,o.t)("The report has been created")))})),p="EDIT_REPORT",f=(e,t)=>n=>r.Z.put({endpoint:`/api/v1/report/${e}`,jsonPayload:t}).then((({json:e})=>{n({type:p,json:e}),n((0,d.ws)((0,o.t)("Report updated")))}));function y(e,t){return function(n){return r.Z.put({endpoint:encodeURI(`/api/v1/report/${e.id}`),headers:{"Content-Type":"application/json"},body:JSON.stringify({active:t})}).catch((()=>{n((0,d.Gb)((0,o.t)("We were unable to active or deactivate this report.")))})).finally((()=>{n(l)}))}}function _(e){return function(t){return r.Z.delete({endpoint:encodeURI(`/api/v1/report/${e.id}`)}).catch((()=>{t((0,d.Gb)((0,o.t)("Your report could not be deleted")))})).finally((()=>{t(l),t((0,d.ws)((0,o.t)("Deleted: %s",e.name)))}))}}},29147:(e,t,n)=>{n.d(t,{fG:()=>a,DG:()=>c});var r=n(67294),o=n(27600),i=n(23525),s=n(11965);const d=(0,r.createContext)({hideTitle:!1,hideTab:!1,hideNav:!1,hideChartControls:!1}),a=()=>(0,r.useContext)(d),c=({children:e})=>{const t=(0,i.eY)(o.KD.uiConfig)||0,[n]=(0,r.useState)({hideTitle:0!=(1&t),hideTab:0!=(2&t),hideNav:0!=(4&t),hideChartControls:0!=(8&t)});return(0,s.tZ)(d.Provider,{value:n},e)}},89474:(e,t,n)=>{n.d(t,{Cy:()=>V,h:()=>J});var r=n(14890),o=n(53894),i=n(72570),s=n(99543),d=n(37863),a=n(8868),c=n(61358),l=n(41295),u=n(63389),h=n(31758),p=n(39023),f=n(39759),y=n(24350),_=n.n(y),m=n(50810),b=n(37927),E=n(21090),T=n(80621),v=n(40701),g=n(81255);function S(e){return[g.BA,g.dW,g.xh,g.t].indexOf(e.type)>-1}var I=n(44803),C=n(47456);function R({currentComponent:e,layout:t={}}){if(e&&t[e.id]){const n=(e.parents||[]).slice();n.push(e.id),e.children.forEach((e=>{t[e].parents=n,R({currentComponent:t[e],layout:t})}))}}var O=n(28428);const w={[g.BG]:{[g.dW]:!0,[g.BA]:!0,[g.xh]:!0},[g.gn]:{[g.dW]:!0,[g.BA]:!0,[g.xh]:!0}};function D({parentType:e,childType:t}){if(!e||!t)return!1;const n=w[e];return!!n&&Boolean(n[t])}function A({dropResult:e,layout:t}){const{dragging:n,destination:r}=e,o=n.type,i=t[r.id],s=i.type;let d=(0,O.Z)(o,n.meta);d.parents=(i.parents||[]).concat(i.id),S(n)&&(d.meta.width=(0,C.Z)({dropResult:e,layout:t})||void 0);const a=D({parentType:s,childType:o}),c={[d.id]:d};if(a){const e=(0,O.Z)(g.Os);e.children=[d.id],e.parents=(i.parents||[]).concat(i.id),c[e.id]=e,d.parents=e.parents.concat(e.id),d=e}else if(o===g.yR){const e=(0,O.Z)(g.gn);e.parents=(i.parents||[]).concat(i.id),d.children=[e.id],c[e.id]=e}const l=[...i.children];return l.splice(r.index,0,d.id),c[r.id]={...i,children:l},c}const N={[u.$]:(e,t)=>({...t.data.dashboardLayout.present}),[v.nj](e,t){const{payload:{nextComponents:n}}=t;return{...e,...n}},[v.CB](e,t){const{payload:{id:n,parentId:r}}=t;if(!(r&&n&&e[n]&&e[r]))return e;const o={...e};function i(e,t){const n=o[e];delete o[e];const{children:r=[]}=n;r.forEach((t=>{i(t,e)}));const s=o[t];if(s){const n=(s.children||[]).indexOf(e);if(n>-1){const e=[...s.children];e.splice(n,1),o[t]={...s,children:e}}}}i(n,r);const s=o[r];return s.type===g.Os&&0===s.children.length&&i(r,(0,I.Z)({childId:r,layout:o})),o},[v.J0](e,t){const{payload:{dropResult:n}}=t,r=A({dropResult:n,layout:e});return{...e,...r}},[v.aZ](e,t){const{payload:{dropResult:n}}=t,{source:r,destination:o,dragging:i}=n;if(!r||!o||!i)return e;const s=function({entitiesMap:e,source:t,destination:n}){const r=[...e[t.id].children],o=[...e[n.id].children],i=r[t.index];if(t.id===n.id){const o=function(e,t,n){const r=[...e],[o]=r.splice(t,1);return r.splice(n,0,o),r}(r,t.index,n.index);return{...e,[t.id]:{...e[t.id],children:o}}}return r.splice(t.index,1),o.splice(n.index,0,i),{...e,[t.id]:{...e[t.id],children:r},[n.id]:{...e[n.id],children:o}}}({entitiesMap:e,source:r,destination:o});if(S(s[i.id])){const t=(0,C.Z)({dropResult:n,layout:e})||void 0;(s[i.id].meta||{}).width!==t&&(s[i.id]={...s[i.id],meta:{...s[i.id].meta,width:t}})}if(D({parentType:o.type,childType:i.type})){const e=s[o.id],t=e.children,n=(0,O.Z)(g.Os);n.children=[t[o.index]],n.parents=(e.parents||[]).concat(o.id),t[o.index]=n.id,s[n.id]=n}return{...e,...s}},[v.YA](e,t){const{payload:{dropResult:n}}=t,{source:r,dragging:o}=n,i=e[T._4],s=i.children[0],d=e[s];if(r.id!==T.D0){const t=e[o.id].children[0],n=e[t],r=[...d.children].filter((e=>e!==o.id));return{...e,[T._4]:{...i,children:[o.id]},[s]:{...d,children:[]},[t]:{...n,children:[...n.children,...r]}}}const a=A({dropResult:n,layout:e}),c=Object.values(a),l=c.find((e=>e.type===g.gn)),u=c.find((e=>e.type===g.yR));return l.children=[...d.children],a[s]={...d,children:[]},a[T._4]={...i,children:[u.id]},{...e,...a}},[v.Mu](e){const t=e[T._4],n=t.children[0],r=e[n];if(r.type!==g.yR)return e;let o=[];const i={...e};return r.children.forEach((t=>{const n=e[t];o=[...o,...n.children],delete i[t]})),delete i[n],i[T._4]={...t,children:[T.PV]},i[T.PV]={...e[T.PV],children:o},i},[v.x_](e){const t={...e};return R({currentComponent:t[T._4],layout:t}),{...t}},[v.bK]:(e,t)=>({...e,[T.M2]:{...e[T.M2],meta:{...e[T.M2].meta,text:t.text}}})},x=(0,E.ZP)((function(e={},t){return t.type in N?(0,N[t.type])(e,t):e}),{limit:T.Q9+2,ignoreInitialState:!0,filter:(0,E.an)([u.$,v.nj,v.CB,v.J0,v.YA,v.Mu,v.qL,v.aZ,v.L1])});var F=n(14670),L=n.n(F),Z=n(31069),M=n(9679),P=n(97381),U=n(3741),j=n(23279),$=n.n(j);const H=new class{constructor({callback:e=(()=>{}),sizeThreshold:t=1e3,delayThreshold:n=1e3}){this.queue=[],this.sizeThreshold=t,this.delayThrehold=n,this.trigger=$()(this.trigger.bind(this),this.delayThrehold),this.callback=e}append(e){this.queue.push(e),this.trigger()}trigger(){if(this.queue.length>0){const e=this.queue.splice(0,this.sizeThreshold);this.callback.call(null,e),this.queue.length>0&&this.trigger()}}}({callback:e=>{if(e.length<=0)return;let t="/superset/log/?explode=events";const{source:n,source_id:r}=e[0];if("dashboard"===n?t+=`&dashboard_id=${r}`:"slice"===n&&(t+=`&slice_id=${r}`),navigator.sendBeacon){const n=new FormData;n.append("events",(0,M.o)(e)),navigator.sendBeacon(t,n)}else Z.Z.post({endpoint:t,postPayload:{events:e},parseMethod:null})},sizeThreshold:1024,delayThreshold:1e3});let B=0;var W;const q=e=>(t=e)=>t,G=document.getElementById("app"),k=JSON.parse(null!=(W=null==G?void 0:G.getAttribute("data-bootstrap"))?W:"{}"),z={charts:d.Z,datasources:function(e,t){return t.type===m.Rn.SET_DATASOURCES?{...e,..._()(t.datasources,"uid")}:t.type===m.Rn.SET_DATASOURCE?{...e,[t.key]:t.datasource}:e||{}},dashboardInfo:function(e={},t){switch(t.type){case l.$A:return{...e,...t.newInfo,last_modified_time:Math.round((new Date).getTime()/1e3)};case u.$:return{...e,...t.data.dashboardInfo};default:return e}},dashboardFilters:p.ZP,dataMask:a.Z,nativeFilters:f.Z,dashboardState:function(e={},t){const n={[u.$]:()=>({...e,...t.data.dashboardState}),[h.Be]:()=>({...e,css:t.css}),[h.BD](){const n=new Set(e.sliceIds);return n.add(t.slice.slice_id),{...e,sliceIds:Array.from(n),updateSlice:!0}},[h.Vd](){const{sliceId:n}=t,r=new Set(e.sliceIds);return r.delete(n),{...e,sliceIds:Array.from(r)}},[h.PI]:()=>({...e,updateSlice:!1}),[h.Z9]:()=>({...e,isStarred:t.isStarred}),[h.H9]:()=>({...e,isPublished:t.isPublished}),[h.$f]:()=>({...e,editMode:t.editMode}),[h.n1](){const{maxUndoHistoryExceeded:n=!0}=t.payload;return{...e,maxUndoHistoryExceeded:n}},[h.oJ]:()=>({...e}),[h.J$]:()=>({...e,colorScheme:t.colorScheme,updatedColorScheme:!0}),[h.ek](){const n={...e.expandedSlices},{sliceId:r}=t;return n[r]?delete n[r]:n[r]=!0,{...e,expandedSlices:n}},[h.P0]:()=>({...e,hasUnsavedChanges:!0}),[h.Ii]:()=>({...e,hasUnsavedChanges:!1,maxUndoHistoryExceeded:!1,editMode:!1,updatedColorScheme:!1,updateSlice:!1,lastModifiedTime:t.lastModifiedTime}),[h.ee](){const{hasUnsavedChanges:n}=t.payload;return{...e,hasUnsavedChanges:n}},[h.yV]:()=>({...e,refreshFrequency:t.refreshFrequency,shouldPersistRefreshFrequency:t.isPersistent,hasUnsavedChanges:t.isPersistent}),[h.ec]:()=>({...e,isRefreshing:!0}),[h.bs]:()=>({...e,isFiltersRefreshing:!0}),[h.sm]:()=>({...e,isFiltersRefreshing:!1}),[h.k5]:()=>({...e,isRefreshing:!1}),[h.RU]:()=>({...e,directPathToChild:t.path,directPathLastUpdated:Date.now()}),[h.nV](){const n=new Set(e.activeTabs);return n.delete(t.prevTabId),n.add(t.tabId),{...e,activeTabs:Array.from(n)}},[h.mq]:()=>({...e,focusedFilterField:{chartId:t.chartId,column:t.column}}),[h.Iw]:()=>e.focusedFilterField&&t.chartId===e.focusedFilterField.chartId&&t.column===e.focusedFilterField.column?{...e,focusedFilterField:null}:e,[h.r$]:()=>({...e,fullSizeChartId:t.chartId}),[h.FF]:()=>({...e,datasetsStatus:t.status})};return t.type in n?n[t.type]():e},dashboardLayout:x,sliceEntities:b.Z,reports:function(e={},t){const n={[c.jt](){var n,r;const{report:o,resourceId:i,creationMethod:s,filterField:d}=t,a=null==(n=o.result)?void 0:n.find((e=>e[d]===i));if(a)return{...e,[s]:{...e[s],[i]:a}};if(null!=e&&null!=(r=e[s])&&r[i]){const t={...e};return delete t[s][i],t}return{...e}},[c.J8](){const{result:n,id:r}=t.json,o={...n,id:r},i=o.dashboard||o.chart;return{...e,[o.creation_method]:{...e[o.creation_method],[i]:o}}},[c.Dr](){const n={...t.json.result,id:t.json.id},r=n.dashboard||n.chart;return{...e,[n.creation_method]:{...e[n.creation_method],[r]:n}}}};return t.type in n?n[t.type]():e}},V="USER_LOADED",Y=(0,r.UY)({messageToasts:function(e=[],t){switch(t.type){case i.h:{const{payload:n}=t,r=e.slice();return n.noDuplicate&&r.find((e=>e.text===n.text))?e:[n,...e]}case i.K7:{const{payload:{id:n}}=t;return[...e].filter((e=>e.id!==n))}default:return e}},common:q(k.common||{}),user:(e=k.user||{},t)=>t.type===V?t.user:e,impressionId:q(L().generate()),...z}),J=(0,r.MT)(Y,{},(0,r.qC)((0,r.md)(o.Z,(e=>t=>n=>{var r;if(n.type!==P.LOG_EVENT)return t(n);const{dashboardInfo:o,explore:i,impressionId:s,dashboardLayout:d}=e.getState();let a={impression_id:s,version:"v2"};o?a={source:"dashboard",source_id:o.id,...a}:i&&(a={source:"explore",source_id:i.slice?i.slice.slice_id:0,...a});const{eventName:c}=n.payload;let{eventData:l={}}=n.payload;if(l={...a,ts:(new Date).getTime(),event_name:c,...l},U.TY.has(c)?l={...l,event_type:"timing",trigger_event:B}:(B=L().generate(),l={...l,event_type:"user",event_id:B,visibility:document.visibilityState}),l.target_id&&null!=d&&null!=(r=d.present)&&r[l.target_id]){const{meta:e}=d.present[l.target_id];l.target_name=e.chartId?e.sliceName:e.text}return H.append(l),l})),(0,s.hU)(!1)))}}]); //# sourceMappingURL=9152.6c1252754d0adb3d987c.entry.js.map