"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[85198],{91155:function(e,t,a){a.r(t),a(44962),a(86584),a(78557),a(90076),a(83994),a(82367);var n=a(22696),i=a.n(n),l=a(98320),s=a(56869),o=a(47629),r=a(9482),d=(a(10353),a(40532)),y=a(89100);function c(e){s.Ay.show(),ApiClient.getJSON(ApiClient.getUrl("Auth/Keys")).then((function(t){!function(e,t){var a=t.map((function(e){var t="";t+='<tr class="detailTableBodyRow detailTableBodyRow-shaded">',t+='<td class="detailTableBodyCell">',t+='<button type="button" is="emby-button" data-token="'+i()(e.AccessToken)+'" class="raised raised-mini btnRevoke" data-mini="true" title="'+r.Ay.translate("ButtonRevoke")+'" style="margin:0;">'+r.Ay.translate("ButtonRevoke")+"</button>",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=i()(e.AccessToken),t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">',t+=i()(e.AppName)||"",t+="</td>",t+='<td class="detailTableBodyCell" style="vertical-align:middle;">';var a=l.Ay.parseISO8601Date(e.DateCreated,!0);return t+=l.Ay.toLocaleDateString(a)+" "+l.Ay.getDisplayTime(a),(t+="</td>")+"</tr>"})).join("");e.querySelector(".resultBody").innerHTML=a,s.Ay.hide()}(e,t.Items)}))}(0,y.pageIdOn)("pageinit","apiKeysPage",(function(){var e=this;e.querySelector(".btnNewKey").addEventListener("click",(function(){!function(e){a.e(72521).then(a.bind(a,72521)).then((function(t){(0,t.default)({title:r.Ay.translate("HeaderNewApiKey"),label:r.Ay.translate("LabelAppName"),description:r.Ay.translate("LabelAppNameExample")}).then((function(t){ApiClient.ajax({type:"POST",url:ApiClient.getUrl("Auth/Keys",{App:t})}).then((function(){c(e)}))}))}))}(e)})),e.querySelector(".tblApiKeys").addEventListener("click",(function(t){var a=o.Ay.parentWithClass(t.target,"btnRevoke");a&&function(e,t){(0,d.A)(r.Ay.translate("MessageConfirmRevokeApiKey"),r.Ay.translate("HeaderConfirmRevokeApiKey")).then((function(){s.Ay.show(),ApiClient.ajax({type:"DELETE",url:ApiClient.getUrl("Auth/Keys/"+t)}).then((function(){c(e)}))}))}(e,a.getAttribute("data-token"))}))})),(0,y.pageIdOn)("pagebeforeshow","apiKeysPage",(function(){c(this)}))}}]);