define(["exports","./../modules/viewmanager/basesettingsview.js","./../modules/emby-elements/emby-input/emby-input.js","./../modules/emby-elements/emby-button/emby-button.js","./../modules/formhelper.js","./../modules/loading/loading.js"],function(_exports,_basesettingsview,_embyInput,_embyButton,_formhelper,_loading){function loadData(page,params){_loading.default.show();var params=params.id,promise1=ApiClient.getJSON(ApiClient.getUrl("Devices/Info",{Id:params})),params=ApiClient.getJSON(ApiClient.getUrl("Devices/Options",{Id:params}));return Promise.all([promise1,params]).then(function(responses){!function(page,device,deviceOptions){page.querySelector("#txtCustomName",page).value=deviceOptions.CustomName||"",page.querySelector(".reportedName",page).textContent=device.Name||""}(page,responses[0],responses[1]),_loading.default.hide()})}function View(view,params){_basesettingsview.default.apply(this,arguments),view.querySelector("form").addEventListener("submit",function(e){return function(page){var id=params.id;ApiClient.ajax({url:ApiClient.getUrl("Devices/Options",{Id:id}),type:"POST",data:JSON.stringify({CustomName:page.querySelector("#txtCustomName").value}),contentType:"application/json"}).then(_formhelper.default.handleConfigurationSavedResponse)}(this.closest(".page")),e.preventDefault(),!1})}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.default=void 0,Object.assign(View.prototype,_basesettingsview.default.prototype),View.prototype.loadSettingsInternal=function(){return loadData(this.view,this.params)},_exports.default=View});