"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[46634],{46634:function(e,t,r){r.r(t),r.d(t,{deleteItem:function(){return c},deleteLyrics:function(){return y}}),r(78557),r(90076);var n=r(11444),l=r(41177),a=r(47602),i=r(70267),o=r(5898),s=r(67430);function u(e){return(0,l.A)(e)}function c(e){var t=e.item,r=t.SeasonId||t.SeriesId||t.ParentId,l=s.tF.getApiClient(t.ServerId);return(0,a.A)(function(e){if(e.Type===n.D.Series){var t=e.RecursiveItemCount;return{title:o.Ay.translate("HeaderDeleteSeries"),text:o.Ay.translate("ConfirmDeleteSeries",t),confirmText:o.Ay.translate("DeleteEntireSeries",t),primary:"delete"}}return e.Type===n.D.BoxSet?{title:o.Ay.translate("HeaderDeleteCollection"),text:o.Ay.translate("ConfirmDeleteCollection"),confirmText:o.Ay.translate("Delete"),primary:"delete"}:e.Type===n.D.Playlist?{title:o.Ay.translate("HeaderDeletePlaylist"),text:o.Ay.translate("ConfirmDeletePlaylist"),confirmText:o.Ay.translate("Delete"),primary:"delete"}:{title:o.Ay.translate("HeaderDeleteItem"),text:o.Ay.translate("ConfirmDeleteItem"),confirmText:o.Ay.translate("Delete"),primary:"delete"}}(t)).then((function(){return l.deleteItem(t.Id).then((function(){e.navigate&&(r?i.appRouter.showItem(r,t.ServerId):i.appRouter.goHome())}),(function(e){var t=function(){return Promise.reject(e)};return u(o.Ay.translate("ErrorDeletingItem")).then(t,t)}))}))}function y(e){return(0,a.A)({title:o.Ay.translate("HeaderDeleteLyrics"),text:o.Ay.translate("ConfirmDeleteLyrics"),confirmText:o.Ay.translate("Delete"),primary:"delete"}).then((function(){var t=s.tF.getApiClient(e.ServerId);return t.ajax({url:t.getUrl("Audio/"+e.Id+"/Lyrics"),type:"DELETE"}).catch((function(e){var t=function(){return Promise.reject(e)};return u(o.Ay.translate("ErrorDeletingLyrics")).then(t,t)}))}))}t.default={deleteItem:c,deleteLyrics:y}}}]);