define(["exports","./../../modules/common/itemmanager/itemmanager.js","./../../modules/common/itemmanager/baseitemcontroller.js","./../../modules/emby-apiclient/connectionmanager.js","./../../modules/common/globalize.js"],function(_exports,_itemmanager,_baseitemcontroller,_connectionmanager,_globalize){function SyncJobItemController(){_baseitemcontroller.default.apply(this,arguments)}function getDeleteMessages(item){var title,text,confirmText=_globalize.default.translate("Remove");return"Convert"===item.SyncJobType?"Completed"!==item.Status?(title=_globalize.default.translate("CancelConversion"),text="ConfirmCancelConversion",confirmText=_globalize.default.translate("CancelConversion")):(title=_globalize.default.translate("RemoveFromHistory"),text="ConfirmRemoveFromHistory"):(title=_globalize.default.translate("RemoveDownload"),text="ConfirmRemoveDownload"),{single:{text:text,title:title,confirmText:confirmText},plural:{text:text,title:title,confirmText:confirmText}}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(SyncJobItemController.prototype,_baseitemcontroller.default.prototype),SyncJobItemController.prototype.getTypeNames=function(){return["SyncJobItem"]},SyncJobItemController.prototype.getDisplayName=function(item,options){return item.ItemName},SyncJobItemController.prototype.isSingleItemFetchRequired=function(typeName){return!1},SyncJobItemController.prototype.getDefaultIcon=function(item){return"&#xe627;"},SyncJobItemController.prototype.canDelete=function(item,user){return!0},SyncJobItemController.prototype.enableLibraryItemDeleteConfirmation=function(){return!1},SyncJobItemController.prototype.canRate=function(item){return!1},SyncJobItemController.prototype.canMarkPlayed=function(item){return!1},SyncJobItemController.prototype.canAddToPlaylist=function(item){return!1},SyncJobItemController.prototype.canAddToCollection=function(item,user){return!1},SyncJobItemController.prototype.canConvert=function(item,user){return!1},SyncJobItemController.prototype.canEdit=function(items,user){return!1},SyncJobItemController.prototype.canEditImages=function(item,user){return!1},SyncJobItemController.prototype.canEditSubtitles=function(item,user){return!1},SyncJobItemController.prototype.isDeletePrimaryCommand=function(itemType){return!0},SyncJobItemController.prototype.getDeleteCommand=function(items){var item=items[0],itemType=item.Type,item=getDeleteMessages(item);return{name:(1<items.length?item.plural:item.single).title,id:"delete",icon:"remove_circle_outline",primaryCommand:this.isDeletePrimaryCommand(itemType)}},SyncJobItemController.prototype.getDeleteMessages=getDeleteMessages,SyncJobItemController.prototype.canRefreshMetadata=function(item,user){return!1},SyncJobItemController.prototype.deleteItemsInternal=function(options){for(var isLocalTarget,apiClient=_connectionmanager.default.getApiClient(options.items[0]),localTargetId=_connectionmanager.default.deviceId(),ids=[],i=0,length=options.items.length;i<length;i++){var item=options.items[i];ids.push(item.Id),item.TargetId===localTargetId&&(isLocalTarget=!0)}return apiClient.cancelSyncJobItems(ids).then(function(result){return isLocalTarget&&require(["localsync"],function(localSync){localSync.sync()}),Promise.resolve(result)})},SyncJobItemController.prototype.getNameSortOption=function(itemType){return null},SyncJobItemController.prototype.editItems=function(items,options){return Promise.reject()},SyncJobItemController.prototype.resolveField=function(item,field){return _baseitemcontroller.default.prototype.resolveField.apply(this,arguments)};var instance=new SyncJobItemController;_itemmanager.default.registerItemController(instance),_exports.default=instance});