import BaseView from"./../viewmanager/basesettingsview.js";import connectionManager from"./../emby-apiclient/connectionmanager.js";import appRouter from"./../approuter.js";import"./../emby-elements/emby-scroller/emby-scroller.js";import"./../emby-elements/emby-select/emby-select.js";import"./../emby-elements/emby-button/emby-button.js";import"./../emby-elements/emby-input/emby-input.js";import"./../emby-elements/emby-textarea/emby-textarea.js";import"./../emby-elements/emby-checkbox/emby-checkbox.js";import appSettings from"./../common/appsettings.js";function getPlayers(){return JSON.parse(appSettings.get("externalplayers")||"[]")}function loadPlayer(instance){instance.player=null;let params=instance.params;params.id&&(instance.player=getPlayers().filter(function(p){return p.id===params.id})[0]),instance.player?instance.isNewPlayer=!1:(instance.isNewPlayer=!0,instance.player={},instance.player["videotype-stream"]=!1,instance.player["videotype-file"]=!1)}function fillGameSystem(instance,value){var apiClient=connectionManager.currentApiClient();let view=instance.view,player=instance.player;apiClient.getItems(null,{EnableTotalRecordCount:!1,IncludeItemTypes:"GameSystem",Recursive:!0}).then(function(result){var selectGameSystem=view.querySelector(".selectGameSystem");selectGameSystem.innerHTML=result.Items.map(function(g){return'"}).join(""),value&&(selectGameSystem.value=player.gameSystem)})}function onMediaTypeChange(e){var mediaType=this.value,fields=this.closest(".view").querySelectorAll(".mediaTypeField");for(let i=0,length=fields.length;i