import{c4 as j,bc as f,aJ as w,az as c,n as r,aj as S,ao as s,aO as T,aF as v,L as A,aq as d,bU as n,m as L,o as u,W as R,E as U,r as k,v as C}from"./app-k0jcl5PQ.js";import{R as D}from"./BigZ58nN.chunk.js";const p="playlists.deletePlaylist",a=A.encloseNamespace(p);function B(e){const m=j(),l=f(),[y,h]=w.useState(!1),t=c(r.getPlaylist(e.playlistId)),o=c(S.currentUser()),x=()=>{h(!0);const P=()=>{D.removeRecentlyAddedTo(o.data.id,e.playlistId),l.success(a("success",{name:t.data.name,escapeText:!0})),u.logUserAction({id:e.playlistId,name:t.data.name},u.mergeOptions(e.analyticsOptions,{actionType:k.Delete,entity:U.Playlist,workflowPhase:R.Complete})),e.closePopup(),e.routeToOnDelete&&C.trigger(e.routeToOnDelete)},g=()=>{l.error(a("error",{name:t.data.name,escapeText:!0})),e.closePopup()};L(m,r.deletePlaylist(e.playlistId,P,g))},i=!!t.data&&!!o.data;return s.jsx(T.Provider,{value:p,children:s.jsx(v,{title:a("heading"),closePopup:e.closePopup,showLoadingSpinner:!i,children:i&&s.jsxs(s.Fragment,{children:[s.jsx("p",{children:s.jsx(d,{phrase:"warning",options:{name:t.data.name}})}),s.jsx("p",{children:s.jsx(d,{phrase:"videoNote"})}),s.jsxs(n,{children:[s.jsx(n.Cancel,{onClick:e.closePopup}),s.jsx(n.Submit,{variant:"danger",onClick:x,text:a("confirm"),showSpinner:y})]})]})})})}export{B as DeletePlaylistView};
//# sourceMappingURL=BpXYYr88.chunk.js.map
